diff --git a/liiweb/templates/liiweb/home.html b/liiweb/templates/liiweb/home.html index 5759725b6..698c29ead 100644 --- a/liiweb/templates/liiweb/home.html +++ b/liiweb/templates/liiweb/home.html @@ -94,6 +94,15 @@

{% trans 'Recent Legislation' %}

{% block lower-row-content %} + {% if recent_gazettes %} +
+ {% block recent-gazettes-title %} +

{% trans 'Recent Gazettes' %}

+ {% endblock %} + {% trans 'View more gazettes' as text %} + {% include 'peachjam/_recent_document_list.html' with documents=recent_gazettes view_more_text=text view_more_url_name='gazettes' %} +
+ {% endif %}

{% trans 'Courts' %}

{% include 'peachjam/_court_list.html' %} diff --git a/liiweb/views/general.py b/liiweb/views/general.py index eaaf89e1a..c16d963fa 100644 --- a/liiweb/views/general.py +++ b/liiweb/views/general.py @@ -1,6 +1,13 @@ from django.views.generic import TemplateView -from peachjam.models import Article, CourtClass, Judgment, Legislation, Taxonomy +from peachjam.models import ( + Article, + CourtClass, + Gazette, + Judgment, + Legislation, + Taxonomy, +) class HomePageView(TemplateView): @@ -16,6 +23,9 @@ def get_context_data(self, **kwargs): context["recent_legislation"] = Legislation.objects.exclude( published=False ).order_by("-date")[:10] + context["recent_gazettes"] = Gazette.objects.exclude(published=False).order_by( + "-date" + )[:5] context["taxonomies"] = Taxonomy.dump_bulk() context["taxonomy_url"] = "taxonomy_detail" context["recent_articles"] = (