python-gallery/onlylegs/templates/list.html

78 lines
3.4 KiB
HTML
Raw Normal View History

{% extends 'base.html' %}
2023-03-25 16:22:32 +00:00
{% block nav_groups %}selected{% endblock %}
{% block head %}
{% if images %}<meta name="theme-color" content="rgb{{ images.0.colours.0 }}"/>{% endif %}
{% endblock %}
{% block header %}
2023-04-04 19:36:24 +00:00
<div class="banner-small">
<div class="banner-content">
2023-04-07 09:18:03 +00:00
<h1 class="banner-header">{{ config.WEBSITE_CONF.name }}</h1>
{% if groups|length == 0 %}
2023-04-04 19:36:24 +00:00
<p class="banner-info">No groups!!!!</p>
{% elif groups|length == 69 %}
2023-04-04 19:36:24 +00:00
<p class="banner-info">{{ groups|length }} groups, uwu</p>
{% else %}
2023-04-04 19:36:24 +00:00
<p class="banner-info">{{ groups|length }} groups</p>
{% endif %}
{% if current_user.is_authenticated %}
<div class="pill-row">
<div>
<button class="pill-item" onclick="groupCreatePopup()"><i class="ph ph-plus"></i></button>
2023-04-04 19:36:24 +00:00
</div>
</div>
{% endif %}
</div>
</div>
{% endblock %}
{% block content %}
{% if groups %}
<div class="gallery-grid">
{% for group in groups %}
<a
class="group-item square"
id="group-{{ group.id }}"
href="{{ url_for('group.group', group_id=group.id) }}"
{% if group.images|length > 0 %} style="background-color: rgba{{ group.images.0.colours.0 }};"{% endif %}
>
<div class="image-filter">
<p class="image-subtitle">By {{ group.author.username }}</p>
<p class="image-title">{{ group.name }}</p>
</div>
<div class="images size-{{ group.images|length }}">
{% if group.images|length > 0 %}
{% for image in group.images %}
<picture>
2023-08-04 17:34:08 +00:00
<source srcset="{{ url_for('api.media', path='uploads/' + image.filename) }}?r=thumb&e=webp">
<source srcset="{{ url_for('api.media', path='uploads/' + image.filename) }}?r=thumb&e=png">
<img
2023-08-04 17:34:08 +00:00
src="{{ url_for('api.media', path='uploads/' + image.filename) }}?r=thumb"
alt="{% if image.alt %}{{ image.alt }}{% else %}Image Thumbnail{% endif %}"
class="data-{{ loop.index }}"
onload="imgFade(this)"
style="opacity:0;"
fetchpriority="low"
/>
</picture>
{% endfor %}
{% else %}
<img src="{{ url_for('static', filename='error.png') }}" class="loaded" alt="Error thumbnail"/>
{% endif %}
</div>
</a>
{% endfor %}
</div>
{% else %}
<div class="big-text">
<h1>*crickets chirping*</h1>
{% if current_user.is_authenticated %}
<p>You can get started by creating a new image group!</p>
{% else %}
<p>Login to start seeing anything here!</p>
{% endif %}
</div>
{% endif %}
{% endblock %}