download button for user pictures and albums

This commit is contained in:
Kenneth SOARES
2025-02-17 14:57:00 +01:00
committed by Sli
parent a96b374ad7
commit 8cb53ceba2
4 changed files with 38 additions and 18 deletions

View File

@ -0,0 +1,13 @@
{% macro download_button() %}
<div x-show="pictures.length > 0" x-cloak>
<button
:disabled="isDownloading"
class="btn btn-blue"
@click="downloadZip()"
>
<i class="fa fa-download"></i>
{% trans %}Download all pictures{% endtrans %}
</button>
<progress x-ref="progress" x-show="isDownloading"></progress>
</div>
{% endmacro %}

View File

@ -1,4 +1,5 @@
{% extends "core/base.jinja" %}
{% from "core/download_pictures.jinja" import download_button %}
{%- block additional_css -%}
<link rel="stylesheet" href="{{ static('sas/css/album.scss') }}">
@ -14,19 +15,9 @@
{% block content %}
<main x-data="user_pictures">
{% if user.id == object.id %}
<div x-show="pictures.length > 0" x-cloak>
<button
:disabled="isDownloading"
class="btn btn-blue"
@click="downloadZip()"
>
<i class="fa fa-download"></i>
{% trans %}Download all my pictures{% endtrans %}
</button>
<progress x-ref="progress" x-show="isDownloading"></progress>
</div>
{% endif %}
{% if user.id == object.id %}
{{ download_button() }}
{% endif %}
<template x-for="[album, pictures] in Object.entries(albums)" x-cloak>
<section>