74 lines
2.7 KiB
HTML
74 lines
2.7 KiB
HTML
<!-- /app/templates/_gallery_grid.html -->
|
|
<div class="gallery-grid">
|
|
{% for image in images.items %}
|
|
<div class="gallery-item">
|
|
<div class="gallery-thumb img-clickable"
|
|
data-id="{{ image.id }}"
|
|
data-full="{{ url_for('main.serve_image', filename=image.filepath | replace('/images/', '') ) }}"
|
|
data-type="{{ 'video' if image.filename.lower().endswith(('.mp4', '.mov')) else 'image' }}"
|
|
style="background-image: url('{{ url_for('main.serve_image', filename=(image.thumb_path or image.filepath) | replace('/images/', '') ) }}');"
|
|
data-filename="{{ image.filename }}">
|
|
|
|
{% if image.tags %}
|
|
<div class="tag-overlay">
|
|
{% for t in image.tags %}
|
|
<a class="tag-chip"
|
|
href="{{ url_for('main.gallery', tag=t.name) }}"
|
|
title="Filter by {{ t.name }}"
|
|
onclick="event.stopPropagation()">
|
|
{% if t.kind == 'artist' %}
|
|
🎨 {{ t.name.split(':', 1)[1] }}
|
|
{% elif t.kind == 'archive' %}
|
|
🗜️ {{ t.name.split(':', 1)[1] }}
|
|
{% else %}
|
|
#{{ t.name }}
|
|
{% endif %}
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if image.filename.lower().endswith(('.mp4', '.mov')) %}
|
|
<div class="play-overlay">▶</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Removed the artist link; keep date only -->
|
|
<span class="image-date">{{ image.taken_at or image.imported_at | datetimeformat }}</span>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Modal -->
|
|
<div id="imageModal" class="modal">
|
|
<div class="modal-content">
|
|
<!-- Navigation buttons -->
|
|
<button id="modalPrev" class="modal-button modal-prev">←</button>
|
|
<button id="modalNext" class="modal-button modal-next">→</button>
|
|
|
|
<div class="modal-body">
|
|
<div id="modalImageWrapper" class="modal-image-wrapper">
|
|
<img id="modalImage" src="" alt="Full View">
|
|
</div>
|
|
|
|
<!-- Tag editor (inline, minimal UI) -->
|
|
<div id="modalTagEditor" class="tag-editor" data-image-id="">
|
|
<div id="modalTagList" class="tags"></div>
|
|
<form id="modalTagForm" class="tag-form" autocomplete="off">
|
|
<input type="text" name="name" placeholder="Add tag… (artist:foo, archive:bar, or freeform)">
|
|
<button type="submit">Add</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="{{ url_for('static', filename='js/modal-pagination.js') }}"></script>
|
|
|
|
{% if request.args.get('page', '1') == '1' and not request.args.get('per_page') %}
|
|
<script src="{{ url_for('static', filename='js/dynamic_gallery_paging.js') }}"></script>
|
|
{% endif %}
|
|
|