-
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 #1833 from laws-africa/case-history
Case histories
- Loading branch information
Showing
8 changed files
with
229 additions
and
2 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
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,88 @@ | ||
# Generated by Django 3.2.21 on 2024-05-30 13:13 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("peachjam", "0135_backfill_citation_counts3"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="CaseHistory", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"case_number", | ||
models.CharField( | ||
blank=True, | ||
max_length=1024, | ||
null=True, | ||
verbose_name="case number", | ||
), | ||
), | ||
("date", models.DateField(blank=True, null=True, verbose_name="date")), | ||
( | ||
"court", | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="peachjam.court", | ||
verbose_name="court", | ||
), | ||
), | ||
( | ||
"historical_judgment", | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="peachjam.judgment", | ||
verbose_name="historical judgment", | ||
), | ||
), | ||
( | ||
"judges", | ||
models.ManyToManyField( | ||
blank=True, to="peachjam.Judge", verbose_name="judges" | ||
), | ||
), | ||
( | ||
"judgment", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="case_histories", | ||
to="peachjam.judgment", | ||
verbose_name="judgment", | ||
), | ||
), | ||
( | ||
"outcome", | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="peachjam.outcome", | ||
verbose_name="outcome", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "case history", | ||
"verbose_name_plural": "case histories", | ||
"ordering": ["date"], | ||
}, | ||
), | ||
] |
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,35 @@ | ||
{% load i18n %} | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>{% trans 'Date' %}</th> | ||
<th>{% trans 'Case' %}</th> | ||
<th>{% trans 'Court' %}</th> | ||
<th>{% trans 'Judges' %}</th> | ||
<th>{% trans 'Outcome' %}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for history in case_histories %} | ||
<tr> | ||
<td>{{ history.date }}</td> | ||
<td> | ||
{% if history.historical_judgment %} | ||
<a target="_blank" | ||
href="{{ history.historical_judgment.expression_frbr_uri }}">{{ history.historical_judgment }}</a> | ||
{% else %} | ||
{{ history.case_number }} | ||
{% endif %} | ||
</td> | ||
<td>{{ history.court }}</td> | ||
<td> | ||
{% for judge in history.judges.all %} | ||
{{ judge }} | ||
{% if not forloop.last %},{% endif %} | ||
{% endfor %} | ||
</td> | ||
<td>{{ history.outcome }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
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
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