Add likes, update templates

This commit is contained in:
Nyymix 2025-01-15 20:31:41 +02:00
parent 89134993ad
commit f3a94857d0
8 changed files with 109 additions and 16 deletions

View file

@ -14,8 +14,37 @@
<!-- Content -->
{% block content %}
<h1>{{ photo.slug }}</h1>
<p> Views: {{ photo.views }}</p>
<img src="{{ photo.photo.url }}" alt="{{ photo.slug }}" class="height='100%'" />
<div uk-grid>
<div class="uk-width-1-1 uk-width-3-4@m">
<div uk-lightbox >
<a href="{{ photo.photo.url }}" data-alt="{{ photo.slug }}">
<img src="{{ photo.photo.url }}" alt="{{ photo.slug }}" class="height='100%'" />
</a>
</div>
</div>
<div class="uk-margin-top uk-width-1-4@m uk-visible@m">
{% if prev %}
<a href="{% url 'gallery:photo_url' photo.album.slug prev.slug %}" uk-slidenav-previous>&laquo; Prev</a>
{% endif %}
{% if next %}
<a href="{% url 'gallery:photo_url' photo.album.slug next.slug %}" uk-slidenav-next>Next &raquo;</a>
{% endif %}
<p> Views: {{ photo.views }}</p>
<p> Likes: {{ photo.likes }}</p>
<p> Taken: {{ photo.taken_at }} </p>
<p> Favorite: {{ photo.favorite }}</p>
<a href="{{ photo.photo.url }}">Download {{ photo.width }}x{{ photo.height }}</a>
<form action="{% url 'gallery:photo_url' photo.album.slug photo.slug %}" method="POST" class="uk-form">
{% csrf_token %}
<button type="submit" name="like" value="true" class="uk-button uk-button-primary">
<span uk-icon="icon: heart"></span> Like
</button>
</form>
</div>
</div>
{% endblock %}