feat: Add ANs to rescue organization

This commit is contained in:
moanos [he/him] 2024-11-14 19:27:32 +01:00
parent 6c52246bb7
commit efabebfdbf
2 changed files with 17 additions and 0 deletions

View File

@ -113,6 +113,13 @@ class RescueOrganization(models.Model):
comment = models.TextField(verbose_name=_("Kommentar"), null=True, blank=True, ) comment = models.TextField(verbose_name=_("Kommentar"), null=True, blank=True, )
description = models.TextField(null=True, blank=True, verbose_name=_('Beschreibung')) # Markdown allowed description = models.TextField(null=True, blank=True, verbose_name=_('Beschreibung')) # Markdown allowed
def get_absolute_url(self):
return reverse("rescue-organization-detail", args=[str(self.pk)])
@property
def adoption_notices(self):
return AdoptionNotice.objects.filter(organization=self)
class User(AbstractUser): class User(AbstractUser):
""" """

View File

@ -16,4 +16,14 @@
{% endif %} {% endif %}
<p>{{ org.description | render_markdown }}</p> <p>{{ org.description | render_markdown }}</p>
</div> </div>
<h2>{% translate 'Vermittlungen der Organisation' %}</h2>
<div class="container-cards">
{% if org.adoption_notices %}
{% for adoption_notice in org.adoption_notices %}
{% include "fellchensammlung/partials/partial-adoption-notice-minimal.html" %}
{% endfor %}
{% else %}
<p>{% translate "Keine Vermittlungen gefunden." %}</p>
{% endif %}
</div>
{% endblock %} {% endblock %}