Sith/core/templates/core/user_pictures.jinja

69 lines
2.0 KiB
Django/Jinja
Raw Normal View History

2016-11-20 09:40:49 +00:00
{% extends "core/base.jinja" %}
{%- block additional_css -%}
<link rel="stylesheet" href="{{ static('sas/css/album.scss') }}">
{%- endblock -%}
2024-07-23 10:11:19 +00:00
{% block additional_js %}
<script type="module" src="{{ static('bundled/user/pictures-index.js') }}"></script>
2024-07-23 10:11:19 +00:00
{% endblock %}
2016-11-20 09:40:49 +00:00
{% block title %}
2024-07-23 10:11:19 +00:00
{% trans user_name=profile.get_display_name() %}{{ user_name }}'s pictures{% endtrans %}
2016-11-20 09:40:49 +00:00
{% endblock %}
{% block content %}
<main x-data="user_pictures">
{% if user.id == object.id %}
<div x-show="pictures.length > 0" x-cloak>
2024-07-30 17:23:48 +00:00
<button
2024-10-08 15:14:22 +00:00
:disabled="isDownloading"
2024-07-30 17:57:56 +00:00
class="btn btn-blue"
2024-10-08 15:14:22 +00:00
@click="downloadZip()"
2024-07-30 17:23:48 +00:00
>
2024-07-30 17:57:56 +00:00
<i class="fa fa-download"></i>
2024-07-30 17:23:48 +00:00
{% trans %}Download all my pictures{% endtrans %}
</button>
2024-10-08 15:14:22 +00:00
<progress x-ref="progress" x-show="isDownloading"></progress>
2024-07-30 17:23:48 +00:00
</div>
{% endif %}
2024-08-16 20:52:20 +00:00
<template x-for="[album, pictures] in Object.entries(albums)" x-cloak>
<section>
<br />
<h4 x-text="album"></h4>
<div class="photos">
<template x-for="picture in pictures">
<a :href="`/sas/picture/${picture.id}`">
2024-08-16 20:52:20 +00:00
<div
class="photo"
:class="{not_moderated: !picture.is_moderated}"
:style="`background-image: url(${picture.thumb_url})`"
>
<template x-if="!picture.is_moderated">
<div class="overlay">&nbsp;</div>
<div class="text">{% trans %}To be moderated{% endtrans %}</div>
</template>
<template x-if="picture.is_moderated">
<div class="text">&nbsp;</div>
</template>
</div>
</a>
</template>
</div>
2024-08-10 13:16:37 +00:00
</section>
</template>
<div class="photos" :aria-busy="loading"></div>
2024-07-30 17:23:48 +00:00
</main>
2024-07-30 17:57:56 +00:00
{% endblock content %}
2024-07-30 17:23:48 +00:00
{% block script %}
2024-07-30 17:23:48 +00:00
{{ super() }}
<script>
window.addEventListener("DOMContentLoaded", () => {
loadPicturePage({ userId: {{ object.id }} });
})
</script>
2024-07-30 17:57:56 +00:00
{% endblock script %}