refactor: Move detailed animal view to partial to allow usage in other templates

This commit is contained in:
moanos [he/him] 2024-03-20 10:25:12 +01:00
parent 0943ecae62
commit c27c00c679
2 changed files with 20 additions and 17 deletions

View File

@ -0,0 +1,19 @@
<div class="detail-animal"></div>
<div class="detail-animal-header">
<h1 class="inline">{{ animal.name }}</h1>
<div class="species">{{ animal.species }}</div>
</div>
<div>
<table>
<tr>
<th>Alter</th>
<th>Geschlecht</th>
</tr>
<tr>
<td>{{ animal.hr_age }}</td>
<td>{{ animal.sex }}</td>
</tr>
</table>
</div>
<p>{{ animal.description }}</p>
</div>

View File

@ -3,21 +3,5 @@
{% load i18n %}
{% block content %}
<div class="detail-animal-header">
<h1 class="inline">{{ animal.name }}</h1>
<div class="species">{{ animal.species }}</div>
</div>
<div>
<table>
<tr>
<th>Alter</th>
<th>Geschlecht</th>
</tr>
<tr>
<td>{{ animal.hr_age }}</td>
<td>{{ animal.sex }}</td>
</tr>
</table>
</div>
<p>{{ animal.description }}</p>
{% include "fellchensammlung/detail-animal-partial.html" %}
{% endblock %}