From 87834b3bfde1edbd75648533103ae5ff0d09f6df Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Fri, 10 Nov 2023 09:31:50 +0100 Subject: [PATCH] fix: cleanup entities detail template The detail template references a couple of attributes that can not be expected of entities anymore. In addition, due to the reimplementation of the `relevant_fields` logic in 13986b8 the template does not have to list attributes manually. Therefore we remove some attributes from the listing and others are now surrounded by {% if %}{% endif %} statements. Closes: #396 --- .../detail_views/detail_generic.html | 183 +++++++++--------- 1 file changed, 93 insertions(+), 90 deletions(-) diff --git a/apis_core/apis_entities/templates/apis_entities/detail_views/detail_generic.html b/apis_core/apis_entities/templates/apis_entities/detail_views/detail_generic.html index dbf48ef54..0265a2406 100644 --- a/apis_core/apis_entities/templates/apis_entities/detail_views/detail_generic.html +++ b/apis_core/apis_entities/templates/apis_entities/detail_views/detail_generic.html @@ -110,10 +110,6 @@

{% block info-table %} - - - - {% for field, value in relevant_fields %} @@ -122,24 +118,26 @@

{% endfor %} - - - - - - - - - - - - + + {% if no_merge_labels %} + + + + + {% endif %} + + {% if object.kind %} + + + + + {% endif %} {% if object.start_date or object.end_date %} @@ -154,99 +152,104 @@

+ {% endif %} + + {% if object.lat and object.lng %} - - + + - - - - {% endif %} + {% endif %} - {% if object.lat %} - - - - - {% endif %} +
Titel{{ object.name }}
{{ field.verbose_name }}
Labels - {% for x in no_merge_labels %} -
  • - {{ x.label_type }}:{{ x.label }} -
  • - {% endfor %} -
    ID{{ object.id }}
    Type{{ object.kind }}
    Labels + {% for x in no_merge_labels %} +
  • + {{ x.label_type }}:{{ x.label }} +
  • + {% endfor %} +
    Type{{ object.kind }}
    Notes{{ object.notes }}Lat/Lng{{ object.lat }} / {{ object.lng }}
    References{{ object.references }}
    Lat/Lng{{ object.lat }} / {{ object.lng }}
    + {% endblock info-table %} - - {% endblock info-table %} + {% block info-metadata %} + - {% block info-metadata %} -
    + {% if object.collections.all %} + {% endif %} + + + + + + + {% if object.notes %} - - + + + {% endif %} - {% if object.notes %} - - - - - {% endif %} + {% if object.references %} + + + + + {% endif %} + +
    Collection(s) {% for x in object.collection.all %}
  • {{ x }}
  • {% endfor %}
    Uri(s) + {% for x in object.uri_set.all %} + {{ x }} +
    + {% endfor %} +
    Uri(s) - {% for x in object.uri_set.all %} - {{ x }} -
    - {% endfor %} -
    Notes{{ object.notes }}
    Notes{{ object.notes }}
    References{{ object.references }}
    + {% endblock info-metadata %} - - {% endblock info-metadata %} + {% block left-pane-additional %} + {% endblock left-pane-additional %} - {% block left-pane-additional %} - {% endblock left-pane-additional %} - -
    -
    -
    -

    Relations

    -
    -
    +
    +
    +
    +
    +

    Relations

    +
    +
    - {% block relations %} - {% for obj in right_card %} + {% block relations %} + {% for obj in right_card %} - {% if obj.1.data|length > 0 %} -

    {{ obj.0 }}

    -
    {% render_table obj.1 %}
    - {% endif %} + {% if obj.1.data|length > 0 %} +

    {{ obj.0 }}

    +
    {% render_table obj.1 %}
    + {% endif %} - {% endfor %} - {% endblock relations %} + {% endfor %} + {% endblock relations %} -
    -
    +
    +
    - {% if iiif %} -
    -
    -
    - {% endif %} + {% if iiif %} +
    +
    +
    + {% endif %} -
    - {% endblock content %} + +{% endblock content %} - {% block scripts %} - {{ block.super }} +{% block scripts %} + {{ block.super }} - {% if tei %} - - {% endif %} + + {% endif %} - {% if iiif %} - - {% endif %} + + {% endif %} - {% endblock scripts %} +{% endblock scripts %}