diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index b935472..b017a81 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -13,7 +13,7 @@ from django.contrib.auth.models import AbstractUser from .tools import misc, geo from notfellchen.settings import MEDIA_URL -from .tools.geo import LocationProxy +from .tools.geo import LocationProxy, Position from .tools.misc import age_as_hr_string, time_since_as_hr_string @@ -134,6 +134,14 @@ class RescueOrganization(models.Model): def adoption_notices(self): return AdoptionNotice.objects.filter(organization=self) + @property + def position(self): + if self.location: + return Position(latitude=self.location.latitude, longitude=self.location.longitude) + else: + return None + + # Admins can perform all actions and have the highest trust associated with them # Moderators can make moderation decisions regarding the deletion of content diff --git a/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html b/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html index 066bd5a..0d1037c 100644 --- a/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html +++ b/src/fellchensammlung/templates/fellchensammlung/details/detail-rescue-organization.html @@ -5,51 +5,57 @@ {% block title %}
{{ org.description | render_markdown }}
-{% translate "Website" %} | - {% endif %} - {% if org.phone_number %} -{% translate "Telefonnummer" %} | - {% endif %} - {% if org.email %} -{% translate "E-Mail" %} | - {% endif %} -||||||
- {{ org.website }} - | - {% endif %} - {% if org.phone_number %} -- {{ org.phone_number }} - | - {% endif %} + + {% if org.location %} + {{ org.location.str_hr }} + {% else %} + {{ org.location_string }} + {% endif %} +
{% translate "Website" %} | + {% endif %} + {% if org.phone_number %} +{% translate "Telefonnummer" %} | + {% endif %} + {% if org.email %} +{% translate "E-Mail" %} | + {% endif %} +
+ {{ org.website }} + | + {% endif %} + {% if org.phone_number %} ++ {{ org.phone_number }} + | + {% endif %} - {% if org.email %} -- {{ org.email }} - | - {% endif %} -