Skip to content
Snippets Groups Projects
Commit 3df21dfb authored by sks444's avatar sks444
Browse files

Fix screening sorting on submission table

parent 9cba7235
No related branches found
No related tags found
No related merge requests found
...@@ -131,7 +131,7 @@ class LabeledCheckboxColumn(tables.CheckBoxColumn): ...@@ -131,7 +131,7 @@ class LabeledCheckboxColumn(tables.CheckBoxColumn):
class BaseAdminSubmissionsTable(SubmissionsTable): class BaseAdminSubmissionsTable(SubmissionsTable):
lead = tables.Column(order_by=('lead.full_name',)) lead = tables.Column(order_by=('lead.full_name',))
reviews_stats = tables.TemplateColumn(template_name='funds/tables/column_reviews.html', verbose_name=mark_safe("Reviews<div>Assgn.\tComp.</div>"), orderable=False) reviews_stats = tables.TemplateColumn(template_name='funds/tables/column_reviews.html', verbose_name=mark_safe("Reviews<div>Assgn.\tComp.</div>"), orderable=False)
screening_status = tables.Column(verbose_name="Screening", accessor='joined_screening_statuses') screening_status = tables.Column(verbose_name="Screening", accessor='screening_statuses')
class Meta(SubmissionsTable.Meta): class Meta(SubmissionsTable.Meta):
fields = ('title', 'phase', 'stage', 'fund', 'round', 'lead', 'submit_time', 'last_update', 'screening_status', 'reviews_stats') # type: ignore fields = ('title', 'phase', 'stage', 'fund', 'round', 'lead', 'submit_time', 'last_update', 'screening_status', 'reviews_stats') # type: ignore
...@@ -140,6 +140,14 @@ class BaseAdminSubmissionsTable(SubmissionsTable): ...@@ -140,6 +140,14 @@ class BaseAdminSubmissionsTable(SubmissionsTable):
def render_lead(self, value): def render_lead(self, value):
return format_html('<span>{}</span>', value) return format_html('<span>{}</span>', value)
def render_screening_status(self, value):
try:
status = value.get(default=True).title
except ScreeningStatus.DoesNotExist:
return format_html('<span>{}</span>', 'Awaiting')
else:
return format_html('<span>{}</span>', status)
class AdminSubmissionsTable(BaseAdminSubmissionsTable): class AdminSubmissionsTable(BaseAdminSubmissionsTable):
"""Adds admin only columns to the submissions table""" """Adds admin only columns to the submissions table"""
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<tr class="submission-meta__row"> <tr class="submission-meta__row">
<th><h6 class="heading heading--normal heading--no-margin">Applicant</h6></th> <th><h6 class="heading heading--normal heading--no-margin">Applicant</h6></th>
<th><h6 class="heading heading--normal heading--no-margin">Last updated</h6></th> <th><h6 class="heading heading--normal heading--no-margin">Last updated</h6></th>
<th><h6 class="heading heading--normal heading--no-margin">Screening status</h6></th> <th><h6 class="heading heading--normal heading--no-margin">Screening statuses</h6></th>
<th><h6 class="heading heading--normal heading--no-margin">Review outcomes</h6></th> <th><h6 class="heading heading--normal heading--no-margin">Review outcomes</h6></th>
</tr> </tr>
<tr class="submission-meta__row submission-meta__row--black"> <tr class="submission-meta__row submission-meta__row--black">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
{% endif %} {% endif %}
</td> </td>
<td> <td>
<strong>{% if object.screening_statuses.exists %}{{ object.screening_statuses|default:"Awaiting Screen status" }}{% endif %}</strong> <strong>{{ submission.joined_screening_statuses|default:"Awaiting" }}</strong>
</td> </td>
<td> <td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment