From 0d9c323c3792c93f3818d9104e20f852751050fd Mon Sep 17 00:00:00 2001 From: csae8092 Date: Thu, 9 Nov 2023 15:11:53 +0100 Subject: [PATCH] added new fields to templates --- archiv/fixtures/dump.json | 6 +++--- archiv/forms.py | 15 +++++++++++++++ archiv/templates/archiv/court_detail.html | 6 ++++++ .../templates/archiv/courtdecission_detail.html | 5 +++++ archiv/templates/archiv/yearbook_detail.html | 17 ++++++++++++++++- 5 files changed, 45 insertions(+), 4 deletions(-) diff --git a/archiv/fixtures/dump.json b/archiv/fixtures/dump.json index 73f1301..2b5006d 100644 --- a/archiv/fixtures/dump.json +++ b/archiv/fixtures/dump.json @@ -14,9 +14,9 @@ }, { "model": "archiv.yearbook", - "pk": 663, + "pk": 642, "fields": { - "title": "A. Anfinsen & B. Askeland Norway in: H. Koziol/B.C. Steininger (eds.), European Tort Law 2009 (2010)", + "title": "A. Bitāns, Latvia in: H. Koziol/B.C. Steininger (eds.), European Tort Law 2008 (2009)", "doi": null, "part_of": null } @@ -158,7 +158,7 @@ "fields": { "title": "I.C. Durant, Belgium, in: H. Koziol/B.C. Steininger (eds.), European Tort Law 2005 (2006)", "doi": "https://doi.org/10.1515/tortlaw-2022-frontmatter1", - "part_of": 663 + "part_of": 642 } }, { diff --git a/archiv/forms.py b/archiv/forms.py index 05d0a1e..7eac15b 100644 --- a/archiv/forms.py +++ b/archiv/forms.py @@ -36,6 +36,9 @@ class YearBookForm(forms.ModelForm): class Meta: model = YearBook fields = "__all__" + widgets = { + "part_of": autocomplete.ModelSelect2(url="archiv-ac:yearbook-autocomplete") + } def __init__(self, *args, **kwargs): super(YearBookForm, self).__init__(*args, **kwargs) @@ -134,6 +137,18 @@ class Meta: ] widgets = { "tag": autocomplete.ModelSelect2Multiple(url="archiv-ac:tag-autocomplete"), + "related_decision": autocomplete.ModelSelect2Multiple( + url="archiv-ac:courtdecission-autocomplete" + ), + "author": autocomplete.ModelSelect2Multiple( + url="archiv-ac:person-autocomplete" + ), + "keyword": autocomplete.ModelSelect2Multiple( + url="archiv-ac:keyword-autocomplete" + ), + "year_book_title": autocomplete.ModelSelect2( + url="archiv-ac:yearbook-autocomplete" + ), } def __init__(self, *args, **kwargs): diff --git a/archiv/templates/archiv/court_detail.html b/archiv/templates/archiv/court_detail.html index 7e28052..f9d6433 100644 --- a/archiv/templates/archiv/court_detail.html +++ b/archiv/templates/archiv/court_detail.html @@ -56,12 +56,16 @@

Highcourt

{% endif %}

+

Court name (translated)

+

{{ object.name_english }}

+ {% if object.country %}

Country

{{ object.country }}

+ {% endif %}

Legal System

{{ object.partial_legal_system.name }} @@ -69,6 +73,8 @@

Legal System

+

Optional notes

+

{{ object.note }}

{% with courtdecissions=object.rvn_courtdecission_court_court %}

{{ courtdecissions.count }} issued Court Decissions

{% include "archiv/partials/courtdecission_table.html" %} diff --git a/archiv/templates/archiv/courtdecission_detail.html b/archiv/templates/archiv/courtdecission_detail.html index e200d83..5fff3f0 100644 --- a/archiv/templates/archiv/courtdecission_detail.html +++ b/archiv/templates/archiv/courtdecission_detail.html @@ -98,6 +98,11 @@

Reference Case Nr. {{ object.id }}

{{ x }}
{% endfor %} +
Related Cases
+ {% for x in object.related_decision.all %} +
{{ x }}
+ {% endfor %}

The Case

Brief Description

diff --git a/archiv/templates/archiv/yearbook_detail.html b/archiv/templates/archiv/yearbook_detail.html index 7bffa77..412ebcf 100644 --- a/archiv/templates/archiv/yearbook_detail.html +++ b/archiv/templates/archiv/yearbook_detail.html @@ -44,7 +44,22 @@

- + {% if object.part_of %} +
+

Parent Item

+ {{ object.part_of }} +
+ {% endif %} + + {% if object.has_bibliographic_items.all %} +

has bibliographic items

+
    + {% for x in object.has_bibliographic_items.all %} +
  • {{ x }}
  • + {% endfor %} +
+ {% endif %} + {% if object.doi %}

DOI