From f0102cc7df9a1e1faddb908e6423981c15db4d7d Mon Sep 17 00:00:00 2001 From: JisanAR03 Date: Fri, 8 Mar 2024 14:42:41 +0600 Subject: [PATCH 1/2] Implement Daily Contributor Stats Feature --- blt/urls.py | 1 + contributors.json | 2 +- website/templates/contributor_stats.html | 33 +++++++++++++++++++++++ website/templates/includes/sidenav.html | 7 +++++ website/views.py | 34 +++++++++++++++--------- 5 files changed, 63 insertions(+), 14 deletions(-) diff --git a/blt/urls.py b/blt/urls.py index e6031f38dd..509bcc7391 100644 --- a/blt/urls.py +++ b/blt/urls.py @@ -482,6 +482,7 @@ name="update_bch_address", ), re_path(r"^contributor-stats/$", ContributorStatsView.as_view(), name="contributor-stats"), + re_path(r"^contributor-stats/today$", ContributorStatsView.as_view(today=True), name="today-contributor-stats"), ] if settings.DEBUG: diff --git a/contributors.json b/contributors.json index 3b74e5e3ee..21f82ac6c4 100644 --- a/contributors.json +++ b/contributors.json @@ -434,7 +434,7 @@ "img":"https://avatars.githubusercontent.com/u/97744811?v=4", "name":"Altafur Rahman", "repository":"BLT | BLT-Flutter", - "short_description":"always want do something for the world☺", + "short_description":"always want to do something for the world☺", "long_description":"Hi there, I'm Altafur Rahman Jisan! With a knack for Python and a dash of JavaScript, I turn code into comfort, crafting web experiences that feel like home. 🏡✨", "location":"Chittagong, Bangladesh", "twitter":"https://twitter.com/JisanAR03", diff --git a/website/templates/contributor_stats.html b/website/templates/contributor_stats.html index 5f4cdf43bd..a82e124dd9 100644 --- a/website/templates/contributor_stats.html +++ b/website/templates/contributor_stats.html @@ -6,6 +6,38 @@ {% endblock style %} {% block content %} {% include "includes/sidenav.html" %} + {% if today %} + +
+ + + + + + + + + {% for username, prs in user_stats %} + + + + + {% empty %} + + + + {% endfor %} + +
UsernamePull Requests
+ {{ username }} + + {{ prs }} +
No activity found.
+
+ {% else %}
@@ -60,6 +92,7 @@
+ {% endif %} {% endblock content %} {% block scripts %}