From 064784a222de12b0f8bdf3066ceaa4bc6ccbbb93 Mon Sep 17 00:00:00 2001 From: moanos Date: Sat, 27 Sep 2025 15:35:39 +0200 Subject: [PATCH] feat: Use contact data of parent org if org doesn't have specified --- .../partial-in-panel-contact-data.html | 55 ++++++++++++++++++ .../partial-rescue-organization-contact.html | 57 ++----------------- 2 files changed, 61 insertions(+), 51 deletions(-) create mode 100644 src/fellchensammlung/templates/fellchensammlung/partials/partial-in-panel-contact-data.html diff --git a/src/fellchensammlung/templates/fellchensammlung/partials/partial-in-panel-contact-data.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-in-panel-contact-data.html new file mode 100644 index 0000000..cf7c6e7 --- /dev/null +++ b/src/fellchensammlung/templates/fellchensammlung/partials/partial-in-panel-contact-data.html @@ -0,0 +1,55 @@ +{% load i18n %} + +{% if org.website %} + + + + + {{ org.website }} + +{% endif %} + +{% if org.phone_number %} + + + + + {{ org.phone_number }} + +{% endif %} + +{% if org.email %} + + + + + {{ org.email }} + +{% endif %} + +{% if org.fediverse_profile %} + + + + + {{ org.fediverse_profile }} + +{% endif %} + +{% if org.instagram %} + + + + + {{ org.instagram }} + +{% endif %} + +{% if org.facebook %} + + + + + {{ org.facebook }} + +{% endif %} \ No newline at end of file diff --git a/src/fellchensammlung/templates/fellchensammlung/partials/partial-rescue-organization-contact.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-rescue-organization-contact.html index c5c0e6c..f3e5455 100644 --- a/src/fellchensammlung/templates/fellchensammlung/partials/partial-rescue-organization-contact.html +++ b/src/fellchensammlung/templates/fellchensammlung/partials/partial-rescue-organization-contact.html @@ -4,58 +4,13 @@

{% trans "Kontaktdaten" %}

{% if org.has_contact_data %} - {% if org.website %} - - - - - {{ org.website }} - - {% endif %} - {% if org.phone_number %} - - - - - {{ org.phone_number }} - - {% endif %} - {% if org.email %} - - - - - {{ org.email }} - - {% endif %} - - {% if org.fediverse_profile %} - - - - - {{ org.fediverse_profile }} - - {% endif %} - {% if org.instagram %} - - - - - {{ org.instagram }} - - {% endif %} - - {% if org.facebook %} - - - - - {{ org.facebook }} - - {% endif %} + {% include "fellchensammlung/partials/partial-in-panel-contact-data.html" %} + {% elif org.parent_org.has_contact_data %} + {% with org=org.parent_org %} + {% include "fellchensammlung/partials/partial-in-panel-contact-data.html" %} + {% endwith %} {% else %} -
+