Skip to content

Commit

Permalink
Merge pull request #1823 from laws-africa/gazette-listing
Browse files Browse the repository at this point in the history
Recent gazettes in homepage
  • Loading branch information
actlikewill authored May 24, 2024
2 parents 43d475c + 3a78172 commit c6d000e
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 c6d000e

Please sign in to comment.