From ce47868fb484ba72c3abed55c5495680a20aaa26 Mon Sep 17 00:00:00 2001 From: VishalMinj Date: Mon, 21 Oct 2024 16:27:55 +0530 Subject: [PATCH 1/4] Feat: Added issue count in rank page --- user_profile/templates/user_profile/rankings.html | 5 ++++- user_profile/views.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/user_profile/templates/user_profile/rankings.html b/user_profile/templates/user_profile/rankings.html index 12fcad1..e3a2dd4 100644 --- a/user_profile/templates/user_profile/rankings.html +++ b/user_profile/templates/user_profile/rankings.html @@ -19,15 +19,18 @@ Rank Username + Issues Resolved Total Points Bonus Points Deducted Points - {% for contributor in contributors %} + {% for contributor,issues_resolved in contributors %} {% if contributor.total_points > 0 %} {{ forloop.counter }} @{{ contributor.user.username }} + {{ issues_resolved }} + {{ contributor.total_points }} diff --git a/user_profile/views.py b/user_profile/views.py index c2bde0b..9c51565 100644 --- a/user_profile/views.py +++ b/user_profile/views.py @@ -197,8 +197,10 @@ def edit_profile(request): @login_required def rankings(request): contributors = UserProfile.objects.filter(role=UserProfile.STUDENT).order_by('-total_points') + issues_resolved = [ PullRequest.objects.filter(contributor=contributor.user, state=1).count() for contributor in contributors ] + contributors=zip(contributors,issues_resolved) context = { - 'contributors': contributors, + 'contributors': list(contributors), } # TODO:ISSUE: Display number of Issues solved as well in the Rankings return render(request, 'user_profile/rankings.html', context=context) From 314ca000a480c717f95eb710062ff4e29b76c793 Mon Sep 17 00:00:00 2001 From: Vishal Minj <119677246+VishalMinj@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:42:21 +0530 Subject: [PATCH 2/4] Update views.py: Flake test --- user_profile/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/user_profile/views.py b/user_profile/views.py index 9c51565..d3e0811 100644 --- a/user_profile/views.py +++ b/user_profile/views.py @@ -197,8 +197,10 @@ def edit_profile(request): @login_required def rankings(request): contributors = UserProfile.objects.filter(role=UserProfile.STUDENT).order_by('-total_points') - issues_resolved = [ PullRequest.objects.filter(contributor=contributor.user, state=1).count() for contributor in contributors ] - contributors=zip(contributors,issues_resolved) + issues_resolved = [ + PullRequest.objects.filter(contributor=contributor.user, state=1).count() for contributor in contributors + ] + contributors = zip(contributors, issues_resolved) context = { 'contributors': list(contributors), } From e7153ef019e474b10a3ca09c4178b7c3f8960507 Mon Sep 17 00:00:00 2001 From: Vishal Minj <119677246+VishalMinj@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:46:15 +0530 Subject: [PATCH 3/4] Update views.py --- user_profile/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_profile/views.py b/user_profile/views.py index d3e0811..5be4157 100644 --- a/user_profile/views.py +++ b/user_profile/views.py @@ -198,7 +198,7 @@ def edit_profile(request): def rankings(request): contributors = UserProfile.objects.filter(role=UserProfile.STUDENT).order_by('-total_points') issues_resolved = [ - PullRequest.objects.filter(contributor=contributor.user, state=1).count() for contributor in contributors + PullRequest.objects.filter(contributor=contributor.user, state=1).count() for contributor in contributors ] contributors = zip(contributors, issues_resolved) context = { From eb5befe92cbf15ceffabb40a28d7cf519ec6a5ab Mon Sep 17 00:00:00 2001 From: VishalMinj Date: Thu, 24 Oct 2024 02:47:17 +0530 Subject: [PATCH 4/4] Update: card responsiveness fix --- user_profile/templates/user_profile/issue_card.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/user_profile/templates/user_profile/issue_card.html b/user_profile/templates/user_profile/issue_card.html index de390f2..0b3e4d8 100644 --- a/user_profile/templates/user_profile/issue_card.html +++ b/user_profile/templates/user_profile/issue_card.html @@ -1,4 +1,4 @@ -
+
Total Issues Solved:

@@ -9,16 +9,16 @@

Total Issues Solved:
-
+
Very-easy Issue.: {{ veasyProblems }}
-
+
Easy Issue: {{ easyProblems }}
-
+
Medium Issue: {{ mediumProblems }}
-
+
Hard Issue: {{ hardProblems }}