Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent gazettes in homepage #1823

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading