feat: Add edit buttons to animal

This commit is contained in:
moanos [he/him] 2024-05-31 14:40:35 +02:00
parent 5f13736753
commit 26b16586b8
2 changed files with 24 additions and 9 deletions

View File

@ -190,6 +190,14 @@ h1, h2 {
border: none;
}
.container-edit-buttons {
display: flex;
flex-wrap: wrap;
.btn {
margin: 5px;
}
}
.form-button:hover, .link-button a:hover, .link-button a:active {
background-color: #4090b6;
}
@ -308,6 +316,7 @@ h1, h2 {
border-radius: 5px;
display: flex;
align-items: center;
justify-content: space-between;
}
.tag {
@ -348,7 +357,7 @@ h1, h2 {
}
.card {
flex: 1 16%;
flex: 1 25%;
margin: 10px;
border-radius: 8px;
padding: 5px;
@ -369,7 +378,9 @@ h1, h2 {
.header-card-adoption-notice {
display: flex;
justify-content: space-evenly;
align-items: center;
flex-wrap: wrap;
}
@ -402,7 +413,7 @@ h1, h2 {
}
.tags {
margin-left: auto;
margin-right: auto;
padding: 5px;
}

View File

@ -1,20 +1,24 @@
{% load i18n %}
<div class="card">
<div class="detail-animal-header">
<h1>{{ animal.name }}</h1>
<h1><a href="{% url 'animal-detail' animal_id=animal.pk %}">{{ animal.name }}</a></h1>
<div class="tags">
<div class="tag species">{{ animal.species }}</div>
<div class="tag sex">{{ animal.get_sex_display }}</div>
</div>
<div class="container-edit-buttons">
<a class="btn" href="{% url 'animal-edit' animal_id=animal.pk %}">{% translate 'Bearbeiten' %}</a>
<a class="btn" href="{% url 'animal-add-photo' animal_id=animal.pk %}">{% translate 'Foto hinzufügen' %}</a>
</div>
</div>
{% if animal.description %}
<p>{{ animal.description }}</p>
{% endif %}
{% if animal.get_photo %}
<img src="{{ MEDIA_URL }}/{{ animal.get_photo.image }}" alt="{{ animal.get_photo.alt_text }}">
</div>
{% else %}
{% translate "Keine Foto" %}
{% endif %}
{% for photo in animal.get_photos %}
<img src="{{ MEDIA_URL }}/{{ photo.image }}" alt="{{ photo.alt_text }}">
{% endfor %}
</div>