From 153dc8c048ca0a1f466702df1dcac139e7d670ff Mon Sep 17 00:00:00 2001 From: moanos Date: Sat, 7 Feb 2026 21:36:22 +0100 Subject: [PATCH] feat: Add overview page for adoption notice social media actions --- .../details/detail-adoption-notice.html | 10 +++ .../misc/social-media-template-selection.html | 62 +++++++++++++++++++ src/fellchensammlung/urls.py | 3 + src/fellchensammlung/views.py | 13 +++- 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 src/fellchensammlung/templates/fellchensammlung/misc/social-media-template-selection.html diff --git a/src/fellchensammlung/templates/fellchensammlung/details/detail-adoption-notice.html b/src/fellchensammlung/templates/fellchensammlung/details/detail-adoption-notice.html index 5db920a..f98fecc 100644 --- a/src/fellchensammlung/templates/fellchensammlung/details/detail-adoption-notice.html +++ b/src/fellchensammlung/templates/fellchensammlung/details/detail-adoption-notice.html @@ -114,7 +114,17 @@ {% trans 'Aufrufe' %} {% endif %} + + + + {% trans 'Social Media Vorlagen' %} + + + + Admin interface diff --git a/src/fellchensammlung/templates/fellchensammlung/misc/social-media-template-selection.html b/src/fellchensammlung/templates/fellchensammlung/misc/social-media-template-selection.html new file mode 100644 index 0000000..ad1da15 --- /dev/null +++ b/src/fellchensammlung/templates/fellchensammlung/misc/social-media-template-selection.html @@ -0,0 +1,62 @@ +{% extends "fellchensammlung/base.html" %} +{% load i18n %} +{% load widget_tweaks %} +{% load admin_urls %} + +{% block title %} + Social Media Post für {{ adoption_notice }} +{% endblock %} + +{% block content %} +

Social Media Post für {{ adoption_notice }}

+
+
+
+ {% include 'fellchensammlung/partials/social_media/post-to-fedi.html' %} +

+ {% blocktranslate %} + + Die Vermittlung wird auf unserem Fediverse-Account gepostet + {% endblocktranslate %} +

+
+
+
+
+ + {% trans 'Instagram Storyvorlage' %} + +

+ {% blocktranslate %} + Eine Vorlage für eine Instagram-Story im Format 1080x1980px. + {% endblocktranslate %} +

+
+
+
+
+ + {% trans 'Instagram Post' %} + +

+ {% blocktranslate %} + Eine Vorlage für eine Instagram-Post mit einer Slide pro Tier. + {% endblocktranslate %} +

+
+
+
+
+

+ {% blocktranslate %} + Die Vorlagen werden idealerweise im Grafikprogramm Inkscape weiterbearbeitet. + {% endblocktranslate %} +

+ + + {% translate 'Inkscape herunterladen' %} + +
+{% endblock %} \ No newline at end of file diff --git a/src/fellchensammlung/urls.py b/src/fellchensammlung/urls.py index 2277d9f..6f00258 100644 --- a/src/fellchensammlung/urls.py +++ b/src/fellchensammlung/urls.py @@ -30,6 +30,9 @@ urlpatterns = [ path("tier//add-photo", views.add_photo_to_animal, name="animal-add-photo"), # ex: /adoption_notice/7/ path("vermittlung//", views.adoption_notice_detail, name="adoption-notice-detail"), + # ex: /adoption_notice/7/social-media-templates + path("vermittlung//social-media-templates", views.adoption_notice_social_media_templates, + name="adoption-notice-social-media-template-selection"), # ex: /adoption_notice/7/sharepic path("vermittlung//sharepic", views.adoption_notice_sharepic, name="adoption-notice-sharepic"), diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 6f323c6..a57a6de 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -13,7 +13,6 @@ from django.contrib.auth.decorators import user_passes_test from django.core.serializers import serialize from django.utils.translation import gettext_lazy as _ import json -import requests from .mail import notify_mods_new_report from notfellchen import settings @@ -1036,6 +1035,18 @@ def adoption_notice_story_pic(request, adoption_notice_id): return HttpResponse(svg_data, content_type="image/svg+xml") +def adoption_notice_social_media_templates(request, adoption_notice_id): + context = {} + if request.method == "POST": + action = request.POST.get("action") + if action == "post_to_fedi": + context = handle_post_fedi_action() + + adoption_notice = get_object_or_404(AdoptionNotice, pk=adoption_notice_id) + context["adoption_notice"] = adoption_notice + return render(request, 'fellchensammlung/misc/social-media-template-selection.html', context=context) + + @login_required def rescue_org_create_or_update(request, rescue_organization_id=None): """