From 701997e2e9e7477de6d317f5ffbecc6a0a96ad12 Mon Sep 17 00:00:00 2001
From: moanos
Date: Mon, 25 Mar 2024 11:04:01 +0100
Subject: [PATCH] refactor: Restructure templates
---
.../templates/fellchensammlung/about.html | 2 +-
.../{ => details}/detail-animal-partial.html | 0
.../{ => details}/detail-member.html | 0
.../{ => details}/detail-report.html | 4 ++--
.../{ => details}/detail_adoption_notice.html | 2 +-
.../{ => details}/detail_animal.html | 2 +-
.../fellchensammlung/{ => forms}/form-report.html | 0
.../{ => forms}/form_add_adoption.html | 0
.../{ => forms}/form_add_animal_to_adoption.html | 0
.../templates/fellchensammlung/index.html | 2 +-
.../{ => lists}/list-adoption-notices.html | 2 +-
.../{ => lists}/list-moderation-action.html | 2 +-
.../fellchensammlung/{ => lists}/list-rules.html | 2 +-
.../{ => partials}/partial-adoption-notice.html | 0
.../{ => partials}/partial-animal-card.html | 0
.../{ => partials}/partial-moderation-action.html | 0
.../{ => partials}/partial-report.html | 0
.../{ => partials}/partial-rule.html | 0
.../templates/fellchensammlung/search.html | 2 +-
src/fellchensammlung/views.py | 14 +++++++-------
20 files changed, 17 insertions(+), 17 deletions(-)
rename src/fellchensammlung/templates/fellchensammlung/{ => details}/detail-animal-partial.html (100%)
rename src/fellchensammlung/templates/fellchensammlung/{ => details}/detail-member.html (100%)
rename src/fellchensammlung/templates/fellchensammlung/{ => details}/detail-report.html (82%)
rename src/fellchensammlung/templates/fellchensammlung/{ => details}/detail_adoption_notice.html (93%)
rename src/fellchensammlung/templates/fellchensammlung/{ => details}/detail_animal.html (63%)
rename src/fellchensammlung/templates/fellchensammlung/{ => forms}/form-report.html (100%)
rename src/fellchensammlung/templates/fellchensammlung/{ => forms}/form_add_adoption.html (100%)
rename src/fellchensammlung/templates/fellchensammlung/{ => forms}/form_add_animal_to_adoption.html (100%)
rename src/fellchensammlung/templates/fellchensammlung/{ => lists}/list-adoption-notices.html (57%)
rename src/fellchensammlung/templates/fellchensammlung/{ => lists}/list-moderation-action.html (60%)
rename src/fellchensammlung/templates/fellchensammlung/{ => lists}/list-rules.html (54%)
rename src/fellchensammlung/templates/fellchensammlung/{ => partials}/partial-adoption-notice.html (100%)
rename src/fellchensammlung/templates/fellchensammlung/{ => partials}/partial-animal-card.html (100%)
rename src/fellchensammlung/templates/fellchensammlung/{ => partials}/partial-moderation-action.html (100%)
rename src/fellchensammlung/templates/fellchensammlung/{ => partials}/partial-report.html (100%)
rename src/fellchensammlung/templates/fellchensammlung/{ => partials}/partial-rule.html (100%)
diff --git a/src/fellchensammlung/templates/fellchensammlung/about.html b/src/fellchensammlung/templates/fellchensammlung/about.html
index db444ab..d14c023 100644
--- a/src/fellchensammlung/templates/fellchensammlung/about.html
+++ b/src/fellchensammlung/templates/fellchensammlung/about.html
@@ -3,5 +3,5 @@
{% block content %}
Rules
- {% include "fellchensammlung/list-rules.html" %}
+ {% include "fellchensammlung/lists/list-rules.html" %}
{% endblock %}
\ No newline at end of file
diff --git a/src/fellchensammlung/templates/fellchensammlung/detail-animal-partial.html b/src/fellchensammlung/templates/fellchensammlung/details/detail-animal-partial.html
similarity index 100%
rename from src/fellchensammlung/templates/fellchensammlung/detail-animal-partial.html
rename to src/fellchensammlung/templates/fellchensammlung/details/detail-animal-partial.html
diff --git a/src/fellchensammlung/templates/fellchensammlung/detail-member.html b/src/fellchensammlung/templates/fellchensammlung/details/detail-member.html
similarity index 100%
rename from src/fellchensammlung/templates/fellchensammlung/detail-member.html
rename to src/fellchensammlung/templates/fellchensammlung/details/detail-member.html
diff --git a/src/fellchensammlung/templates/fellchensammlung/detail-report.html b/src/fellchensammlung/templates/fellchensammlung/details/detail-report.html
similarity index 82%
rename from src/fellchensammlung/templates/fellchensammlung/detail-report.html
rename to src/fellchensammlung/templates/fellchensammlung/details/detail-report.html
index 66c7fec..d8041ac 100644
--- a/src/fellchensammlung/templates/fellchensammlung/detail-report.html
+++ b/src/fellchensammlung/templates/fellchensammlung/details/detail-report.html
@@ -7,10 +7,10 @@
Wenn du sehen willst welche Moderationsentscheidungen getroffen werden, schau zu einem späteren Zeitpunkt wieder auf dieser Seite vorbei.
Wenn du unzufrieden mit der Entscheidung bist kannst du per Mail an info@notfellchen.org Einspruch einlegen.
{% endif %}
- {% include "fellchensammlung/partial-report.html" %}
+ {% include "fellchensammlung/partials/partial-report.html" %}
Moderationsverlauf
{% if report.get_moderation_actions %}
- {% include "fellchensammlung/list-moderation-action.html" %}
+ {% include "fellchensammlung/lists/list-moderation-action.html" %}
{% else %}
Bisher wurden keine Maßnahmen vorgenommen
{% endif %}
diff --git a/src/fellchensammlung/templates/fellchensammlung/detail_adoption_notice.html b/src/fellchensammlung/templates/fellchensammlung/details/detail_adoption_notice.html
similarity index 93%
rename from src/fellchensammlung/templates/fellchensammlung/detail_adoption_notice.html
rename to src/fellchensammlung/templates/fellchensammlung/details/detail_adoption_notice.html
index 7110aa9..c3f678c 100644
--- a/src/fellchensammlung/templates/fellchensammlung/detail_adoption_notice.html
+++ b/src/fellchensammlung/templates/fellchensammlung/details/detail_adoption_notice.html
@@ -32,7 +32,7 @@
{% for animal in adoption_notice.animals %}
- {% include "fellchensammlung/partial-animal-card.html" %}
+ {% include "fellchensammlung/partials/partial-animal-card.html" %}
{% endfor %}
{% endblock %}
diff --git a/src/fellchensammlung/templates/fellchensammlung/detail_animal.html b/src/fellchensammlung/templates/fellchensammlung/details/detail_animal.html
similarity index 63%
rename from src/fellchensammlung/templates/fellchensammlung/detail_animal.html
rename to src/fellchensammlung/templates/fellchensammlung/details/detail_animal.html
index 26dc0e6..31fac08 100644
--- a/src/fellchensammlung/templates/fellchensammlung/detail_animal.html
+++ b/src/fellchensammlung/templates/fellchensammlung/details/detail_animal.html
@@ -3,5 +3,5 @@
{% load i18n %}
{% block content %}
- {% include "fellchensammlung/detail-animal-partial.html" %}
+ {% include "fellchensammlung/details/detail-animal-partial.html" %}
{% endblock %}
diff --git a/src/fellchensammlung/templates/fellchensammlung/form-report.html b/src/fellchensammlung/templates/fellchensammlung/forms/form-report.html
similarity index 100%
rename from src/fellchensammlung/templates/fellchensammlung/form-report.html
rename to src/fellchensammlung/templates/fellchensammlung/forms/form-report.html
diff --git a/src/fellchensammlung/templates/fellchensammlung/form_add_adoption.html b/src/fellchensammlung/templates/fellchensammlung/forms/form_add_adoption.html
similarity index 100%
rename from src/fellchensammlung/templates/fellchensammlung/form_add_adoption.html
rename to src/fellchensammlung/templates/fellchensammlung/forms/form_add_adoption.html
diff --git a/src/fellchensammlung/templates/fellchensammlung/form_add_animal_to_adoption.html b/src/fellchensammlung/templates/fellchensammlung/forms/form_add_animal_to_adoption.html
similarity index 100%
rename from src/fellchensammlung/templates/fellchensammlung/form_add_animal_to_adoption.html
rename to src/fellchensammlung/templates/fellchensammlung/forms/form_add_animal_to_adoption.html
diff --git a/src/fellchensammlung/templates/fellchensammlung/index.html b/src/fellchensammlung/templates/fellchensammlung/index.html
index e641c92..15ca446 100644
--- a/src/fellchensammlung/templates/fellchensammlung/index.html
+++ b/src/fellchensammlung/templates/fellchensammlung/index.html
@@ -7,6 +7,6 @@
href="https://hyteck.de">moanos!
{% translate "Aktuelle Vermittlungen" %}
- {% include "fellchensammlung/list-adoption-notices.html" %}
+ {% include "fellchensammlung/lists/list-adoption-notices.html" %}
{% endblock %}
\ No newline at end of file
diff --git a/src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html b/src/fellchensammlung/templates/fellchensammlung/lists/list-adoption-notices.html
similarity index 57%
rename from src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html
rename to src/fellchensammlung/templates/fellchensammlung/lists/list-adoption-notices.html
index 20b9bb3..ffead9d 100644
--- a/src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html
+++ b/src/fellchensammlung/templates/fellchensammlung/lists/list-adoption-notices.html
@@ -1,6 +1,6 @@
{% for adoption_notice in adoption_notices %}
- {% include "fellchensammlung/partial-adoption-notice.html" %}
+ {% include "fellchensammlung/partials/partial-adoption-notice.html" %}
{% endfor %}
diff --git a/src/fellchensammlung/templates/fellchensammlung/list-moderation-action.html b/src/fellchensammlung/templates/fellchensammlung/lists/list-moderation-action.html
similarity index 60%
rename from src/fellchensammlung/templates/fellchensammlung/list-moderation-action.html
rename to src/fellchensammlung/templates/fellchensammlung/lists/list-moderation-action.html
index bf414ba..e7b29d6 100644
--- a/src/fellchensammlung/templates/fellchensammlung/list-moderation-action.html
+++ b/src/fellchensammlung/templates/fellchensammlung/lists/list-moderation-action.html
@@ -1,5 +1,5 @@
{% for moderation_action in moderation_actions %}
- {% include "fellchensammlung/partial-moderation-action.html" %}
+ {% include "fellchensammlung/partials/partial-moderation-action.html" %}
{% endfor %}
\ No newline at end of file
diff --git a/src/fellchensammlung/templates/fellchensammlung/list-rules.html b/src/fellchensammlung/templates/fellchensammlung/lists/list-rules.html
similarity index 54%
rename from src/fellchensammlung/templates/fellchensammlung/list-rules.html
rename to src/fellchensammlung/templates/fellchensammlung/lists/list-rules.html
index f765fdf..005951c 100644
--- a/src/fellchensammlung/templates/fellchensammlung/list-rules.html
+++ b/src/fellchensammlung/templates/fellchensammlung/lists/list-rules.html
@@ -1,5 +1,5 @@
{% for rule in rules %}
- {% include "fellchensammlung/partial-rule.html" %}
+ {% include "fellchensammlung/partials/partial-rule.html" %}
{% endfor %}
\ No newline at end of file
diff --git a/src/fellchensammlung/templates/fellchensammlung/partial-adoption-notice.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice.html
similarity index 100%
rename from src/fellchensammlung/templates/fellchensammlung/partial-adoption-notice.html
rename to src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice.html
diff --git a/src/fellchensammlung/templates/fellchensammlung/partial-animal-card.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-animal-card.html
similarity index 100%
rename from src/fellchensammlung/templates/fellchensammlung/partial-animal-card.html
rename to src/fellchensammlung/templates/fellchensammlung/partials/partial-animal-card.html
diff --git a/src/fellchensammlung/templates/fellchensammlung/partial-moderation-action.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-moderation-action.html
similarity index 100%
rename from src/fellchensammlung/templates/fellchensammlung/partial-moderation-action.html
rename to src/fellchensammlung/templates/fellchensammlung/partials/partial-moderation-action.html
diff --git a/src/fellchensammlung/templates/fellchensammlung/partial-report.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-report.html
similarity index 100%
rename from src/fellchensammlung/templates/fellchensammlung/partial-report.html
rename to src/fellchensammlung/templates/fellchensammlung/partials/partial-report.html
diff --git a/src/fellchensammlung/templates/fellchensammlung/partial-rule.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-rule.html
similarity index 100%
rename from src/fellchensammlung/templates/fellchensammlung/partial-rule.html
rename to src/fellchensammlung/templates/fellchensammlung/partials/partial-rule.html
diff --git a/src/fellchensammlung/templates/fellchensammlung/search.html b/src/fellchensammlung/templates/fellchensammlung/search.html
index 33893d0..a695f55 100644
--- a/src/fellchensammlung/templates/fellchensammlung/search.html
+++ b/src/fellchensammlung/templates/fellchensammlung/search.html
@@ -3,5 +3,5 @@
{% block content %}
Suche...
- {% include "fellchensammlung/list-adoption-notices.html" %}
+ {% include "fellchensammlung/lists/list-adoption-notices.html" %}
{% endblock %}
\ No newline at end of file
diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py
index 6c06bb4..d6d4d21 100644
--- a/src/fellchensammlung/views.py
+++ b/src/fellchensammlung/views.py
@@ -18,13 +18,13 @@ def index(request):
def adoption_notice_detail(request, adoption_notice_id):
adoption_notice = AdoptionNotice.objects.get(id=adoption_notice_id)
context = {"adoption_notice": adoption_notice}
- return render(request, 'fellchensammlung/detail_adoption_notice.html', context=context)
+ return render(request, 'fellchensammlung/details/detail_adoption_notice.html', context=context)
def animal_detail(request, animal_id):
animal = Animal.objects.get(id=animal_id)
context = {"animal": animal}
- return render(request, 'fellchensammlung/detail_animal.html', context=context)
+ return render(request, 'fellchensammlung/details/detail_animal.html', context=context)
def search(request):
@@ -42,7 +42,7 @@ def add_adoption(request):
return redirect(reverse("add-animal-to-adoption", args=[instance.pk]))
else:
form = AdoptionNoticeForm()
- return render(request, 'fellchensammlung/form_add_adoption.html', {'form': form})
+ return render(request, 'fellchensammlung/forms/form_add_adoption.html', {'form': form})
def add_animal_to_adoption(request, adoption_notice_id):
@@ -69,7 +69,7 @@ def add_animal_to_adoption(request, adoption_notice_id):
else:
form = AnimalForm()
image_form = ImageForm(request.POST, request.FILES, prefix="image_")
- return render(request, 'fellchensammlung/form_add_animal_to_adoption.html',
+ return render(request, 'fellchensammlung/forms/form_add_animal_to_adoption.html',
{'form': form, "image_form": image_form})
@@ -99,7 +99,7 @@ def report_adoption(request, adoption_notice_id):
return redirect(reverse("report-detail-success", args=[report_instance.pk], ))
else:
form = ReportForm()
- return render(request, 'fellchensammlung/form-report.html', {'form': form})
+ return render(request, 'fellchensammlung/forms/form-report.html', {'form': form})
def report_detail(request, report_id, form_complete=False):
@@ -111,7 +111,7 @@ def report_detail(request, report_id, form_complete=False):
context = {"report": report, "moderation_actions": moderation_actions, "form_complete": form_complete}
- return render(request, 'fellchensammlung/detail-report.html', context)
+ return render(request, 'fellchensammlung/details/detail-report.html', context)
def report_detail_success(request, report_id):
@@ -124,4 +124,4 @@ def report_detail_success(request, report_id):
def member_detail(request, user):
member = Member.objects.get(user=user)
context = {"member": member}
- return render(request, 'fellchensammlung/detail-member.html', context=context)
\ No newline at end of file
+ return render(request, 'fellchensammlung/details/detail-member.html', context=context)
\ No newline at end of file