Clean code

This commit is contained in:
Nyymix 2025-04-05 18:02:51 +03:00
parent f3ec438305
commit 3f03eb95bc
6 changed files with 82 additions and 167 deletions

View file

@ -3,7 +3,7 @@
<!-- Title -->
{% block title %} Gallery : Albums : {{ album.name }} {% endblock %}
{% block title %} Gallery : {{ album.name }} {% endblock %}
<!-- Parallax -->
{% block parallax %}

View file

@ -2,7 +2,7 @@
{% load exif_filters %}
<!-- Title -->
{% block title %} Gallery : Photo : {{ photo.slug }} {% endblock %}
{% block title %} Gallery : {{ photo.album.name }} : {{ photo.slug }} {% endblock %}
<!-- Content -->
@ -71,7 +71,7 @@
<div>{{ photo.likes }}</div>
</div>
<div class="uk-grid-small" uk-grid>
<div class="uk-width-expand" uk-leader>Download</div>
<div class="uk-width-expand" uk-leader>Download photo</div>
<div><a href="{{ photo.photo.url }}">{{ photo.width }}x{{ photo.height }}</a></div>
</div>
</div>
@ -104,7 +104,7 @@
<div>{{ photo.exif.FocalLength|exif_focallength}}</div>
</div>
<div class="uk-grid-small" uk-grid>
<div class="uk-width-expand" uk-leader>Focal Length</div>
<div class="uk-width-expand" uk-leader>Focal Length in 35mm</div>
<div>{{ photo.exif.FocalLengthIn35mmFilm|exif_focallength }}</div>
</div>
</div>

View file

@ -13,21 +13,25 @@
{% block content %}
<div class="uk-grid-small uk-child-width-1-2@s uk-child-width-1-3@m" uk-grid="masonry: true">
{% for album in results %}
<div>
<div class="uk-card uk-card-default">
<div class="uk-card-media-top">
<a href="{{ album.get_absolute_url }}">
<img src="{{ album.cover_url }}" alt="{{ album.name }}">
</a>
</div>
<div class="uk-overlay uk-overlay-primary uk-position-bottom uk-padding-small">
<h3 class="uk-card-title"><a href="{{ album.get_absolute_url }}">{{ album }}</a></h3>
<p>{{ album.album_date|date:"d.m.Y" }} &bull; {{ album.photos_in_album }} photos</p>
{% if results %}
{% for album in results %}
<div>
<div class="uk-card uk-card-default">
<div class="uk-card-media-top">
<a href="{{ album.get_absolute_url }}">
<img src="{{ album.cover_url }}" alt="{{ album.name }}">
</a>
</div>
<div class="uk-overlay uk-overlay-primary uk-position-bottom uk-padding-small">
<h3 class="uk-card-title"><a href="{{ album.get_absolute_url }}">{{ album }}</a></h3>
<p>{{ album.album_date|date:"d.m.Y" }} &bull; {{ album.photos_in_album }} photos</p>
</div>
</div>
</div>
</div>
{% endfor %}
{% endfor %}
{% else %}
<p>Not found: "{{ query }}".</p>
{% endif %}
</div>
{% include "./partials/pagination.html" %}