feat: Move tags to content and only show gallery when there are pictures

This commit is contained in:
2025-06-15 20:43:39 +02:00
parent 975c962025
commit 9253fde2e5

View File

@@ -5,19 +5,24 @@
<h1 class="card-header-title"> <h1 class="card-header-title">
<a href="{% url 'animal-detail' animal_id=animal.pk %}">{{ animal.name }}</a> <a href="{% url 'animal-detail' animal_id=animal.pk %}">{{ animal.name }}</a>
</h1> </h1>
<div class="tags">
<div class="tag species">{{ animal.species }}</div>
<div class="tag sex">{{ animal.get_sex_display }}</div>
</div>
</div> </div>
<div class="card-content"> <div class="card-content">
<div class="grid">
<div class="tag cell">{{ animal.species }}</div>
<div class="tag cell">{{ animal.get_sex_display }}</div>
</div>
<div class="block">
<strong>{% trans 'Alter' %}</strong> {{ animal.hr_age }}
<strong>{% trans 'Alter' %}</strong> {{ animal.hr_age }}
</div>
{% if animal.description %} {% if animal.description %}
<div class="content"> <div class="content">
<p>{{ animal.description | render_markdown }}</p> <p>{{ animal.description | render_markdown }}</p>
</div> </div>
{% endif %} {% endif %}
{% if animal.get_photos %}
<div class="gallery"> <div class="gallery">
{% with photo=animal.get_photos.0 %} {% with photo=animal.get_photos.0 %}
<div class="main-photo"> <div class="main-photo">
@@ -45,8 +50,10 @@
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
{% endif %}
</div> </div>
<!--- Assume a user does not have edit permissions on animal if they have no other edit permission ---> <!--- Assume a user does not have edit permissions on animal if they have no other edit permission --->
{% if has_edit_permission %} {% if has_edit_permission %}
<div class="card-footer"> <div class="card-footer">