From 93a3a5f77116ea55e61397ebc15b53c92b4af311 Mon Sep 17 00:00:00 2001 From: Shashank Verma Date: Thu, 12 Oct 2023 09:32:02 +0530 Subject: [PATCH] user_profile: profile: Add tab to see expired active assignments Signed-off-by: Shashank Verma --- .../templates/user_profile/profile.html | 45 ++++++++++++++++++- user_profile/views.py | 2 + 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/user_profile/templates/user_profile/profile.html b/user_profile/templates/user_profile/profile.html index d7255b4..55860ce 100644 --- a/user_profile/templates/user_profile/profile.html +++ b/user_profile/templates/user_profile/profile.html @@ -239,7 +239,6 @@
+
@@ -413,7 +418,45 @@
{% endfor %}
+
+
+ {% for active_issue in active_mentored_issues %} +
+
+
+ Issue #{{ active_issue.issue.number }} +
+
+ +
+ {{ active_issue.issue.title }} +
+
+ {{ active_issue.issue.project.name }} +
+ +

+ + @{{ active_issue.contributor }} + + {{ active_issue.issue.get_level_display }} + {{ active_issue.issue.points }} + {% if active_issue.issue.is_restricted %} + + + + {% endif %} +

+ {# TODO:ISSUE: Implement Live Timer which ticks (instead of steady timer which changes on refreshing #} + {# TODO:ISSUE: Turn Timer Color to Red when last 1 hour is remaining. #} + {{ active_issue.get_remaining_time | timeuntil }} remaining +
+
+
+ {% endfor %} +
+ {% endif %} {% endif %} diff --git a/user_profile/views.py b/user_profile/views.py index 5a305b5..4660fe0 100644 --- a/user_profile/views.py +++ b/user_profile/views.py @@ -41,6 +41,7 @@ def profile(request, username): active_issues = ActiveIssue.objects.filter(contributor=user) mentored_issues = Issue.objects.filter(mentor=user) + active_mentored_issues = ActiveIssue.objects.filter(issue__mentor=user) assignment_requests_for_mentor = IssueAssignmentRequest.objects.filter(issue__mentor=user) accepted_assignment_requests_for_mentor = assignment_requests_for_mentor.filter(state=1) @@ -68,6 +69,7 @@ def profile(request, username): "pr_requests_by_student": pr_requests_by_student, "pr_requests_for_mentor": pr_requests_for_mentor, "active_issues": active_issues, + "active_mentored_issues": active_mentored_issues, "assignment_requests_by_student": assignment_requests_by_student, "assignment_requests_for_mentor": assignment_requests_for_mentor, 'pr_form': pr_form,