diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index cf3803f..1dae66e 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -198,6 +198,14 @@ class RescueOrganization(models.Model): def species_urls(self): return SpeciesSpecificURL.objects.filter(organization=self) + @property + def has_contact_data(self): + """ + Returns true if at least one type of contact data is available. + """ + return self.instagram or self.facebook or self.website or self.phone_number or self.email or self.fediverse_profile + + # Admins can perform all actions and have the highest trust associated with them # Moderators can make moderation decisions regarding the deletion of content diff --git a/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-rescue-organization.html b/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-rescue-organization.html index 0ce15eb..b394805 100644 --- a/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-rescue-organization.html +++ b/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-rescue-organization.html @@ -23,34 +23,8 @@
{{ org.description | render_markdown }}
{% endif %} -{% trans "Kontaktdaten" %}
- {% if org.website %} - - - {% endif %} - {% if org.phone_number %} - - {{ org.website }} - - - {% endif %} - {% if org.email %} - - {{ org.phone_number }} - - - {% endif %} - - {{ org.email }} -{% trans "Kontaktdaten" %}
+ {% if org.hast_contact_data %} + {% if org.website %} + + + {% endif %} + {% if org.phone_number %} + + {{ org.website }} + + + {% endif %} + {% if org.email %} + + {{ org.phone_number }} + + + {% endif %} + + {% if org.fediverse_profile %} + + {{ org.email }} + + + {% endif %} + {% if org.instagram %} + + {{ org.fediverse_profile }} + + + {% endif %} + + {% if org.facebook %} + + {{ org.instagram }} + + + {% endif %} + {% else %} + + {{ org.facebook }} +{% translate 'Keine Kontaktdaten hinterlegt' %}
+ {% endif %} +