diff --git a/peachjam/models/judgment.py b/peachjam/models/judgment.py index 1b400edec..14522f27c 100644 --- a/peachjam/models/judgment.py +++ b/peachjam/models/judgment.py @@ -519,7 +519,7 @@ class CaseHistory(models.Model): date = models.DateField(_("date"), null=True, blank=True) class Meta: - ordering = ["date"] + ordering = ["-date"] verbose_name = _("case history") verbose_name_plural = _("case histories") diff --git a/peachjam/templates/peachjam/_case_histories.html b/peachjam/templates/peachjam/_case_histories.html index a5e4cd8ae..bd2ffbf8c 100644 --- a/peachjam/templates/peachjam/_case_histories.html +++ b/peachjam/templates/peachjam/_case_histories.html @@ -2,16 +2,17 @@ + - - + - {% for history in document.case_histories.all %} + {% for history in case_histories %} + - + {% endfor %} diff --git a/peachjam/templates/peachjam/layouts/document_detail.html b/peachjam/templates/peachjam/layouts/document_detail.html index 3dc9359d9..99cad555d 100644 --- a/peachjam/templates/peachjam/layouts/document_detail.html +++ b/peachjam/templates/peachjam/layouts/document_detail.html @@ -114,7 +114,7 @@

{{ document.title }}

{% endif %} - {% if document.case_histories.all|length %} + {% if case_histories %}
{% trans 'Date' %} {% trans 'Case' %}{% trans 'Outcome' %} {% trans 'Court' %} {% trans 'Judges' %}{% trans 'Date' %}{% trans 'Outcome' %}
{{ history.date }} {% if history.historical_judgment %} - {{ history.outcome }} {{ history.court }} {% for judge in history.judges.all %} @@ -28,7 +28,7 @@ {% if not forloop.last %},{% endif %} {% endfor %} {{ history.date }}{{ history.outcome }}