diff --git a/website/models.py b/website/models.py index 113bb9fe2..47fd23570 100644 --- a/website/models.py +++ b/website/models.py @@ -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!" @@ -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", } diff --git a/website/templates/profile.html b/website/templates/profile.html index 8281532bc..d3e334312 100644 --- a/website/templates/profile.html +++ b/website/templates/profile.html @@ -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%); } + } {% endblock style %} {% block content %} @@ -386,6 +400,25 @@

Last Sizzle Check-in: {{ user.userprofile.last_check_in|default:"N/A" }} +
+
+ Streak Progress +
+ + {{ base_milestone }}/{{ next_milestone }} +
+
+
+
+
+
+
+
+ Current + Next Milestone +
+
diff --git a/website/views/user.py b/website/views/user.py index add5e0aed..68c2f7ea7 100644 --- a/website/views/user.py +++ b/website/views/user.py @@ -219,9 +219,19 @@ def get_context_data(self, **kwargs): user = self.object context = super(UserProfileDetailView, self).get_context_data(**kwargs) + milestones = [7, 15, 30, 100, 180, 365] + base_milestone = 0 + next_milestone = 0 + for milestone in milestones: + if user.userprofile.current_streak >= milestone: + base_milestone = milestone + elif user.userprofile.current_streak < milestone: + next_milestone = milestone + break + context["base_milestone"] = base_milestone + context["next_milestone"] = next_milestone # Fetch badges user_badges = UserBadge.objects.filter(user=user).select_related("badge") - context["user_badges"] = user_badges # Add badges to context context["is_mentor"] = UserBadge.objects.filter(user=user, badge__title="Mentor").exists() context["available_badges"] = Badge.objects.all()