From 29667c86b981e1ee613b9892d94cdb8582b26f76 Mon Sep 17 00:00:00 2001 From: moanos Date: Wed, 20 Mar 2024 10:32:00 +0100 Subject: [PATCH] feat: Link adoption notices in list of them --- src/fellchensammlung/models.py | 4 ++++ .../templates/fellchensammlung/list-adoption-notices.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index c6498f6..6de85cc 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -81,6 +81,10 @@ class AdoptionNotice(models.Model): def animals_list(self): return self.animals.all() + def get_absolute_url(self): + """Returns the url to access a detailed page for the animal.""" + return reverse('adoption-notice-detail', args=[str(self.id)]) + class Animal(models.Model): MALE_NEUTERED = "M_N" diff --git a/src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html b/src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html index f7ac095..30bbf96 100644 --- a/src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html +++ b/src/fellchensammlung/templates/fellchensammlung/list-adoption-notices.html @@ -3,7 +3,7 @@ {% for adoption_notice in adoption_notices %}
  • -

    {{ adoption_notice.name }}

    +

    {{ adoption_notice.name }}

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

      {% for animal in adoption_notice.animal_list %}