feat: Use location when appropriate, otherwise fallback to location string

This commit is contained in:
moanos [he/him] 2024-05-31 13:33:42 +02:00
parent af4bd9356f
commit 1f87e486e0
2 changed files with 13 additions and 8 deletions

View File

@ -16,11 +16,14 @@
<th>{% translate "Weitere Informationen" %}</th>
</tr>
<tr>
{% if adoption_notice.location %}
<td>{{ adoption_notice.location.name }}, {{ adoption_notice.location.postcode }}</td>
{% else %}
<td>{% translate "Kein Ort angegeben" %}</td>
{% endif %}
<td>
{% if adoption_notice.location %}
{{ adoption_notice.location }}
{% else %}
{{ adoption_notice.location_string }}
{% endif %}
</td>
<td>{{ adoption_notice.searching_since }}</td>
{% if adoption_notice.further_information %}
<td>{{ adoption_notice.further_information }}</td>

View File

@ -4,8 +4,10 @@
<div class="card">
<div>
<div class="header-card-adoption-notice">
<h1><a class="heading-card-adoption-notice" href="{{ adoption_notice.get_absolute_url }}"> {{ adoption_notice.name }}</a></h1>
<a class="adoption-card-report-link" href="{{ adoption_notice.get_report_url }}"><i class="fa-solid fa-flag"></i></a>
<h1><a class="heading-card-adoption-notice"
href="{{ adoption_notice.get_absolute_url }}"> {{ adoption_notice.name }}</a></h1>
<a class="adoption-card-report-link" href="{{ adoption_notice.get_report_url }}"><i
class="fa-solid fa-flag"></i></a>
</div>
<p><b>{% translate "Notfellchen" %}:</b> {{ adoption_notice.animals.all|join_link:", " | safe }}
</p>
@ -14,7 +16,7 @@
{% if adoption_notice.location %}
{{ adoption_notice.location }}
{% else %}
{% translate "Keine Ort angegeben" %}
{{ adoption_notice.location_string }}
{% endif %}
</p>
<p>