Skip to content
Snippets Groups Projects
Unverified Commit 5b794dc1 authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #2176 from OpenTechFund/bug/screening-sorting

Fix screening sorting on submission table
parents 9cba7235 3df21dfb
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ class LabeledCheckboxColumn(tables.CheckBoxColumn):
class BaseAdminSubmissionsTable(SubmissionsTable):
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)
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):
fields = ('title', 'phase', 'stage', 'fund', 'round', 'lead', 'submit_time', 'last_update', 'screening_status', 'reviews_stats') # type: ignore
......@@ -140,6 +140,14 @@ class BaseAdminSubmissionsTable(SubmissionsTable):
def render_lead(self, 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):
"""Adds admin only columns to the submissions table"""
......
......@@ -20,7 +20,7 @@
<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">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>
</tr>
<tr class="submission-meta__row submission-meta__row--black">
......@@ -34,7 +34,7 @@
{% endif %}
</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>
......
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