diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index df43762..fda05b2 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -121,6 +121,10 @@ class Location(models.Model): def __str__(self): return f"{self.name} ({self.latitude:.5}, {self.longitude:.5})" + @property + def str_hr(self): + return f"{self.name.split(',')[0]}" + @staticmethod def get_location_from_string(location_string): geo_api = geo.GeoAPI() diff --git a/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice-minimal.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice-minimal.html index 0fc8af1..d6e3a67 100644 --- a/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice-minimal.html +++ b/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice-minimal.html @@ -12,7 +12,7 @@
Ort {% if adoption_notice.location %} - {{ adoption_notice.location }} + {{ adoption_notice.location.str_hr }} {% else %} {{ adoption_notice.location_string }} {% endif %} diff --git a/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice.html index 97e36ae..e5f85c0 100644 --- a/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice.html +++ b/src/fellchensammlung/templates/fellchensammlung/partials/partial-adoption-notice.html @@ -14,7 +14,7 @@
Ort {% if adoption_notice.location %} - {{ adoption_notice.location }} + {{ adoption_notice.location.str_hr }} {% else %} {{ adoption_notice.location_string }} {% endif %}