Skip to content

Commit

Permalink
adds recent gazettes to home page
Browse files Browse the repository at this point in the history
  • Loading branch information
actlikewill committed May 24, 2024
1 parent 43d475c commit 3a78172
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions liiweb/templates/liiweb/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ <h2 class="mb-4">{% trans 'Recent Legislation' %}</h2>
</div>
<div>
{% block lower-row-content %}
{% if recent_gazettes %}
<section class="pb-3 pt-3">
{% block recent-gazettes-title %}
<h2 class="mb-4">{% trans 'Recent Gazettes' %}</h2>
{% 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' %}
</section>
{% endif %}
<section class="pb-3 pt-3">
<h2 class="mb-4">{% trans 'Courts' %}</h2>
{% include 'peachjam/_court_list.html' %}
Expand Down
12 changes: 11 additions & 1 deletion liiweb/views/general.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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"] = (
Expand Down

0 comments on commit 3a78172

Please sign in to comment.