Skip to content

Commit

Permalink
user_profile: profile: Add tab to see expired active assignments
Browse files Browse the repository at this point in the history
Signed-off-by: Shashank Verma <[email protected]>
  • Loading branch information
shank03 committed Oct 12, 2023
1 parent 05fabf6 commit a75ca14
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 44 additions & 1 deletion user_profile/templates/user_profile/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ <h6 class="">
</li>
<li class="nav-item" role="presentation">
<a
style="border-bottom-right-radius:7px;border-top-right-radius:7px;"
class="nav-link"
id="ex1-tab-3"
data-mdb-toggle="tab"
Expand All @@ -251,6 +250,12 @@ <h6 class="">
<div class="text-center"><b>All Issues Under Me</b></div></a
>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="ex1-tab-4" data-mdb-toggle="tab" href="#ex1-tabs-4" role="tab" aria-controls="ex1-tabs-4"
aria-selected="false" style="border-bottom-right-radius:7px;border-top-right-radius:7px;">
<div class="text-center"><b>Active Assigned Issues</b></div>
</a>
</li>
</ul>
</div>
<div class="tab-content" id="ex1-content">
Expand Down Expand Up @@ -413,7 +418,45 @@ <h6 class="">
{% endfor %}
</div>
</div>
<div class="container-flow p-3 tab-pane fade" id="ex1-tabs-4" role="tabpanel" aria-labelledby="ex1-tab-4">
<div class="row row-cols-1 row-cols-md-2">
{% for active_issue in active_mentored_issues %}
<div class="col">
<div class="card m-3 text-center" style="border-radius: 15px;">
<div class="card-header">
Issue #{{ active_issue.issue.number }}
</div>
<div class="card-body">

<h5 class="card-title">
<a href="{{ active_issue.issue.html_url }}">{{ active_issue.issue.title }}</a>
</h5>
<h6 class="">
<a data-mdb-toggle="tooltip" title="Project" href="{{ active_issue.issue.project.html_url }}">{{ active_issue.issue.project.name }}</a>
</h6>

<p class="card-text">
<a class="btn btn-rounded btn-info" data-mdb-toggle="tooltip" title="Mentor">
@{{ active_issue.issue.mentor }}
</a>
<a class="btn btn-rounded btn-info">{{ active_issue.issue.get_level_display }}</a>
<a class="btn btn-rounded btn-info" data-mdb-toggle="tooltip" title="Points">{{ active_issue.issue.points }}</a>
{% if active_issue.issue.is_restricted %}
<a class="btn btn-rounded btn-warning" data-mdb-toggle="tooltip" title="Restricted">
<i class="fas fa-exclamation-triangle"></i>
</a>
{% endif %}
</p>
{# 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
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>

{% endif %}
{% endif %}
Expand Down
2 changes: 2 additions & 0 deletions user_profile/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a75ca14

Please sign in to comment.