Skip to content

Commit

Permalink
Merge branch 'main' into about-badges
Browse files Browse the repository at this point in the history
  • Loading branch information
JisanAR03 authored Jan 1, 2025
2 parents e49e138 + 3eb33de commit 1863245
Show file tree
Hide file tree
Showing 8 changed files with 680 additions and 9 deletions.
2 changes: 2 additions & 0 deletions blt/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
ProjectListView,
ProjectsDetailView,
ProjectView,
RepoDetailView,
blt_tomato,
create_project,
distribute_bacon,
Expand Down Expand Up @@ -591,6 +592,7 @@
re_path(r"^api/v1/contributors/$", contributors, name="api_contributor"),
path("project/<slug:slug>/", ProjectDetailView.as_view(), name="project_view"),
path("projects/<slug:slug>/badge/", ProjectBadgeView.as_view(), name="project-badge"),
path("repository/<slug:slug>/", RepoDetailView.as_view(), name="repo_detail"),
re_path(r"^report-ip/$", ReportIpView.as_view(), name="report_ip"),
re_path(r"^reported-ips/$", ReportedIpListView.as_view(), name="reported_ips_list"),
re_path(r"^feed/$", feed, name="feed"),
Expand Down
6 changes: 3 additions & 3 deletions website/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,9 +666,9 @@ def update_streak_and_award_points(self, check_in_date=None):
elif self.current_streak == 30:
points_awarded += 50
reason = "30-day streak milestone achieved!"
elif self.current_streak == 90:
elif self.current_streak == 100:
points_awarded += 150
reason = "90-day streak milestone achieved!"
reason = "100-day streak milestone achieved!"
elif self.current_streak == 180:
points_awarded += 300
reason = "180-day streak milestone achieved!"
Expand Down Expand Up @@ -700,7 +700,7 @@ def award_streak_badges(self):
7: "Weekly Streak",
15: "Half-Month Streak",
30: "Monthly Streak",
90: "Three Month Streak",
100: "100 Day Streak",
180: "Six Month Streak",
365: "Yearly Streak",
}
Expand Down
33 changes: 33 additions & 0 deletions website/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,20 @@
color: #ff5722;
font-weight: bold;
}
.shine-effect {
background: linear-gradient(
90deg,
transparent,
rgba(255, 255, 255, 0.3),
transparent
);
animation: shine 2s infinite;
}

@keyframes shine {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
</style>
{% endblock style %}
{% block content %}
Expand Down Expand Up @@ -386,6 +400,25 @@ <h4 class="text-[16px] font-semibold uppercase tracking-wide mb-2">
<span><i class="fa fa-calendar-check mr-2 text-red-500"></i> Last Sizzle Check-in:</span>
<span class="font-bold text-red-500">{{ user.userprofile.last_check_in|default:"N/A" }}</span>
</div>
<div class="my-8 p-4 rounded-lg w-full">
<div class="flex items-center justify-between mb-2 font-medium">
<span>Streak Progress</span>
<div class="flex items-center gap-2">
<i class="fas fa-trophy text-yellow-500"></i>
<span class="font-bold">{{ base_milestone }}/{{ next_milestone }}</span>
</div>
</div>
<div class="relative w-full bg-gradient-to-r from-gray-100 to-gray-200 rounded-full h-3 overflow-hidden shadow-inner">
<div class="absolute top-0 left-0 h-full bg-gradient-to-r from-blue-700 to-red-600 rounded-full transition-all duration-500 ease-out animate-pulse"
style="width: {% widthratio base_milestone next_milestone 100 %}%">
<div class="absolute inset-0 bg-white/20 shine-effect"></div>
</div>
</div>
<div class="flex justify-between mt-1">
<span class="text-md text-gray-500">Current</span>
<span class="text-md text-gray-500">Next Milestone</span>
</div>
</div>
</div>
</div>
<!--add a link here to edit the profile /profile/edit -->
Expand Down
9 changes: 6 additions & 3 deletions website/templates/projects/project_detail.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% extends "base.html" %}
{% load humanize %}
{% load static %}
{% block title %}{{ project.name }} - Project Details{% endblock %}
{% block title %}
{{ project.name }} - Project Details
{% endblock title %}
{% block content %}
{% include "includes/sidenav.html" %}
<div class="container mx-auto px-4 py-8 max-w-7xl">
Expand Down Expand Up @@ -164,14 +166,15 @@ <h2 class="text-2xl font-bold text-gray-900">Associated Repositories</h2>
{% for repo in repositories %}
<div class="bg-white rounded-xl border-2 border-gray-200 hover:border-red-500 transition-all duration-200 hover:shadow-lg">
<div class="p-6">
<div class="flex items-center justify-between mb-4">
<a href="{% url 'repo_detail' repo.slug %}"
class="flex items-center justify-between mb-4">
<h3 class="text-xl font-bold text-gray-800">{{ repo.name }}</h3>
{% if repo.is_main %}
<span class="px-3 py-1 bg-green-100 text-green-800 rounded-full text-sm font-medium">Main</span>
{% elif repo.is_wiki %}
<span class="px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm font-medium">Wiki</span>
{% endif %}
</div>
</a>
{% if repo.description %}<p class="text-gray-600 text-base leading-relaxed mb-6">{{ repo.description }}</p>{% endif %}
<!-- Repository Stats -->
<div class="grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6">
Expand Down
5 changes: 3 additions & 2 deletions website/templates/projects/project_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ <h2 class="text-3xl font-bold text-white mb-2 group-hover:underline">{{ project.
<div class="bg-white rounded-xl border-2 border-gray-200 hover:border-red-500 transition-all duration-200 hover:shadow-lg">
<div class="p-6">
<!-- Repository Header -->
<div class="flex items-center justify-between mb-4">
<a href="{% url 'repo_detail' repo.slug %}"
class="flex items-center justify-between mb-4">
<h3 class="text-xl font-bold text-gray-800">{{ repo.name }}</h3>
{% if repo.is_main %}
<span class="px-4 py-1.5 bg-green-100 text-green-800 rounded-full text-sm font-medium">Main</span>
Expand All @@ -186,7 +187,7 @@ <h3 class="text-xl font-bold text-gray-800">{{ repo.name }}</h3>
{% else %}
<span class="px-4 py-1.5 bg-gray-100 text-gray-800 rounded-full text-sm font-medium">Normal</span>
{% endif %}
</div>
</a>
<!-- Repository Description -->
<p class="text-gray-600 text-base leading-relaxed mb-6">
{{ repo.description|default:"No description available."|truncatechars:150 }}
Expand Down
Loading

0 comments on commit 1863245

Please sign in to comment.