-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1803 from laws-africa/courtclass-detail
Court class detail views
- Loading branch information
Showing
20 changed files
with
430 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 3.2.24 on 2024-04-23 08:26 | ||
|
||
from django.db import migrations, models | ||
from django.utils.text import slugify | ||
|
||
|
||
def create_slug(apps, schema_editor): | ||
CourtClass = apps.get_model("peachjam", "CourtClass") | ||
for court_class in CourtClass.objects.all(): | ||
court_class.slug = slugify(court_class.name) | ||
court_class.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("peachjam", "0125_judgment_auto_assign_title"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="courtclass", | ||
name="slug", | ||
field=models.SlugField(default="", max_length=255, verbose_name="slug"), | ||
preserve_default=False, | ||
), | ||
migrations.RunPython(create_slug, migrations.RunPython.noop), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.24 on 2024-04-23 08:34 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("peachjam", "0126_courtclass_slug"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="courtclass", | ||
name="slug", | ||
field=models.SlugField(max_length=255, unique=True, verbose_name="slug"), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.24 on 2024-04-23 08:54 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("peachjam", "0127_alter_courtclass_slug"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="courtclass", | ||
name="show_listing_page", | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% extends "peachjam/_court_months_list.html" %} | ||
{% load i18n %} | ||
{% block month_link %} | ||
<a href="{% url "court_class_month" court_class.slug year m|date:'n' %}">{{ m|date:"F" }}</a> | ||
{% endblock %} | ||
{% block month_option %} | ||
<option value="{% url "court_class_month" court_class.slug year m|date:'n' %}" | ||
{% if m|date:"F" == month %} selected{% endif %}> | ||
{{ m|date:"F" }} | ||
</option> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% extends "peachjam/_court_years_list.html" %} | ||
{% load i18n %} | ||
{% block year_link %} | ||
<a href="{% url "court_class_year" court_class.slug y.year %}">{{ y.year }}</a> | ||
{% endblock %} | ||
{% block year_option %} | ||
<option value="{% url "court_class_year" court_class.slug y.year %}" | ||
{% if y.year == year %} selected{% endif %}> | ||
{{ y.year }} | ||
</option> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% load i18n %} | ||
{% if months and years %} | ||
<div id="monthFilter" | ||
class="pl-0 mt-2 mb-3 align-items-center d-none d-lg-flex"> | ||
<i class="bi bi-calendar me-2"></i> | ||
<div> | ||
<a class="{% if not month %} active{% endif %}" | ||
href="{{ all_months_url }}">{% trans 'All months' %}</a> | ||
</div> | ||
<ul class="year-nav mb-0 ms-2"> | ||
{% for m in months %} | ||
<li> | ||
{% if m|date:"F" == month %} | ||
{{ m|date:"F" }} | ||
{% else %} | ||
{% block month_link %} | ||
<a href="{% url "court_month" court.code year m|date:'n' %}">{{ m|date:"F" }}</a> | ||
{% endblock %} | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
<select class="form-select mb-3 d-block d-lg-none" | ||
data-component="NavigationSelect"> | ||
<option value="{{ all_months_url }}"> | ||
{% trans 'All months' %} | ||
</option> | ||
{% for m in months %} | ||
{% block month_option %} | ||
<option value="{% url "court_month" court.code year m|date:'n' %}" | ||
{% if m|date:"F" == month %} selected{% endif %}> | ||
{{ m|date:"F" }} | ||
</option> | ||
{% endblock %} | ||
{% endfor %} | ||
</select> | ||
{% endif %} |
11 changes: 11 additions & 0 deletions
11
peachjam/templates/peachjam/_court_registries_months_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% extends "peachjam/_court_months_list.html" %} | ||
{% load i18n %} | ||
{% block month_link %} | ||
<a href="{% url "court_registry_month" court.code registry.code year m|date:'n' %}">{{ m|date:"F" }}</a> | ||
{% endblock %} | ||
{% block month_option %} | ||
<option value="{% url "court_registry_month" court.code registry.code year m|date:'n' %}" | ||
{% if m|date:"F" == month %} selected{% endif %}> | ||
{{ m|date:"F" }} | ||
</option> | ||
{% endblock %} |
11 changes: 11 additions & 0 deletions
11
peachjam/templates/peachjam/_court_registries_years_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% extends "peachjam/_court_years_list.html" %} | ||
{% load i18n %} | ||
{% block year_link %} | ||
<a href="{% url "court_registry_year" court.code registry.code y.year %}">{{ y.year }}</a> | ||
{% endblock %} | ||
{% block year_option %} | ||
<option value="{% url "court_registry_year" court.code registry.code y.year %}" | ||
{% if y.year == year %} selected{% endif %}> | ||
{{ y.year }} | ||
</option> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{% load i18n %} | ||
{% if years %} | ||
<div class="pl-0 mt-2 mb-3 align-items-center d-none d-lg-flex"> | ||
<i class="bi bi-calendar me-2"></i> | ||
<div> | ||
<a class="{% if not year %} active{% endif %}" | ||
href="{{ all_years_url }}">{% trans 'All years' %}</a> | ||
</div> | ||
<ul class="year-nav mb-0 ms-2"> | ||
{% for y in years %} | ||
<li> | ||
{% if y.year == year %} | ||
{{ y.year }} | ||
{% else %} | ||
{% block year_link %} | ||
<a href="{% url "court_year" court.code y.year %}">{{ y.year }}</a> | ||
{% endblock %} | ||
{% endif %} | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
<select class="form-select mb-3 d-block d-lg-none" | ||
data-component="NavigationSelect"> | ||
<option value="{{ all_years_url }}"> | ||
{% trans 'All years' %} | ||
</option> | ||
{% for y in years %} | ||
{% block year_option %} | ||
<option value="{% url "court_year" court.code y.year %}" | ||
{% if y.year == year %} selected{% endif %}> | ||
{{ y.year }} | ||
</option> | ||
{% endblock %} | ||
{% endfor %} | ||
</select> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% extends 'peachjam/court_detail.html' %} | ||
{% load i18n %} | ||
{% block year_list %} | ||
{% include "peachjam/_court_class_years_list.html" %} | ||
{% endblock %} | ||
{% block month_list %} | ||
{% include "peachjam/_court_class_month_list.html" %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,8 @@ | ||
{% extends 'peachjam/court_detail.html' %} | ||
{% load i18n %} | ||
{% block title %}{{ formatted_court_name }}{% endblock %} | ||
{% block breadcrumbs %} | ||
<div class="container"> | ||
<nav aria-label="breadcrumb"> | ||
<ol class="breadcrumb"> | ||
<li class="breadcrumb-item"> | ||
<a href="{% url 'judgment_list' %}">{% trans 'Judgments' %}</a> | ||
</li> | ||
<li class="breadcrumb-item"> | ||
<a href="{% url 'court' court.code %}">{{ court.name }}</a> | ||
</li> | ||
<li class="breadcrumb-item active">{{ registry.name }}</li> | ||
</ol> | ||
</nav> | ||
</div> | ||
{% block year_list %} | ||
{% include "peachjam/_court_registries_years_list.html" %} | ||
{% endblock %} | ||
{% block month_list %} | ||
{% include "peachjam/_court_registries_months_list.html" %} | ||
{% endblock %} |
Oops, something went wrong.