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

Paginated legislation listing #1901

Merged
merged 50 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e800fc0
adds paginated legislation listing
actlikewill Jul 9, 2024
754a0b4
adds children dropdown
actlikewill Jul 12, 2024
dadf2d8
changes liiweb legislation template
actlikewill Jul 12, 2024
2a07642
uses htmx for facets
actlikewill Jul 12, 2024
2ade5bc
bring legislation features into base _document_table
longhotsummer Jul 15, 2024
8ecb05a
caret and collapse for children
longhotsummer Jul 15, 2024
05520ad
grouping
longhotsummer Jul 15, 2024
6ef34ca
Merge pull request #1904 from laws-africa/doc-table
actlikewill Jul 15, 2024
5bacb67
common grouping mechanism for courts
longhotsummer Jul 15, 2024
df6219b
fix latest_expression_only for legislation view
longhotsummer Jul 15, 2024
8440f35
htmx included in app.ts
longhotsummer Jul 15, 2024
1816f3d
Merge pull request #1905 from laws-africa/grouping
longhotsummer Jul 15, 2024
6c6cbb2
sorting for document filter table
longhotsummer Jul 15, 2024
2dc98f2
doc-table sorting
longhotsummer Jul 15, 2024
1bf4be9
sort is possible with alphabet filter
longhotsummer Jul 15, 2024
77c1872
adds facet values
actlikewill Jul 15, 2024
c5a42e5
Merge branch 'listing' into sort
longhotsummer Jul 15, 2024
0751fbd
sorting
longhotsummer Jul 15, 2024
10e9e4e
fix tests
longhotsummer Jul 16, 2024
749fbba
Merge pull request #1906 from laws-africa/sort
longhotsummer Jul 16, 2024
b5b36e2
adds _document_table_form; updates court facets
actlikewill Jul 16, 2024
d54de55
fix filtering; don't duplicate form; progress bar
longhotsummer Jul 16, 2024
a9a96c3
unify document listing layouts; search beside doc count
longhotsummer Jul 16, 2024
765405c
intcomma for doc counts
longhotsummer Jul 16, 2024
c278969
default sorting
longhotsummer Jul 16, 2024
8c4a8d5
fix sorting bug
longhotsummer Jul 16, 2024
0cb5a7a
Merge pull request #1907 from laws-africa/tweaks
longhotsummer Jul 16, 2024
dbe13b6
make help_link easier to set
longhotsummer Jul 16, 2024
acfaa66
adds facet clear
actlikewill Jul 16, 2024
c3fdd81
set default sort
longhotsummer Jul 16, 2024
ac648da
spacing on mobile
longhotsummer Jul 16, 2024
a9c4c14
make offcanvas filters work
longhotsummer Jul 16, 2024
f8f4881
move filters back and forth
longhotsummer Jul 16, 2024
6790de6
adds support for taxonomies
actlikewill Jul 16, 2024
3f6b421
Merge pull request #1908 from laws-africa/offcanvas
longhotsummer Jul 16, 2024
114c767
fixes heading template
actlikewill Jul 16, 2024
eafdb8b
adds distinct for judges and attorneys filters
actlikewill Jul 16, 2024
f487acb
lawlibrary legislation notice
longhotsummer Jul 16, 2024
5120661
prefetch labels
longhotsummer Jul 16, 2024
162445d
simplify prefetch for legislation
longhotsummer Jul 16, 2024
d055402
uses get_queryset method to calculate facets
actlikewill Jul 16, 2024
6917286
adds get variant queryset
actlikewill Jul 16, 2024
a07a22a
adds repealed legislation warning
actlikewill Jul 17, 2024
97cd21e
prefetch labels
longhotsummer Jul 17, 2024
19eabff
fix ES-based listing views
longhotsummer Jul 17, 2024
81dd89d
extracted strings for translation
longhotsummer Jul 17, 2024
ccd6c7b
adds doc index facets; clear all button
actlikewill Jul 17, 2024
3a6b266
hide filter controls in pocketlaw
longhotsummer Jul 17, 2024
5463a38
guard against htmx race conditions
longhotsummer Jul 18, 2024
1b11d49
translation
longhotsummer Jul 18, 2024
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
2 changes: 1 addition & 1 deletion africanlii/templates/africanlii/au_detail_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% block breadcrumbs %}{% endblock %}
{% block page-heading %}
<h1 class="my-4">{% trans 'African Union (AU)' %}</h1>
{% include "peachjam/_help_button.html" with link="african-union-documents-au" %}
{% include "peachjam/_help_button.html" with help_link="african-union-documents-au" %}
{% endblock %}
<p>
{% blocktrans trimmed %}
Expand Down
10 changes: 3 additions & 7 deletions africanlii/templates/africanlii/au_institution_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@
{% endif %}
{% endwith %}
{% endblock %}
{% block page-title %}<h1 class="mt-4">{{ obj }}</h1>{% endblock %}
{% block page-header %}
<h1 class="mt-4">{{ obj }}</h1>
{% include 'peachjam/_document_count.html' %}
{{ block.super }}
{% include 'peachjam/_years_list.html' with showallyears=True %}
{% endblock %}
{% block content %}
{% if documents %}
{% include 'peachjam/_document_table.html' %}
{% else %}
<p>{% trans 'No documents found.' %}</p>
{% endif %}
{% include 'peachjam/_document_table.html' %}
{% endblock %}
15 changes: 1 addition & 14 deletions africanlii/templates/africanlii/au_organ_detail.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'peachjam/layouts/document_list.html' %}
{% extends 'africanlii/au_institution_detail.html' %}
{% load i18n %}
{% block title %}{{ author }}{% endblock %}
{% block breadcrumbs %}
<div class="container">
<nav aria-label="breadcrumb">
Expand All @@ -25,15 +24,3 @@
{% endif %}
{% endwith %}
{% endblock %}
{% block page-header %}
<h1 class="mt-4">{{ obj }}</h1>
{% include 'peachjam/_document_count.html' %}
{% include 'peachjam/_years_list.html' with showallyears=True %}
{% endblock %}
{% block content %}
{% if documents %}
{% include 'peachjam/_document_table.html' %}
{% else %}
<p>{% trans 'No documents found.' %}</p>
{% endif %}
{% endblock %}
8 changes: 4 additions & 4 deletions africanlii/templates/africanlii/member_state_detail.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'peachjam/layouts/document_list.html' %}
{% extends 'africanlii/au_institution_detail.html' %}
{% load i18n %}
{% block title %}{{ member_state }}{% endblock %}
{% block breadcrumbs %}
Expand All @@ -25,10 +25,10 @@
{% endif %}
{% endwith %}
{% endblock %}
{% block page-title %}<h1 class="mt-4">{{ member_state }}</h1>{% endblock %}
{% block page-header %}
<h1 class="mt-4">{{ member_state }}</h1>
{% include 'africanlii/_lii_info.html' %}
{% include 'peachjam/_document_count.html' %}
{{ block.super }}
<div class="mb-3">{% include 'africanlii/_lii_info.html' %}</div>
{% endblock %}
{% block page-list-facets %}{% endblock %}
{% block content %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'peachjam/layouts/document_list.html' %}
{% extends 'africanlii/au_institution_detail.html' %}
{% load i18n %}
{% block title %}{{ rec }}{% endblock %}
{% block breadcrumbs %}
Expand All @@ -25,16 +25,8 @@
{% endif %}
{% endwith %}
{% endblock %}
{% block page-title %}<h1 class="mt-4">{{ rec }}</h1>{% endblock %}
{% block page-header %}
<h1 class="mt-4">{{ rec }}</h1>
{% include 'peachjam/_document_count.html' %}
{{ block.super }}
{% include 'peachjam/_years_list.html' with showallyears=True %}
{% endblock %}
{% block content %}
{% if documents %}
{% include 'peachjam/_judgment_table.html' %}
{% include 'peachjam/_pagination.html' %}
{% else %}
<p>{% trans 'No documents found.' %}</p>
{% endif %}
{% endblock %}
1 change: 0 additions & 1 deletion africanlii/templates/peachjam/reports_guides_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
{% endblock %}
{% block page-title %}
<h1 class="mt-4">{% trans 'Reports and Guides' %}</h1>
{% include 'peachjam/_document_count.html' %}
{% endblock %}
1 change: 1 addition & 0 deletions africanlii/views/au.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class RegionalEconomicCommunityDetailView(PlaceDetailView):

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["doc_table_show_jurisdiction"] = False
context["rec"] = get_object_or_404(
RegionalEconomicCommunity, locality=self.locality
)
Expand Down
4 changes: 2 additions & 2 deletions lawlibrary/templates/liiweb/legislation_list.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% extends "liiweb/legislation_list.html" %}
{% load i18n %}
{% block page-heading %}
{% block page-title %}
<h1 class="my-4">{% trans 'National Legislation' %}</h1>
{% endblock %}
{% block legislation-nav %}
{% block nav-tabs %}
{% include 'lawlibrary/_legislation_alert.html' %}
{{ block.super }}
{% endblock %}
4 changes: 2 additions & 2 deletions lawlibrary/views/legislation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@


class LegislationListView(BaseLegislationListView):
def get_queryset(self):
return super().get_queryset().filter(locality=None)
def get_base_queryset(self):
return super().get_base_queryset().filter(locality=None)


class LocalityLegislationView(BaseLocalityLegislationView):
Expand Down
2 changes: 1 addition & 1 deletion liiweb/templates/liiweb/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</form>
<div class="d-flex">
<a class="me-4" href="{% url 'search:search' %}?show-advanced-tab=1">{% trans 'Advanced search' %}</a>
{% include "peachjam/_help_button.html" with link="search" %}
{% include "peachjam/_help_button.html" with help_link="search" %}
</div>
</div>
</div>
Expand Down
143 changes: 51 additions & 92 deletions liiweb/templates/liiweb/legislation_list.html
Original file line number Diff line number Diff line change
@@ -1,97 +1,56 @@
{% extends "peachjam/layouts/main.html" %}
{% extends 'peachjam/layouts/document_list.html' %}
{% load i18n %}
{% block title %}
{% trans 'Legislation' %}
{% endblock %}
{% block page-content %}
{% block breadcrumbs %}{% endblock %}
{% block entity-profile %}
{% if entity_profile %}
<div class="mt-3">{% include 'peachjam/_entity_profile.html' %}</div>
{% endif %}
{% endblock %}
<section class="pb-5">
<div class="container">
{% block page-heading %}
<h1 class="my-4">{% trans 'Legislation' %}</h1>
{% include "peachjam/_help_button.html" with link="legislation/" %}
{% endblock %}
longhotsummer marked this conversation as resolved.
Show resolved Hide resolved
{% block legislation-nav %}
<nav class="nav nav-tabs scroll-xs mb-3 border-bottom">
<li class="nav-item">
<a class="nav-link {% if view.variant == 'current' %}active{% endif %}"
href="{% url 'legislation_list' %}">
{% block current_tab_title %}
{% trans 'Current legislation' %}
{% endblock %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if view.variant == 'recent' %}active{% endif %}"
href="{% url 'legislation_list_recent' %}">
{% block recent_tab_title %}
{% trans 'Recent legislation' %}
{% endblock %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if view.variant == 'subleg' %}active{% endif %}"
href="{% url 'legislation_list_subsidiary' %}">
{% block sublegislation_tab_title %}{{ PEACHJAM_SETTINGS.subleg_label }}{% endblock %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if view.variant == 'uncommenced' %}active{% endif %}"
href="{% url 'legislation_list_uncommenced' %}">
{% block uncommenced_tab_title %}
{% trans 'Uncommenced legislation' %}
{% endblock %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if view.variant == 'repealed' %}active{% endif %}"
href="{% url 'legislation_list_repealed' %}">
{% block repealed_tab_title %}
{% trans 'Repealed legislation' %}
{% endblock %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if view.variant == 'all' %}active{% endif %}"
href="{% url 'legislation_list_all' %}">
{% trans 'All legislation' %}
</a>
</li>
</nav>
{% endblock %}
{% if view.variant == 'repealed' %}
<div class="alert alert-danger">{% trans 'You are viewing repealed legislation which is no longer in force.' %}</div>
{% endif %}
longhotsummer marked this conversation as resolved.
Show resolved Hide resolved
<div data-vue-component="LegislationTable"
data-initial-sort="{{ legislation_list_sort }}"
{% if not doc_table_citations %}data-hide-citations="true"{% endif %}>
{% comment %}
This ensures that peachjam has links to scrape. This content is replaced when the javacript LegislationTable
component runs.
{% endcomment %}
<ul>
{% for item in legislation_table %}
<li>
<a href="{{ item.work_frbr_uri }}">{{ item.title }}</a>
{% if item.children %}
<ul>
{% for kid in item.children %}
<li>
<a href="{{ kid.work_frbr_uri }}">{{ kid.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
{{ legislation_table|json_script:"legislation-table" }}
</div>
</section>
{% block page-title %}
<h1 class="my-4">{% trans 'Legislation' %}</h1>
{% endblock %}
{% block nav-tabs %}
<nav class="nav nav-tabs scroll-xs mb-3 border-bottom">
<li class="nav-item">
<a class="nav-link {% if view.variant == 'current' %}active{% endif %}"
href="{% url 'legislation_list' %}">
{% block current_tab_title %}
{% trans 'Current legislation' %}
{% endblock %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if view.variant == 'recent' %}active{% endif %}"
href="{% url 'legislation_list_recent' %}">
{% block recent_tab_title %}
{% trans 'Recent legislation' %}
{% endblock %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if view.variant == 'subleg' %}active{% endif %}"
href="{% url 'legislation_list_subsidiary' %}">
{% block sublegislation_tab_title %}{{ PEACHJAM_SETTINGS.subleg_label }}{% endblock %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if view.variant == 'uncommenced' %}active{% endif %}"
href="{% url 'legislation_list_uncommenced' %}">
{% block uncommenced_tab_title %}
{% trans 'Uncommenced legislation' %}
{% endblock %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if view.variant == 'repealed' %}active{% endif %}"
href="{% url 'legislation_list_repealed' %}">
{% block repealed_tab_title %}
{% trans 'Repealed legislation' %}
{% endblock %}
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if view.variant == 'all' %}active{% endif %}"
href="{% url 'legislation_list_all' %}">
{% trans 'All legislation' %}
</a>
</li>
</nav>
{% endblock %}
2 changes: 1 addition & 1 deletion liiweb/templates/liiweb/pocketlaw.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2 class="display-5">Your offline {{ APP_NAME }} companion.</h2>
<div class="row">
<div class="col-md-6 mb-3">
<h3>Get started with Pocket Law</h3>
{% include "peachjam/_help_button.html" with link="pocket-law" %}
{% include "peachjam/_help_button.html" with help_link="pocket-law" %}
<ol class="lead">
<li>Download Pocket Law {{ APP_NAME }}.</li>
<li>Double-click the application to start the installation.</li>
Expand Down
Loading
Loading