Skip to content

Commit

Permalink
FIND-153:series section updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TNA-Allan committed Feb 25, 2025
1 parent 9bdcc3a commit 7d344b9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
8 changes: 8 additions & 0 deletions app/records/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,3 +435,11 @@ def breadcrumb_items(self) -> list:
items = items[-3:]

return items

@cached_property
def hierarchy_series(self) -> Record | None:
"""Returns series record from hierarchy if found, None otherwise"""
for item in self.hierarchy:
if item.level == "Series":
return item
return None
35 changes: 19 additions & 16 deletions app/templates/records/macros/series_information.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{% macro series_information(record) %}
<div class="tna-container">
<div class="tna-column tna-column--full tna-!--margin-top-l">
<h2 class="tna-heading-l">Series information</h2>
<div class="tna-container tna-container--nested tna-!--margin-top-s">
<div class="tna-column">
<div class="tna-background-accent square">
<p class="tna-heading-m">???</p>

{% if record.hierarchy_series %}
<div class="tna-container">
<div class="tna-column tna-column--full tna-!--margin-top-l">
<h2 class="tna-heading-l">Series information</h2>
<div class="tna-container tna-container--nested tna-!--margin-top-s">
<div class="tna-column">
<div class="tna-background-accent square">
<p class="tna-heading-m">{{ record.hierarchy_series.reference_number }}</p>
</div>
</div>
<div class="tna-column tna-column--flex-1">
<h3 class="tna-heading-m">{{ record.hierarchy_series.summary_title }}</h3>
<p>See the series level description for more information about this record.</p>
<p>
<a href="{{ record.hierarchy_series.url }}">View series description</a>
</p>
</div>
</div>
</div>
<div class="tna-column tna-column--flex-1">
<h3 class="tna-heading-m">[SERIES TITLE]</h3>
<p>[SERIES DESCRIPTION]</p>
<p>
<a href="#">View series description</a>
</p>
</div>
</div>
</div>
</div>
{% endif %}
{% endmacro %}

0 comments on commit 7d344b9

Please sign in to comment.