Fix #29 Download all password albums

This commit is contained in:
Alan Grainger
2024-12-01 18:32:26 +13:00
parent a4e4762cfb
commit e633f00afa
6 changed files with 47 additions and 28 deletions
+9 -3
View File
@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title><%- title || 'Gallery' %></title>
<title><%- title %></title>
<link rel="icon" href="/share/static/favicon.ico" type="image/x-icon">
<link type="text/css" rel="stylesheet" href="/share/static/style.css"/>
<link type="text/css" rel="stylesheet" href="/share/static/lg/lightgallery-bundle.min.css"/>
@@ -12,9 +12,15 @@
<% if (showTitle) { %>
<h1><%- title || 'Gallery' %></h1>
<% } %>
<% if (showDownload) { %>
<%
if (showDownload) {
// If there is a password required for the download, format it as a query string
const passwordQuery = Object.entries(password).length ? '?' + (new URLSearchParams(password)).toString() : ''
%>
<div id="download-all">
<a href="<%- path %>/download" title="Download all"><img src="/images/download-all.svg" height="24" width="24" alt="Download all"></a>
<a href="<%- path %>/download<%- passwordQuery %>" title="Download all"><img src="/images/download-all.svg"
height="24"
width="24" alt="Download all"></a>
</div>
<% } %>
</div>