From f79773a1adae0235e5f00a2fa8df7e9c49e3417e Mon Sep 17 00:00:00 2001 From: Pulkit Agrawal Date: Thu, 7 Dec 2023 22:03:29 +0530 Subject: [PATCH 01/13] Update _bug.html --- website/templates/_bug.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/website/templates/_bug.html b/website/templates/_bug.html index a5aeaf421..e86a719fe 100644 --- a/website/templates/_bug.html +++ b/website/templates/_bug.html @@ -70,16 +70,16 @@ - - - - - - - + + + + + + + \ No newline at end of file From 5491122932de4bd035755b3685fdda4beeae360c Mon Sep 17 00:00:00 2001 From: Deus1704 Date: Thu, 21 Dec 2023 04:44:23 +0530 Subject: [PATCH 02/13] fixed the global and monthly leaderboard alignment issues --- website/templates/leaderboard_eachmonth.html | 6 +++--- website/templates/leaderboard_global.html | 20 +++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/website/templates/leaderboard_eachmonth.html b/website/templates/leaderboard_eachmonth.html index c3660a566..aa56eaf0d 100644 --- a/website/templates/leaderboard_eachmonth.html +++ b/website/templates/leaderboard_eachmonth.html @@ -50,7 +50,7 @@

Monthly Leaderboard

-
+
{%if not leaderboard%} @@ -67,9 +67,9 @@

Monthly Leaderboard

{% if month.user.userprofile.avatar %} {% elif user.socialaccount_set.all.0.get_avatar_url %} - + {% else %} - + {% endif %} {{ month.user.username }} {{ month.user.total_score }} Points diff --git a/website/templates/leaderboard_global.html b/website/templates/leaderboard_global.html index 50578262a..c69c13fbe 100644 --- a/website/templates/leaderboard_global.html +++ b/website/templates/leaderboard_global.html @@ -20,6 +20,16 @@ margin-left: 10px; } + @media (min-height: 800px) and (min-width: 992px) { + .col-md-8 { + width: 66.66666667%; + }} + @media (min-height: 800px) and (min-width: 360px) { + .col-md-8 { + width: 90%; + font-size: small; + }} + .silver { background-color: lightblue; color: #333; @@ -48,13 +58,13 @@ {% endblock %} {% block content %} -
+

Global Leaderboard

-
-
+
+
{%if not leaderboard%}

No data for this month

@@ -64,9 +74,9 @@

Global Leaderboard

{% if leader.userprofile.avatar %} {% elif leader.socialaccount_set.all.0.get_avatar_url %} - + {% else %} - + {% endif %} {{ leader.username }} {{ leader.total_score }} Points From 0a04abe8450bb0f30171eab03d9442b9ad73b391 Mon Sep 17 00:00:00 2001 From: Pulkit Agrawal Date: Thu, 21 Dec 2023 18:58:03 +0530 Subject: [PATCH 03/13] font fix --- website/templates/base_new.html | 1 + 1 file changed, 1 insertion(+) diff --git a/website/templates/base_new.html b/website/templates/base_new.html index b966816f7..5700f7fad 100644 --- a/website/templates/base_new.html +++ b/website/templates/base_new.html @@ -34,6 +34,7 @@ + From c94e4a22431cf722e1fd12f2d30da1db06502b13 Mon Sep 17 00:00:00 2001 From: Pulkit Agrawal Date: Fri, 22 Dec 2023 17:11:18 +0530 Subject: [PATCH 04/13] created the leaderboard widget on the new home page --- website/templates/_leaderboard_widget.html | 73 ++++++++++++++++++++++ website/templates/base_new.html | 3 +- website/templates/new_home.html | 9 ++- website/views.py | 8 +-- 4 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 website/templates/_leaderboard_widget.html diff --git a/website/templates/_leaderboard_widget.html b/website/templates/_leaderboard_widget.html new file mode 100644 index 000000000..b3f1ca398 --- /dev/null +++ b/website/templates/_leaderboard_widget.html @@ -0,0 +1,73 @@ +{% load static %} +{% load gravatar %} +{% load socialaccount %} +{% load humanize %} +{% providers_media_js %} +{% load i18n %} +{% load custom_tags %} + + + +{% comment %} positions the leaderboard rightmost {% endcomment %} + diff --git a/website/templates/base_new.html b/website/templates/base_new.html index 5700f7fad..0ad4a7682 100644 --- a/website/templates/base_new.html +++ b/website/templates/base_new.html @@ -33,8 +33,7 @@ - - + diff --git a/website/templates/new_home.html b/website/templates/new_home.html index 19daf5e00..05353c4c8 100644 --- a/website/templates/new_home.html +++ b/website/templates/new_home.html @@ -7,10 +7,17 @@ }
Find bugs, earn points, prize and cash!
-
+
+ {% include '_report_widget.html' %} + + {% if leaderboard %} + {% include '_leaderboard_widget.html' %} + {% endif %} + {% for bug in bugs %} {% include '_bug.html' %} + {% endfor %}
diff --git a/website/views.py b/website/views.py index 671856889..68c74a922 100644 --- a/website/views.py +++ b/website/views.py @@ -246,10 +246,10 @@ def newhome(request, template="new_home.html"): # "server_url": request.build_absolute_uri('/'), # "activities": activities, # "hunts": Hunt.objects.exclude(txn_id__isnull=True)[:4], - # "leaderboard": User.objects.filter( - # points__created__month=datetime.now().month, - # points__created__year=datetime.now().year, - # ) + "leaderboard": User.objects.filter( + points__created__month=datetime.now().month, + points__created__year=datetime.now().year, + ) # .annotate(total_score=Sum("points__score")) # .order_by("-total_score")[:10], # "bug_count": bug_count, From 24239759ebda73b8636d28704bf155dd26793664 Mon Sep 17 00:00:00 2001 From: Pulkit Agrawal Date: Fri, 22 Dec 2023 17:15:04 +0530 Subject: [PATCH 05/13] updated pagination pagination needs to show 9 bugs on a page as the leaderboard has to be adjusted. --- website/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/views.py b/website/views.py index 68c74a922..78b1f2f51 100644 --- a/website/views.py +++ b/website/views.py @@ -194,7 +194,7 @@ def newhome(request, template="new_home.html"): for bug in bugs: bugs_screenshots[bug] = IssueScreenshot.objects.filter(issue=bug)[0:3] - paginator = Paginator(bugs, 7) + paginator = Paginator(bugs, 9) page_number = request.GET.get('page') page_obj = paginator.get_page(page_number) From 6a77b2581850b444e66dc931e20d12b78f8bba55 Mon Sep 17 00:00:00 2001 From: Pulkit Agrawal Date: Fri, 22 Dec 2023 22:19:24 +0530 Subject: [PATCH 06/13] empty leaderboard message shows message if leaderboard is empty --- website/templates/_leaderboard_widget.html | 8 +++----- website/templates/new_home.html | 4 +--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/website/templates/_leaderboard_widget.html b/website/templates/_leaderboard_widget.html index b3f1ca398..9a53bbc0c 100644 --- a/website/templates/_leaderboard_widget.html +++ b/website/templates/_leaderboard_widget.html @@ -1,10 +1,5 @@ -{% load static %} {% load gravatar %} -{% load socialaccount %} {% load humanize %} -{% providers_media_js %} -{% load i18n %} -{% load custom_tags %}
@@ -21,6 +16,9 @@
+ {% if not leaderboard %} + Leaderboard has been reset for {% now "F" %}, be the first to find issues! + {% endif %} {% for leader in leaderboard %} diff --git a/website/templates/new_home.html b/website/templates/new_home.html index 05353c4c8..3075b3bd4 100644 --- a/website/templates/new_home.html +++ b/website/templates/new_home.html @@ -11,9 +11,7 @@ {% include '_report_widget.html' %} - {% if leaderboard %} - {% include '_leaderboard_widget.html' %} - {% endif %} + {% include '_leaderboard_widget.html' %} {% for bug in bugs %} {% include '_bug.html' %} From e67870ddc9b23246f7543e43a82b81717c88af16 Mon Sep 17 00:00:00 2001 From: Pulkit Agrawal Date: Sat, 30 Dec 2023 23:51:53 +0530 Subject: [PATCH 07/13] font fix --- website/templates/base_new.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/templates/base_new.html b/website/templates/base_new.html index 0ad4a7682..bdab8a870 100644 --- a/website/templates/base_new.html +++ b/website/templates/base_new.html @@ -60,7 +60,7 @@ - + {% comment %} navigation {% endcomment %} {% include "includes/header.html" %} From e4f40db008b548571dc1a6cbb921838e9048514a Mon Sep 17 00:00:00 2001 From: Pulkit Agrawal Date: Fri, 22 Dec 2023 22:48:50 +0530 Subject: [PATCH 08/13] like and flag fix there was a typo in flagged (has been changed to issue_flaged intentionally). Now likes and flags retain and update. --- website/alternative_views.py | 2 ++ website/templates/_bug.html | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/website/alternative_views.py b/website/alternative_views.py index 8d27a3ddf..a4e4d9796 100644 --- a/website/alternative_views.py +++ b/website/alternative_views.py @@ -66,7 +66,9 @@ def flag_issue2(request, issue_pk): issue_pk = int(issue_pk) issue = Issue.objects.get(pk=issue_pk) userprof = UserProfile.objects.get(user=request.user) + print(UserProfile.objects.filter(issue_flaged=issue)) if userprof in UserProfile.objects.filter(issue_flaged=issue): + print("already flagged") userprof.issue_flaged.remove(issue) else: userprof.issue_flaged.add(issue) diff --git a/website/templates/_bug.html b/website/templates/_bug.html index e86a719fe..2c2e8cf01 100644 --- a/website/templates/_bug.html +++ b/website/templates/_bug.html @@ -40,7 +40,7 @@ - {% with user_issue_upvoted_list=bug.user.userprofile.issue_upvoted.all %} + {% with user_issue_upvoted_list=user.userprofile.issue_upvoted.all %} {% if user_issue_upvoted_list and bug in user_issue_upvoted_list %} + - - -{% endblock %} + }, + }, + }, + }); + } + + function populateSpentOnBugTypes() { + const ctx2 = document.getElementById("spentOnBugTypes"); + + new Chart(ctx2, { + type: "doughnut", + data: { + labels: JSON.parse('{{ spent_on_bugtypes.labels | safe }}'), + datasets: [ + { + data: JSON.parse('{{ spent_on_bugtypes.data | safe }}'), + borderRadius: 5, + cutout: 80, + backgroundColor: [ + "rgb(235, 124, 166)", + "rgb(255, 172, 200)", + "rgb(204, 111, 248)", + "rgb(124, 92, 252)", + "rgb(92, 175, 252)", + "rgb(161, 169, 254)", + "rgb(161, 169, 254)", + "rgb(161, 169, 254)", + ], + hoverOffset: 4, + spacing: 8, + }, + ], + }, + options: { + plugins: { + legend: { + display: false, + }, + }, + }, + }); + } + + populateSpentOnBugTypes(); + populateMonthlyReportBarChart(); + populateReportOnDomainsPie(); + populateBugTypePie(); + + +{% endblock %} \ No newline at end of file From c11e3488923f1e2020ae1b7a52f91c6eff48f201 Mon Sep 17 00:00:00 2001 From: Ankit Kokane Date: Thu, 4 Jan 2024 03:16:01 +0530 Subject: [PATCH 12/13] Changes in card CSS --- company/templates/company/company_analytics.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/company/templates/company/company_analytics.html b/company/templates/company/company_analytics.html index 7322283b6..a681749f8 100644 --- a/company/templates/company/company_analytics.html +++ b/company/templates/company/company_analytics.html @@ -4,7 +4,7 @@ {% block body %} -