From 7572c92da50274cc8487a52091b23e616fff55a3 Mon Sep 17 00:00:00 2001 From: moanos Date: Wed, 10 Sep 2025 19:28:19 +0200 Subject: [PATCH] feat: Add expand option --- src/fellchensammlung/aviews/embeddables.py | 5 + .../lists/list-adoption-notices.html | 6 +- .../partials/partial-adoption-notice.html | 112 ++++++++++++------ 3 files changed, 88 insertions(+), 35 deletions(-) diff --git a/src/fellchensammlung/aviews/embeddables.py b/src/fellchensammlung/aviews/embeddables.py index 6fa25ec..a9caafa 100644 --- a/src/fellchensammlung/aviews/embeddables.py +++ b/src/fellchensammlung/aviews/embeddables.py @@ -6,6 +6,11 @@ from fellchensammlung.models import RescueOrganization, AdoptionNotice, Species @headers({"X-Robots-Tag": "noindex"}) def list_ans_per_rescue_organization(request, rescue_organization_id, species_slug=None): + expand = request.GET.get("expand") + if expand is not None: + expand = True + else: + expand = False org = get_object_or_404(RescueOrganization, pk=rescue_organization_id) if species_slug is None: adoption_notices = AdoptionNotice.objects.filter(organization=org) diff --git a/src/fellchensammlung/templates/fellchensammlung/lists/list-adoption-notices.html b/src/fellchensammlung/templates/fellchensammlung/lists/list-adoption-notices.html index fd36a1a..7a2ea59 100644 --- a/src/fellchensammlung/templates/fellchensammlung/lists/list-adoption-notices.html +++ b/src/fellchensammlung/templates/fellchensammlung/lists/list-adoption-notices.html @@ -3,7 +3,11 @@
{% for adoption_notice in adoption_notices %}
- {% include "fellchensammlung/partials/partial-adoption-notice-minimal.html" %} + {% if expand %} + {% include "fellchensammlung/partials/partial-adoption-notice.html" %} + {% else %} + {% include "fellchensammlung/partials/partial-adoption-notice-minimal.html" %} + {% endif %}
{% endfor %}
diff --git a/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice.html index 8d058dd..7c403ab 100644 --- a/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice.html +++ b/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice.html @@ -1,40 +1,84 @@ {% load custom_tags %} {% load i18n %} +
+ +
+
+
+ +
-
-
- -

{% translate "Notfellchen" %}: {{ adoption_notice.animals.all|join_link:", " | safe }} -

-

- Ort - {% if adoption_notice.location %} - {{ adoption_notice.location.str }} - {% else %} - {{ adoption_notice.location_string }} - {% endif %} -

-
- {% if adoption_notice.description %} - {{ adoption_notice.description | render_markdown }} - {% else %} -

- {% translate "Keine Beschreibung" %} -

- {% endif %} -
- {% if adoption_notice.get_photo %} -
- {{ adoption_notice.get_photo.alt_text }} +
+ + {% if adoption_notice.organization %} + + {% else %} +

+ + {% if adoption_notice.location %} + {{ adoption_notice.location }} + {% else %} + {{ adoption_notice.location_string }} + {% endif %} +

+ {% endif %} +
+
+ {% include "fellchensammlung/partials/sex-overview.html" %} +
+
+
+
+ + {% if adoption_notice.get_photos %} + + + {% endif %} + {% endif %} + + {% if adoption_notice.description_short %} +
+ {{ adoption_notice.description_short | render_markdown }}
- {% else %} - {% translate "Keine Foto" %} {% endif %}
-
\ No newline at end of file +
+ + +