2024-10-28 19:47:14 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2024-10-29 09:49:54 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
2024-12-01 05:32:26 +00:00
|
|
|
<title><%- title %></title>
|
2024-11-17 15:26:40 +00:00
|
|
|
<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"/>
|
2024-10-28 19:47:14 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2024-11-15 14:48:12 +00:00
|
|
|
<div id="header">
|
|
|
|
<% if (showTitle) { %>
|
|
|
|
<h1><%- title || 'Gallery' %></h1>
|
|
|
|
<% } %>
|
2024-12-01 05:32:26 +00:00
|
|
|
<%
|
|
|
|
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() : ''
|
|
|
|
%>
|
2024-11-15 14:48:12 +00:00
|
|
|
<div id="download-all">
|
2024-12-26 20:52:41 +00:00
|
|
|
<a href="<%- path %>/download<%- passwordQuery %>" title="Download all"><img src="/share/static/images/download-all.svg"
|
2024-12-01 05:32:26 +00:00
|
|
|
height="24"
|
|
|
|
width="24" alt="Download all"></a>
|
2024-11-15 14:48:12 +00:00
|
|
|
</div>
|
|
|
|
<% } %>
|
|
|
|
</div>
|
2024-10-28 19:47:14 +00:00
|
|
|
<div id="lightgallery">
|
2024-10-29 09:29:14 +00:00
|
|
|
<% items.forEach(item => {
|
|
|
|
if (item.video) { %>
|
2024-11-18 13:18:13 +00:00
|
|
|
<a data-video='<%- item.video %>'
|
|
|
|
<% if (item.downloadUrl) { %>
|
|
|
|
data-download-url="<%- item.downloadUrl %>"
|
|
|
|
<% } %>
|
|
|
|
>
|
2024-10-29 09:29:14 +00:00
|
|
|
<img alt="" src="<%- item.thumbnailUrl %>"/>
|
|
|
|
<div class="play-icon"></div>
|
2024-10-28 19:47:14 +00:00
|
|
|
</a>
|
2024-10-29 09:29:14 +00:00
|
|
|
<% } else { %>
|
2024-11-15 14:48:12 +00:00
|
|
|
<a href="<%- item.previewUrl %>"
|
|
|
|
<% if (item.downloadUrl) { %>
|
|
|
|
data-download-url="<%- item.downloadUrl %>"
|
|
|
|
<% } %>
|
|
|
|
>
|
2024-10-29 09:29:14 +00:00
|
|
|
<img alt="" src="<%- item.thumbnailUrl %>"/>
|
|
|
|
</a>
|
|
|
|
<% }
|
|
|
|
}) %>
|
2024-10-28 19:47:14 +00:00
|
|
|
</div>
|
2024-11-17 15:26:40 +00:00
|
|
|
<script src="/share/static/web.js"></script>
|
|
|
|
<script src="/share/static/lg/lightgallery.min.js"></script>
|
|
|
|
<script src="/share/static/lg/lg-fullscreen.min.js"></script>
|
|
|
|
<script src="/share/static/lg/lg-thumbnail.min.js"></script>
|
|
|
|
<script src="/share/static/lg/lg-video.min.js"></script>
|
|
|
|
<script src="/share/static/lg/lg-zoom.min.js"></script>
|
2024-10-28 19:47:14 +00:00
|
|
|
<script type="text/javascript">
|
2024-11-01 14:36:53 +00:00
|
|
|
initLightGallery(<%- JSON.stringify(lgConfig) %>) // initLightGallery imported from web.js
|
2024-10-29 09:29:14 +00:00
|
|
|
<% if (openItem) { %>
|
|
|
|
const openItem = <%- openItem %>
|
|
|
|
const thumbs = document.querySelectorAll('#lightgallery a')
|
|
|
|
if (thumbs.length >= openItem) {
|
|
|
|
thumbs[openItem - 1].click()
|
|
|
|
}
|
|
|
|
<% } %>
|
2024-10-28 19:47:14 +00:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|