Skip to content

Commit

Permalink
fix: cleanup edit template a bit and move haupttext above relations
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Dec 18, 2023
1 parent 95d21f8 commit 6490811
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 5 additions & 1 deletion apis_ontology/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ class Person(LegacyStuffMixin, LegacyDateMixin, AbstractEntity):

@property
def oebl_kurzinfo(self):
return self.texts.get(kind="ÖBL Kurzinfo").text
return self.texts.get(kind="ÖBL Kurzinfo")

@property
def oebl_haupttext(self):
return self.texts.get(kind="ÖBL Haupttext")


@reversion.register(follow=["rootobject_ptr"])
Expand Down
15 changes: 13 additions & 2 deletions apis_ontology/templates/apis_entities/edit_generic.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,29 @@

{% block card-header-content %}
{{ block.super }}
{{ instance.oebl_kurzinfo }}
{{ instance.oebl_kurzinfo.text }}
{% if instance.sources.all %}
<i>({% for source in instance.sources.all %}<span title="{{ source.orig_filename }}">{{ source.pubinfo }}</span>{% endfor %})</i>
{% endif %}
{% endblock card-header-content %}

{% block relations %}

{% if instance.oebl_haupttext.text %}
<details class="mb-2">
{% select_highlighter_project request %}
<summary style="cursor: pointer; display: inline;"><h5>ÖBL Haupttext</h5></summary>
{{ instance.oebl_haupttext | highlight_text:request }}
</details>
{% endif %}

{{ block.super }}

<div class="container-fluid mt-4">
{% select_highlighter_project request %}
<h2>Texts</h2>
{% for text in instance.texts.all %}
{% if text.text %}
{% if text.text and text != instance.oebl_haupttext and text != instance.oebl_kurzinfo %}
<div class="mt-2">
<h4>{{ text.kind }}</h4>
{{ text | highlight_text:request }}
Expand Down

0 comments on commit 6490811

Please sign in to comment.