Skip to content
Snippets Groups Projects
Commit 3b798443 authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Sort determination block by updated_at decending so newest at top.

parent e71ead50
No related branches found
No related tags found
No related merge requests found
...@@ -28,12 +28,16 @@ from .options import ACCEPTED, DETERMINATION_CHOICES, REJECTED ...@@ -28,12 +28,16 @@ from .options import ACCEPTED, DETERMINATION_CHOICES, REJECTED
class DeterminationQuerySet(models.QuerySet): class DeterminationQuerySet(models.QuerySet):
def staff(self):
# Designed to be used with a queryset related to submissions
return self.all().order_by('-updated_at')
def active(self): def active(self):
# Designed to be used with a queryset related to submissions # Designed to be used with a queryset related to submissions
return self.get(is_draft=True) return self.get(is_draft=True).order_by('-updated_at')
def submitted(self): def submitted(self):
return self.filter(is_draft=False) return self.filter(is_draft=False).order_by('-updated_at')
def final(self): def final(self):
return self.submitted().filter(outcome__in=[ACCEPTED, REJECTED]) return self.submitted().filter(outcome__in=[ACCEPTED, REJECTED])
......
{% load humanize determination_tags %} {% load humanize determination_tags %}
<div class="sidebar__inner"> <div class="sidebar__inner">
<h5>Determinations</h5> <h5>Determinations</h5>
{% for determination in object.determinations.all %} {% for determination in object.determinations.staff %}
<p> <p>
<a class="link link--bold" href="{% url 'apply:submissions:determinations:detail' submission_pk=object.id pk=determination.id %}"> <a class="link link--bold" href="{% url 'apply:submissions:determinations:detail' submission_pk=object.id pk=determination.id %}">
{% if determination.is_draft %}[Draft] {% endif %}{{ determination.get_outcome_display }} {% if determination.is_draft %}[Draft] {% endif %}{{ determination.get_outcome_display }}
......
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