From b91a17e950d5f457f85fedbdd66507574811acf8 Mon Sep 17 00:00:00 2001 From: moanos Date: Sun, 22 Jun 2025 14:18:22 +0200 Subject: [PATCH 1/3] feat: Add link to admin interface --- .../fellchensammlung/details/detail-rescue-organization.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html b/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html index c60292d..7f4eb5a 100644 --- a/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html +++ b/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html @@ -1,6 +1,7 @@ {% extends "fellchensammlung/base.html" %} {% load custom_tags %} {% load i18n %} +{% load admin_urls %} {% block title %}{{ org.name }}{% endblock %} @@ -30,6 +31,9 @@
{% include "fellchensammlung/partials/partial-rescue-organization-contact.html" %}
+
+ Admin interface +
{% include "fellchensammlung/partials/partial-map.html" %} From 7be61bc9b88cf72f95ba112112e9ec136ddec8bf Mon Sep 17 00:00:00 2001 From: moanos Date: Sun, 22 Jun 2025 21:27:52 +0200 Subject: [PATCH 2/3] feat: try reverse --- src/fellchensammlung/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 01952dd..75c0cb8 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -685,6 +685,7 @@ def list_rescue_organizations(request, template='fellchensammlung/animal-shelter def detail_view_rescue_organization(request, rescue_organization_id, template='fellchensammlung/details/detail-rescue-organization.html'): org = RescueOrganization.objects.get(pk=rescue_organization_id) + url = reverse("fellchensammlung_rescueorganization_change", args={"rescue_organization_id": rescue_organization_id}) return render(request, template, context={"org": org, "map_center": org.position, "zoom_level": 6, "map_pins": [org]}) From eda6da7f1268443727c0aa3a1451be314247656c Mon Sep 17 00:00:00 2001 From: moanos Date: Mon, 23 Jun 2025 12:24:53 +0200 Subject: [PATCH 3/3] fix: Fix link to admin interface see https://forum.djangoproject.com/t/reverse-admin-urls/41535/2 --- .../fellchensammlung/details/detail-rescue-organization.html | 2 +- src/fellchensammlung/views.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html b/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html index 7f4eb5a..2f852f5 100644 --- a/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html +++ b/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html @@ -32,7 +32,7 @@ {% include "fellchensammlung/partials/partial-rescue-organization-contact.html" %}
- Admin interface + Admin interface
diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 75c0cb8..5e5f7f2 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -685,9 +685,10 @@ def list_rescue_organizations(request, template='fellchensammlung/animal-shelter def detail_view_rescue_organization(request, rescue_organization_id, template='fellchensammlung/details/detail-rescue-organization.html'): org = RescueOrganization.objects.get(pk=rescue_organization_id) - url = reverse("fellchensammlung_rescueorganization_change", args={"rescue_organization_id": rescue_organization_id}) + org_meta = org._meta return render(request, template, - context={"org": org, "map_center": org.position, "zoom_level": 6, "map_pins": [org]}) + context={"org": org, "map_center": org.position, "zoom_level": 6, "map_pins": [org], + "org_meta": org_meta}) def export_own_profile(request):