From 40f7fa390a22d5a84c7efcf4bc6e8e553778550f Mon Sep 17 00:00:00 2001 From: csae8092 Date: Fri, 12 Jan 2024 12:50:46 +0100 Subject: [PATCH] added map to place detail view --- apis_core/apis_entities/detail_views.py | 2 +- .../detail_views/entity_detail_generic.html | 22 +++---- ...detail_generic.html => person_detail.html} | 0 .../detail_views/place_detail.html | 57 +++++++++++++++++++ templates/partials/head.html | 6 ++ 5 files changed, 75 insertions(+), 12 deletions(-) rename apis_core/apis_entities/templates/apis_entities/detail_views/{person_detail_generic.html => person_detail.html} (100%) create mode 100644 apis_core/apis_entities/templates/apis_entities/detail_views/place_detail.html diff --git a/apis_core/apis_entities/detail_views.py b/apis_core/apis_entities/detail_views.py index aa66839..11a959e 100644 --- a/apis_core/apis_entities/detail_views.py +++ b/apis_core/apis_entities/detail_views.py @@ -79,7 +79,7 @@ def get(self, request, *args, **kwargs): RequestConfig(request, paginate={"per_page": 10}).configure(tb_label) template = select_template( [ - "apis_entities/detail_views/{}_detail_generic.html".format(entity), + "apis_entities/detail_views/{}_detail.html".format(entity), "apis_entities/detail_views/entity_detail_generic.html", ] ) diff --git a/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html b/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html index 2d45c1e..78c11be 100644 --- a/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html +++ b/apis_core/apis_entities/templates/apis_entities/detail_views/entity_detail_generic.html @@ -29,6 +29,7 @@

{{ entity_type }}s {% endif %} {{ object }} +

{% if user.is_authenticated %}

{% if object.get_edit_url %} @@ -44,7 +45,6 @@

{% endif %}

{% endif %} -
{% if object.get_next_url %} @@ -146,30 +146,30 @@

{% endblock info-table %} {% block info-metadata %} - {% if object.collection.all %} - {% endif %} + {% if object.collection.all %} + {% endif %} {% if object.notes %}
- Collection(s) + Uri(s) - {% for x in object.collection.all %} -
  • - {{ x }} -
  • + {% for x in object.uri_set.all %} + {{ x }}
    {% endfor %}
    - Uri(s) + Collection(s) - {% for x in object.uri_set.all %} - {{ x }}
    + {% for x in object.collection.all %} +
  • + {{ x }} +
  • {% endfor %}
    diff --git a/apis_core/apis_entities/templates/apis_entities/detail_views/person_detail_generic.html b/apis_core/apis_entities/templates/apis_entities/detail_views/person_detail.html similarity index 100% rename from apis_core/apis_entities/templates/apis_entities/detail_views/person_detail_generic.html rename to apis_core/apis_entities/templates/apis_entities/detail_views/person_detail.html diff --git a/apis_core/apis_entities/templates/apis_entities/detail_views/place_detail.html b/apis_core/apis_entities/templates/apis_entities/detail_views/place_detail.html new file mode 100644 index 0000000..d012151 --- /dev/null +++ b/apis_core/apis_entities/templates/apis_entities/detail_views/place_detail.html @@ -0,0 +1,57 @@ +{% extends "apis_entities/detail_views/entity_detail_generic.html" %} + + {% block info-table %} + {% if object.lat %} +
    + + {% endif %} + + {% if no_merge_labels %} + + + + + {% endif %} + + + + + + + + + + + + +
    + Alternative Namen + + {% for x in no_merge_labels %} +
  • + {{ x.label_type }}: {{ x.label }} +
  • + {% endfor %} + +
    + ID + + {{ object.id }} +
    + Koordinaten + + {{ object.lat }} {{ object.lng}} +
    Ortstype{{ object.kind }}
    + + {% endblock info-table %} diff --git a/templates/partials/head.html b/templates/partials/head.html index a2c8c7f..e9837f5 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -19,5 +19,11 @@ + + {% block scriptHeader %} {% endblock scriptHeader %} \ No newline at end of file