diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index 3cf2319..a18c49d 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -316,6 +316,13 @@ class AdoptionNotice(models.Model): sexes.add(animal.sex) return sexes + @property + def num_per_sex(self): + num_per_sex = dict() + for sex in SexChoices: + num_per_sex[sex] = self.animals.filter(sex=sex).count + return num_per_sex + @property def last_checked_hr(self): time_since_last_checked = timezone.now() - self.last_checked diff --git a/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-adoption-notice.html b/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-adoption-notice.html index 17fe09a..a1a6838 100644 --- a/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-adoption-notice.html +++ b/src/fellchensammlung/templates/fellchensammlung/details/bulma-detail-adoption-notice.html @@ -1,6 +1,7 @@ {% extends "fellchensammlung/base_bulma.html" %} {% load custom_tags %} {% load i18n %} +{% load static %} {% block title %}{{ adoption_notice.name }}{% endblock %} @@ -14,6 +15,34 @@
+
+ {% if adoption_notice.num_per_sex.F > 0 %} + {{ adoption_notice.num_per_sex.F }} + {% translate 'weibliche Tiere' %} + {% endif %} + {% if adoption_notice.num_per_sex.F_N > 0 %} + {{ adoption_notice.num_per_sex.F_N }} + {% translate 'weiblich, kastrierte Tiere' %} + {% endif %} + {% if adoption_notice.num_per_sex.I > 0 %} + {{ adoption_notice.num_per_sex.I }} + {% translate 'intersexuelle Tiere' %} + {% endif %} + {% if adoption_notice.num_per_sex.M > 0 %} + {{ adoption_notice.num_per_sex.M }} + {% translate 'männliche Tiere' %} + {% endif %} + {% if adoption_notice.num_per_sex.M_N > 0 %} + {{ adoption_notice.num_per_sex.M_N }} + {% translate 'männlich, kastrierte Tiere' %} + {% endif %} +
+

{% translate "Ort" %}

{% if adoption_notice.location %} @@ -22,67 +51,32 @@ {{ adoption_notice.location_string }} {% endif %}

- {% if adoption_notice.organization %} -
-

{% translate "Organisation" %}

-
- {{ adoption_notice.organization }} - {% if adoption_notice.organization.trusted %} -
- {% endif %} -
-
- {% endif %} - -
-

{% translate "Suchen seit" %}

-

{{ adoption_notice.searching_since }}

-
- -
-

{% translate "Zuletzt aktualisiert" %}

-

{{ adoption_notice.last_checked_hr }}

-
- -
-

{% translate "Weitere Informationen" %}

- {% if adoption_notice.further_information %} -
- - -
- {% else %} - - - {% endif %} -
-
+
-
-
-

{% translate "Bilder" %}

-
- -
+

{% translate "Beschreibung" %}

@@ -118,14 +112,26 @@ {% endif %}
-
+
{% for animal in adoption_notice.animals %} -
+
{% include "fellchensammlung/partials/bulma-partial-animal-card.html" %}
{% endfor %}
+ + {% if adoption_notice.further_information %} +
+ + +
+ {% endif %} + + {% include "fellchensammlung/partials/bulma-partial-comment-section.html" %} {% endblock %}