Separation of status and score in order to be able to sort on score. Closes #22

This commit is contained in:
Mindiell 2023-04-23 18:52:52 +02:00 committed by Julien Palard
parent 11a5738731
commit 16534bf41f
3 changed files with 5 additions and 4 deletions

View File

@ -393,7 +393,7 @@ class Talk(PonyConfModel):
elif self.accepted is False:
return _('Refused')
else:
return _('Pending decision, score: %(score).1f') % {'score': self.score}
return _('Pending decision')
def get_status_color(self):
if self.accepted is True:

View File

@ -58,6 +58,7 @@
<th class="text-center">{% trans "Track" %}</th>
<th class="text-center">{% trans "Tags" %}</th>
<th class="text-center">{% trans "Status" %} <a href="?{{ sort_urls.status }}"><span class="glyphicon glyphicon-{{ sort_glyphicons.status }} pull-right"></span></a></th>
<th class="text-center">{% trans "Score" %} <a href="?{{ sort_urls.score }}"><span class="glyphicon glyphicon-{{ sort_glyphicons.score }} pull-right"></span></a></th>
</tr>
</thead>
<tfoot>
@ -84,9 +85,8 @@
</td>
<td>{{ talk.track|default:"" }}</td>
<td>{{ talk.get_tags_html }}</td>
<td>
{{ talk.get_status_str }}
</td>
<td>{{ talk.get_status_str }}</td>
<td>{{ talk.score }}</td>
</tr>
{% if forloop.last%}
</tbody>

View File

@ -730,6 +730,7 @@ def talk_list(request):
'title': 'title',
'category': 'category',
'status': 'accepted',
'score': 'score',
}
sort = request.GET.get('sort')
if sort in SORT_MAPPING.keys():