From ded1aa77cf0e31758f9fce125a6fcbb761f4f073 Mon Sep 17 00:00:00 2001 From: moanos Date: Mon, 18 Mar 2024 16:36:45 +0100 Subject: [PATCH] feat: Add sites for the main actions --- src/fellchensammlung/admin.py | 5 +++-- .../templates/fellchensammlung/add_adoption.html | 6 ++++++ src/fellchensammlung/templates/fellchensammlung/header.html | 6 +++--- src/fellchensammlung/templates/fellchensammlung/search.html | 6 ++++++ src/fellchensammlung/urls.py | 5 +++++ src/fellchensammlung/views.py | 6 ++++++ src/notfellchen/urls.py | 2 +- 7 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 src/fellchensammlung/templates/fellchensammlung/add_adoption.html create mode 100644 src/fellchensammlung/templates/fellchensammlung/search.html diff --git a/src/fellchensammlung/admin.py b/src/fellchensammlung/admin.py index 0ab3679..56d2715 100644 --- a/src/fellchensammlung/admin.py +++ b/src/fellchensammlung/admin.py @@ -2,10 +2,11 @@ from django.contrib import admin from django.contrib import admin -from .models import Animal, Species, RescueOrganization, AdoptionNotice, Location +from .models import Animal, Species, RescueOrganization, AdoptionNotice, Location, MarkdownContent admin.site.register(Animal) admin.site.register(Species) admin.site.register(RescueOrganization) admin.site.register(Location) -admin.site.register(AdoptionNotice) \ No newline at end of file +admin.site.register(AdoptionNotice) +admin.site.register(MarkdownContent) \ No newline at end of file diff --git a/src/fellchensammlung/templates/fellchensammlung/add_adoption.html b/src/fellchensammlung/templates/fellchensammlung/add_adoption.html new file mode 100644 index 0000000..f352fb7 --- /dev/null +++ b/src/fellchensammlung/templates/fellchensammlung/add_adoption.html @@ -0,0 +1,6 @@ +{% extends "fellchensammlung/base_generic.html" %} +{% load i18n %} + +{% block content %} + Work in Progress: Vermitteln +{% endblock %} \ No newline at end of file diff --git a/src/fellchensammlung/templates/fellchensammlung/header.html b/src/fellchensammlung/templates/fellchensammlung/header.html index c17c256..f3d2b34 100644 --- a/src/fellchensammlung/templates/fellchensammlung/header.html +++ b/src/fellchensammlung/templates/fellchensammlung/header.html @@ -8,9 +8,9 @@ diff --git a/src/fellchensammlung/templates/fellchensammlung/search.html b/src/fellchensammlung/templates/fellchensammlung/search.html new file mode 100644 index 0000000..e0bc4b2 --- /dev/null +++ b/src/fellchensammlung/templates/fellchensammlung/search.html @@ -0,0 +1,6 @@ +{% extends "fellchensammlung/base_generic.html" %} +{% load i18n %} + +{% block content %} + Suche... +{% endblock %} \ No newline at end of file diff --git a/src/fellchensammlung/urls.py b/src/fellchensammlung/urls.py index 9b9930f..bd350fc 100644 --- a/src/fellchensammlung/urls.py +++ b/src/fellchensammlung/urls.py @@ -8,4 +8,9 @@ urlpatterns = [ path("/", views.animal_detail, name="animal-detail"), # ex: /adoption_notice/7/ path("/", views.adoption_notice_detail, name="adoption-notice-detail"), + + # ex: /search/ + path("suchen/", views.search, name="search"), + # ex: /vermitteln/ + path("vermitteln/", views.add_adoption, name="add-adoption"), ] \ No newline at end of file diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 1381fde..c8d7f8c 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -19,3 +19,9 @@ def adoption_notice_detail(request, adoption_notice_id): def animal_detail(request, animal_id): response = "You're looking at animal %s." return HttpResponse(response % animal_id) + +def search(request): + return render(request, 'fellchensammlung/search.html') +def add_adoption(request): + return render(request, 'fellchensammlung/add_adoption.html') + diff --git a/src/notfellchen/urls.py b/src/notfellchen/urls.py index 96533b2..9679a9e 100644 --- a/src/notfellchen/urls.py +++ b/src/notfellchen/urls.py @@ -18,6 +18,6 @@ from django.contrib import admin from django.urls import include, path urlpatterns = [ - path("fellchensammlung/", include("fellchensammlung.urls")), + path("", include("fellchensammlung.urls")), path('admin/', admin.site.urls), ]