-
Notifications
You must be signed in to change notification settings - Fork 0
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
Court class detail views #1803
Merged
Merged
Court class detail views #1803
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f675b93
refactors court views; adds court class detail view
actlikewill 5a22f26
fixes court view mixins
actlikewill 512482f
use flow-columns for registry list as well as courts
longhotsummer c669442
changes all judgments button position
actlikewill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend we make this a simple link below the h4 heading, with
class="mb-3"
and text "All judgments"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea. this is how it looks now