From f47ecc7cc5021d16eeab4ae3c5d9c38a962d9b72 Mon Sep 17 00:00:00 2001 From: VishalMinj Date: Sat, 19 Oct 2024 00:37:04 +0530 Subject: [PATCH 1/3] Feat: Added Card for level Wise issue solved --- .../templates/user_profile/issue_card.html | 34 +++++++++++++++++++ .../templates/user_profile/profile.html | 1 + user_profile/views.py | 11 +++++- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 user_profile/templates/user_profile/issue_card.html diff --git a/user_profile/templates/user_profile/issue_card.html b/user_profile/templates/user_profile/issue_card.html new file mode 100644 index 0000000..190a26e --- /dev/null +++ b/user_profile/templates/user_profile/issue_card.html @@ -0,0 +1,34 @@ +
+
+
Total Issues Solved:
+

+ {{ totalProblemsSolved }} +

+
+ +
diff --git a/user_profile/templates/user_profile/profile.html b/user_profile/templates/user_profile/profile.html index 6aab79a..f34ac9b 100644 --- a/user_profile/templates/user_profile/profile.html +++ b/user_profile/templates/user_profile/profile.html @@ -24,6 +24,7 @@ {% if user.is_authenticated %} {% include "user_profile/profile-card.html" %} + {% include "user_profile/issue_card.html" %} {% comment %} In Django templates you can use the "get_FOO_display()" method, that will return the readable alias diff --git a/user_profile/views.py b/user_profile/views.py index 4660fe0..7ba32ac 100644 --- a/user_profile/views.py +++ b/user_profile/views.py @@ -59,6 +59,11 @@ def profile(request, username): pr_requests_for_mentor = chain(pending_pr_requests_for_mentor, accepted_pr_requests_for_mentor, rejected_pr_requests_for_mentor) + easyProblems = PullRequest.objects.filter(contributor=user, issue__level=1, state=1).count() + mediumProblems = PullRequest.objects.filter(contributor=user, issue__level=2, state=1).count() + hardProblems = PullRequest.objects.filter(contributor=user, issue__level=3, state=1).count() + totalProblemsSolved = PullRequest.objects.filter(contributor=user, state=1).count() + pr_form = PRSubmissionForm() judge_form = PRJudgeForm() @@ -74,7 +79,11 @@ def profile(request, username): "assignment_requests_for_mentor": assignment_requests_for_mentor, 'pr_form': pr_form, "judge_form": judge_form, - "native_profile": native_profile + "native_profile": native_profile, + "easyProblems": easyProblems, + "mediumProblems": mediumProblems, + "hardProblems": hardProblems, + "totalProblemsSolved": totalProblemsSolved, } return render(request, 'user_profile/profile.html', context=context) else: From 8913145ff7f9a43e076e557ee97691c3f430ceff Mon Sep 17 00:00:00 2001 From: meisabhishekpatel Date: Sun, 20 Oct 2024 18:28:31 +0530 Subject: [PATCH 2/3] Revert "Merge pull request #178 from ShouryaMishra2006/main" This reverts commit 883e9285a1a12fadd30d532ad559afd93c639de7, reversing changes made to 464c12fdc8ece142fc35eba389232485379b1cf6. --- home/templates/home/index.html | 65 +++++----------------------------- 1 file changed, 8 insertions(+), 57 deletions(-) diff --git a/home/templates/home/index.html b/home/templates/home/index.html index eb5ae6a..f53be6d 100644 --- a/home/templates/home/index.html +++ b/home/templates/home/index.html @@ -66,36 +66,7 @@ background: #1C2331 !important; } } - - @@ -441,13 +412,8 @@
LDK

Past organizers

- -
-
+
+
Card Image @@ -504,14 +470,9 @@
Amit Kumar
-
+
- -
+
Card ImageLovedeep Singh Kamal
-
+
Card ImageDivyansh Upadhyay
- -
+
@@ -655,12 +611,7 @@
Ankit Sangwan
- -
+
Card Image - + \ No newline at end of file From d47262d55d658889e4f82a484aff10fe2ba714fd Mon Sep 17 00:00:00 2001 From: meisabhishekpatel Date: Sun, 20 Oct 2024 18:30:37 +0530 Subject: [PATCH 3/3] Revert "Merge pull request #179 from VishalMinj/main" This reverts commit 081b23808a5d0f963c9ac1f9d6dda11fe7ec0043, reversing changes made to 883e9285a1a12fadd30d532ad559afd93c639de7. --- .../templates/user_profile/issue_card.html | 34 ------------------- .../templates/user_profile/profile.html | 1 - user_profile/views.py | 11 +----- 3 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 user_profile/templates/user_profile/issue_card.html diff --git a/user_profile/templates/user_profile/issue_card.html b/user_profile/templates/user_profile/issue_card.html deleted file mode 100644 index 190a26e..0000000 --- a/user_profile/templates/user_profile/issue_card.html +++ /dev/null @@ -1,34 +0,0 @@ - diff --git a/user_profile/templates/user_profile/profile.html b/user_profile/templates/user_profile/profile.html index f34ac9b..6aab79a 100644 --- a/user_profile/templates/user_profile/profile.html +++ b/user_profile/templates/user_profile/profile.html @@ -24,7 +24,6 @@ {% if user.is_authenticated %} {% include "user_profile/profile-card.html" %} - {% include "user_profile/issue_card.html" %} {% comment %} In Django templates you can use the "get_FOO_display()" method, that will return the readable alias diff --git a/user_profile/views.py b/user_profile/views.py index 7ba32ac..4660fe0 100644 --- a/user_profile/views.py +++ b/user_profile/views.py @@ -59,11 +59,6 @@ def profile(request, username): pr_requests_for_mentor = chain(pending_pr_requests_for_mentor, accepted_pr_requests_for_mentor, rejected_pr_requests_for_mentor) - easyProblems = PullRequest.objects.filter(contributor=user, issue__level=1, state=1).count() - mediumProblems = PullRequest.objects.filter(contributor=user, issue__level=2, state=1).count() - hardProblems = PullRequest.objects.filter(contributor=user, issue__level=3, state=1).count() - totalProblemsSolved = PullRequest.objects.filter(contributor=user, state=1).count() - pr_form = PRSubmissionForm() judge_form = PRJudgeForm() @@ -79,11 +74,7 @@ def profile(request, username): "assignment_requests_for_mentor": assignment_requests_for_mentor, 'pr_form': pr_form, "judge_form": judge_form, - "native_profile": native_profile, - "easyProblems": easyProblems, - "mediumProblems": mediumProblems, - "hardProblems": hardProblems, - "totalProblemsSolved": totalProblemsSolved, + "native_profile": native_profile } return render(request, 'user_profile/profile.html', context=context) else: