Skip to content

Commit

Permalink
display data for the inactive participants
Browse files Browse the repository at this point in the history
  • Loading branch information
superryeti committed Mar 8, 2023
1 parent 7500f33 commit dc503a0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
30 changes: 28 additions & 2 deletions physionet-django/events/templates/events/event_entries.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% load participation_status %}
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<button class="nav-link active" id="active-participant-tab" data-toggle="tab" data-target="#active-participant" type="button" role="tab" aria-controls="active-participant" aria-selected="true">Active Participant</button>
<button class="nav-link" id="inactive-participant-tab" data-toggle="tab" data-target="#inactive-participant" type="button" role="tab" aria-controls="inactive-participant" aria-selected="false">InActive Participant</button>
<button class="nav-link" id="inactive-participant-tab" data-toggle="tab" data-target="#inactive-participant" type="button" role="tab" aria-controls="inactive-participant" aria-selected="false">Inactive Participant</button>
</div>
</nav>
<div class="tab-content" id="nav-tabContent">
Expand Down Expand Up @@ -37,5 +38,30 @@
</table>
</div>
</div>
<div class="tab-pane fade" id="inactive-participant" role="tabpanel" aria-labelledby="inactive-participant-tab"></div>
<div class="tab-pane fade" id="inactive-participant" role="tabpanel" aria-labelledby="inactive-participant-tab">
<table class="table table-bordered">
<thead>
<tr>
<th>Username</th>
<th>Full name</th>
<th>Email</th>
<th>Reason</th>
<th>Date</th>
</tr>
</thead>
<tbody>
{% with inactive_applications=event|get_inactive_applications %}
{% for application in inactive_applications %}
<tr>
<td>{{ application.user.username }}</td>
<td>{{ application.user.get_full_name }}</td>
<td>{{ application.user.email }}</td>
<td>{{ application.comment_to_applicant }}</td>
<td>{{ application.decision_datetime | date }}</td>
</tr>
{% endfor %}
{% endwith %}
</tbody>
</table>
</div>
</div>
10 changes: 10 additions & 0 deletions physionet-django/events/templatetags/participation_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ def is_on_waiting_list(user, event):
@register.filter(name='has_access_to_event_dataset')
def has_access_to_event_dataset(user, dataset):
return dataset.has_access(user)


@register.filter(name='get_inactive_applications')
def get_inactive_applications(event):
return event.applications.filter(
status__in=[
EventApplication.EventApplicationStatus.NOT_APPROVED,
EventApplication.EventApplicationStatus.WITHDRAWN
]
)

0 comments on commit dc503a0

Please sign in to comment.