Galerie: modernes Raster-Layout und Upload-Bereich
- responsives 4:3-Raster mit Hover-Zoom, Overlay und weichen Schatten - Lightbox-Gruppierung: Vor-/Zurückblättern innerhalb einer Tour - Leerzustand, Bildzähler und aufgeräumter Kopfbereich - Upload-Karte mit Drag-and-drop, Datei-Vorschau und Größenhinweis - Papierkorb-Ansicht im selben Design mit Wiederherstellen-Button - Assets mit Änderungszeit als Cache-Buster (?v=...)
This commit is contained in:
parent
d8c9ec8ef8
commit
afdb77549a
5 changed files with 750 additions and 53 deletions
|
|
@ -176,3 +176,470 @@ p {
|
|||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* =========================================================
|
||||
Bildergalerie (Tour-Galerie)
|
||||
========================================================= */
|
||||
.gallery-page {
|
||||
--gallery-accent: #4ea1ff;
|
||||
--gallery-radius: 16px;
|
||||
max-width: 1240px;
|
||||
margin: 1.25rem auto 3rem;
|
||||
padding: clamp(1.1rem, 3vw, 2.75rem);
|
||||
color: #e8edf5;
|
||||
background:
|
||||
radial-gradient(1200px 500px at 15% -10%, rgba(78, 161, 255, .16), transparent 60%),
|
||||
linear-gradient(160deg, rgba(13, 17, 23, .94), rgba(13, 17, 23, .84));
|
||||
border: 1px solid rgba(255, 255, 255, .08);
|
||||
border-radius: 24px;
|
||||
box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
|
||||
-webkit-backdrop-filter: blur(6px);
|
||||
backdrop-filter: blur(6px);
|
||||
}
|
||||
|
||||
.gallery-bitmap {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.gallery-back {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: .45rem;
|
||||
margin-bottom: .9rem;
|
||||
color: #a9c0dd;
|
||||
font-size: .9rem;
|
||||
text-decoration: none;
|
||||
transition: color .2s ease;
|
||||
}
|
||||
.gallery-back:hover,
|
||||
.gallery-back:focus {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
.gallery-back svg { flex: 0 0 auto; }
|
||||
|
||||
.gallery-head {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1.75rem;
|
||||
}
|
||||
|
||||
.gallery-eyebrow {
|
||||
margin: 0 0 .35rem;
|
||||
color: #8fb7e8;
|
||||
font-size: .72rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: .22em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.gallery-eyebrow--danger { color: #ff9d9d; }
|
||||
|
||||
.gallery-title {
|
||||
margin: 0;
|
||||
color: #fff;
|
||||
font-size: clamp(1.8rem, 4vw, 2.8rem);
|
||||
font-weight: 800;
|
||||
letter-spacing: -.02em;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.gallery-head-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: .6rem;
|
||||
}
|
||||
|
||||
.gallery-count {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: .45rem;
|
||||
padding: .42rem .9rem;
|
||||
color: #d7e3f4;
|
||||
font-size: .85rem;
|
||||
white-space: nowrap;
|
||||
background: rgba(255, 255, 255, .08);
|
||||
border: 1px solid rgba(255, 255, 255, .12);
|
||||
border-radius: 999px;
|
||||
}
|
||||
.gallery-count svg { opacity: .75; }
|
||||
|
||||
.gallery-manage-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: .42rem .9rem;
|
||||
color: #ffb4b4;
|
||||
font-size: .85rem;
|
||||
text-decoration: none;
|
||||
background: rgba(229, 72, 77, .12);
|
||||
border: 1px solid rgba(229, 72, 77, .35);
|
||||
border-radius: 999px;
|
||||
transition: background .2s ease, color .2s ease;
|
||||
}
|
||||
.gallery-manage-link:hover,
|
||||
.gallery-manage-link:focus {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
background: rgba(229, 72, 77, .85);
|
||||
}
|
||||
|
||||
.gallery-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.gallery-item {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
aspect-ratio: 4 / 3;
|
||||
overflow: hidden;
|
||||
background: #0d1117;
|
||||
border-radius: var(--gallery-radius);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
|
||||
animation: gallery-in .5s both;
|
||||
animation-delay: calc(var(--i, 0) * 35ms);
|
||||
}
|
||||
|
||||
@keyframes gallery-in {
|
||||
from { opacity: 0; transform: translateY(12px); }
|
||||
to { opacity: 1; transform: none; }
|
||||
}
|
||||
|
||||
.gallery-item-link {
|
||||
position: relative;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.gallery-item-link:focus {
|
||||
outline: 2px solid var(--gallery-accent);
|
||||
outline-offset: -3px;
|
||||
}
|
||||
|
||||
.gallery-item img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transform: scale(1.001);
|
||||
transition: transform .6s cubic-bezier(.2, .7, .3, 1), filter .4s ease;
|
||||
}
|
||||
|
||||
.gallery-item:hover img,
|
||||
.gallery-item:focus-within img {
|
||||
transform: scale(1.06);
|
||||
filter: brightness(.82);
|
||||
}
|
||||
|
||||
.gallery-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 14px;
|
||||
background: linear-gradient(to top, rgba(0, 0, 0, .58), rgba(0, 0, 0, .04) 60%);
|
||||
opacity: 0;
|
||||
transition: opacity .35s ease;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.gallery-item:hover .gallery-overlay,
|
||||
.gallery-item:focus-within .gallery-overlay {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.gallery-zoom {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, .14);
|
||||
border: 1px solid rgba(255, 255, 255, .55);
|
||||
border-radius: 50%;
|
||||
transform: translateY(8px);
|
||||
transition: transform .35s ease, background .2s ease;
|
||||
-webkit-backdrop-filter: blur(2px);
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.gallery-item:hover .gallery-zoom {
|
||||
transform: none;
|
||||
background: rgba(255, 255, 255, .24);
|
||||
}
|
||||
|
||||
.gallery-delete {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
z-index: 2;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.gallery-delete button {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
padding: 0;
|
||||
color: #ffb4b4;
|
||||
font-size: 19px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
background: rgba(10, 12, 16, .68);
|
||||
border: 1px solid rgba(255, 255, 255, .35);
|
||||
border-radius: 50%;
|
||||
transition: background .2s ease, color .2s ease, transform .2s ease;
|
||||
}
|
||||
.gallery-delete button:hover,
|
||||
.gallery-delete button:focus {
|
||||
color: #fff;
|
||||
background: #e5484d;
|
||||
transform: scale(1.06);
|
||||
}
|
||||
|
||||
.gallery-badge {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
z-index: 2;
|
||||
padding: .2rem .55rem;
|
||||
color: #ffd7d7;
|
||||
font-size: .68rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: .08em;
|
||||
text-transform: uppercase;
|
||||
background: rgba(229, 72, 77, .82);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.gallery-restore {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
z-index: 2;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.gallery-restore button {
|
||||
width: 100%;
|
||||
padding: .4rem .6rem;
|
||||
color: #d8ffe4;
|
||||
font-size: .82rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
background: rgba(18, 120, 64, .82);
|
||||
border: 1px solid rgba(255, 255, 255, .3);
|
||||
border-radius: 9px;
|
||||
transition: background .2s ease, color .2s ease;
|
||||
}
|
||||
.gallery-restore button:hover,
|
||||
.gallery-restore button:focus {
|
||||
color: #fff;
|
||||
background: #15803d;
|
||||
}
|
||||
|
||||
.gallery-empty {
|
||||
padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
|
||||
color: #9fb0c7;
|
||||
text-align: center;
|
||||
background: rgba(255, 255, 255, .02);
|
||||
border: 1px dashed rgba(255, 255, 255, .22);
|
||||
border-radius: 20px;
|
||||
}
|
||||
.gallery-empty svg { margin-bottom: 1rem; opacity: .55; }
|
||||
.gallery-empty-title {
|
||||
margin: 0 0 .35rem;
|
||||
color: #e8edf5;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
.gallery-empty-text { margin: 0; font-size: .92rem; }
|
||||
|
||||
.gallery-upload {
|
||||
margin-top: 2.5rem;
|
||||
padding: clamp(1.25rem, 3vw, 2rem);
|
||||
color: #1f2937;
|
||||
background: rgba(255, 255, 255, .97);
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
|
||||
}
|
||||
|
||||
.gallery-upload h2 {
|
||||
margin: 0;
|
||||
color: #111827;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
.gallery-upload p {
|
||||
margin: .3rem 0 0;
|
||||
color: #6b7280;
|
||||
font-size: .9rem;
|
||||
}
|
||||
|
||||
.gallery-drop {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: .3rem;
|
||||
margin: 1.25rem 0 0;
|
||||
padding: 1.9rem 1rem;
|
||||
color: #475569;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
background: #f8fafc;
|
||||
border: 2px dashed #cbd5e1;
|
||||
border-radius: 16px;
|
||||
transition: border-color .2s ease, background .2s ease, color .2s ease;
|
||||
}
|
||||
.gallery-drop:hover,
|
||||
.gallery-drop:focus-within,
|
||||
.gallery-drop.is-dragover {
|
||||
color: #1d4ed8;
|
||||
background: #eff6ff;
|
||||
border-color: #3b82f6;
|
||||
}
|
||||
.gallery-drop svg { opacity: .8; }
|
||||
.gallery-drop-title { font-weight: 600; color: #1e293b; }
|
||||
.gallery-drop-hint { font-size: .85rem; color: #64748b; }
|
||||
|
||||
.gallery-file-input {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.gallery-preview { margin-top: 1rem; }
|
||||
.gallery-preview-count {
|
||||
margin: 0 0 .55rem;
|
||||
color: #334155;
|
||||
font-size: .85rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
.gallery-preview-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
|
||||
gap: 8px;
|
||||
}
|
||||
.gallery-preview-item {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
aspect-ratio: 1 / 1;
|
||||
overflow: hidden;
|
||||
background: #e2e8f0;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.gallery-preview-item img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
.gallery-preview-more {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
color: #475569;
|
||||
font-size: .8rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.gallery-upload-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 1.1rem;
|
||||
}
|
||||
|
||||
.gallery-btn {
|
||||
padding: .55rem 1.4rem;
|
||||
font-weight: 600;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
@media (max-width: 575.98px) {
|
||||
.gallery-page {
|
||||
margin: .5rem .35rem 2rem;
|
||||
padding: 1rem;
|
||||
border-radius: 18px;
|
||||
}
|
||||
.gallery-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
.gallery-head { margin-bottom: 1.25rem; }
|
||||
.gallery-head-meta { gap: .4rem; }
|
||||
.gallery-upload { margin-top: 1.5rem; }
|
||||
}
|
||||
|
||||
@media (hover: none) {
|
||||
.gallery-overlay {
|
||||
opacity: .9;
|
||||
background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent 55%);
|
||||
}
|
||||
.gallery-zoom {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
transform: none;
|
||||
opacity: .9;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.gallery-item,
|
||||
.gallery-item img,
|
||||
.gallery-overlay,
|
||||
.gallery-zoom {
|
||||
animation: none !important;
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Papierkorb-Variante der Galerie */
|
||||
.gallery-page--deleted {
|
||||
background:
|
||||
radial-gradient(1200px 500px at 15% -10%, rgba(229, 72, 77, .16), transparent 60%),
|
||||
linear-gradient(160deg, rgba(13, 17, 23, .94), rgba(13, 17, 23, .84));
|
||||
}
|
||||
.gallery-page--deleted .gallery-item img {
|
||||
filter: grayscale(.35) brightness(.85);
|
||||
}
|
||||
.gallery-page--deleted .gallery-item:hover img,
|
||||
.gallery-page--deleted .gallery-item:focus-within img {
|
||||
filter: none;
|
||||
}
|
||||
|
||||
/* Upload-Button in der Galerie */
|
||||
.gallery-btn,
|
||||
.gallery-btn:focus {
|
||||
color: #fff;
|
||||
background-color: #2f6fdb;
|
||||
border-color: #2f6fdb;
|
||||
box-shadow: 0 8px 20px rgba(47, 111, 219, .35);
|
||||
}
|
||||
.gallery-btn:hover {
|
||||
color: #fff;
|
||||
background-color: #1d5bc4;
|
||||
border-color: #1d5bc4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,6 +289,15 @@ function asset(string $path): string
|
|||
return '/' . ltrim($path, '/');
|
||||
}
|
||||
|
||||
/** Asset-Pfad mit Änderungszeit als Cache-Buster (z. B. /css/app.css?v=123). */
|
||||
function asset_versioned(string $path): string
|
||||
{
|
||||
$file = public_path($path);
|
||||
$version = is_file($file) ? filemtime($file) : false;
|
||||
|
||||
return asset($path) . ($version !== false ? '?v=' . $version : '');
|
||||
}
|
||||
|
||||
/** Aktueller Anfrage-Pfad (ohne Query-String). */
|
||||
function current_path(): string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@
|
|||
<title><?= e(config('app.name')) ?></title>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="<?= e(asset('js/app.js')) ?>" defer></script>
|
||||
<script src="<?= e(asset_versioned('js/app.js')) ?>" defer></script>
|
||||
|
||||
<!-- Styles -->
|
||||
<link href="<?= e(asset('css/app.css')) ?>" rel="stylesheet">
|
||||
<link href="<?= e(asset('css/custom.css')) ?>" rel="stylesheet">
|
||||
<link href="<?= e(asset('css/lightbox.css')) ?>" rel="stylesheet">
|
||||
<link href="<?= e(asset('css/lightbox_manuell.css')) ?>" rel="stylesheet">
|
||||
<link href="<?= e(asset_versioned('css/app.css')) ?>" rel="stylesheet">
|
||||
<link href="<?= e(asset_versioned('css/custom.css')) ?>" rel="stylesheet">
|
||||
<link href="<?= e(asset_versioned('css/lightbox.css')) ?>" rel="stylesheet">
|
||||
<link href="<?= e(asset_versioned('css/lightbox_manuell.css')) ?>" rel="stylesheet">
|
||||
<!-- Font -->
|
||||
<link href="<?= e(asset('fonts/vendor/google/nunito.css')) ?>" rel="stylesheet">
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,40 @@
|
|||
$flashError = flash_pull('error');
|
||||
$uploadReady = $upload_ready ?? true;
|
||||
$uploadLimit = $upload_limit ?? ini_get('upload_max_filesize');
|
||||
$imageCount = count($imagelist);
|
||||
$lightboxGroup = 'tour-galerie-' . $tour_id;
|
||||
?>
|
||||
|
||||
<div class="container-fluid text-center text-light mt-5">
|
||||
<h1><?= e($tour_name) ?></h1>
|
||||
<div class="gallery-page">
|
||||
<a class="gallery-back" href="/tour/<?= e($tour_id) ?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M19 12H5"/><path d="m12 19-7-7 7-7"/>
|
||||
</svg>
|
||||
Zurück zur Tour
|
||||
</a>
|
||||
|
||||
<header class="gallery-head">
|
||||
<div>
|
||||
<p class="gallery-eyebrow">Bildergalerie</p>
|
||||
<h1 class="gallery-title"><?= e($tour_name) ?></h1>
|
||||
</div>
|
||||
|
||||
<div class="gallery-head-meta">
|
||||
<span class="gallery-count">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="9" cy="9" r="2"/>
|
||||
<path d="m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21"/>
|
||||
</svg>
|
||||
<?= $imageCount === 1 ? '1 Bild' : $imageCount . ' Bilder' ?>
|
||||
</span>
|
||||
|
||||
<?php if ($current && $current->isAdmin()): ?>
|
||||
<a class="gallery-manage-link" href="/tour/gallery/<?= e($tour_id) ?>/show_deleted">Gelöschte Bilder</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?php if ($flashStatus !== null): ?>
|
||||
<div class="alert alert-success" role="alert"><?= e($flashStatus) ?></div>
|
||||
|
|
@ -24,39 +54,177 @@
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="col-12 text-primary d-flex">
|
||||
<ul class="list-group col-12" style="display:inline">
|
||||
<?php foreach ($imagelist as $img_tpl): ?>
|
||||
<label>
|
||||
<a title="<?= e($img_tpl[1]) ?>" style="display: inline;" href="/img_storage/tour-<?= e($tour_id) ?>/<?= e($img_tpl[0]) ?>_gross.jpg" data-lightbox="/img_storage/tour-<?= e($tour_id) ?>/<?= e($img_tpl[0]) ?>_gross.jpg" data-title="<?= e($img_tpl[1]) ?>">
|
||||
<img class="mt-3 ml-3" src="/img_storage/tour-<?= e($tour_id) ?>/<?= e($img_tpl[0]) ?>.jpg">
|
||||
<?php if ($imageCount === 0): ?>
|
||||
<div class="gallery-empty">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="9" cy="9" r="2"/>
|
||||
<path d="m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21"/>
|
||||
</svg>
|
||||
<p class="gallery-empty-title">Noch keine Bilder</p>
|
||||
<p class="gallery-empty-text">Lade das erste Foto dieser Tour hoch.</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="gallery-grid">
|
||||
<?php foreach ($imagelist as $i => $img): ?>
|
||||
<?php $caption = $tour_name . ' – Bild ' . ($i + 1); ?>
|
||||
<figure class="gallery-item" style="--i:<?= $i % 20 ?>">
|
||||
<a class="gallery-item-link"
|
||||
href="/img_storage/tour-<?= e($tour_id) ?>/<?= e($img[0]) ?>_gross.jpg"
|
||||
data-lightbox="<?= e($lightboxGroup) ?>"
|
||||
data-title="<?= e($caption) ?>">
|
||||
<img src="/img_storage/tour-<?= e($tour_id) ?>/<?= e($img[0]) ?>.jpg"
|
||||
alt="<?= e($caption) ?>"
|
||||
loading="lazy" decoding="async" width="256" height="192">
|
||||
<span class="gallery-overlay" aria-hidden="true">
|
||||
<span class="gallery-zoom">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"
|
||||
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/>
|
||||
<path d="M11 8v6"/><path d="M8 11h6"/>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<?php if ($current && $current->isAdmin()): ?>
|
||||
<div>
|
||||
<form action="/tour/gallery/<?= e($tour_id) ?>/delete_image/<?= e($img_tpl[0]) ?>.jpg" method="POST" style="display:inline;">
|
||||
<?= csrf_field() ?>
|
||||
<button type="submit" style="color:red;border:none;background:none;padding:0;cursor:pointer;" data-toggle="tooltip" title="Löschen">X</button>
|
||||
</form>
|
||||
</div>
|
||||
<form class="gallery-delete"
|
||||
action="/tour/gallery/<?= e($tour_id) ?>/delete_image/<?= e($img[0]) ?>.jpg"
|
||||
method="POST">
|
||||
<?= csrf_field() ?>
|
||||
<button type="submit" title="Bild löschen" aria-label="Bild löschen">×</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</label>
|
||||
</figure>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<h1 style="color:white;">Hochladen</h1>
|
||||
<form style="background-color: #fff;" class="text-dark" method="post" action="/tour/gallery/<?= e($tour_id) ?>" enctype="multipart/form-data">
|
||||
<?= csrf_field() ?>
|
||||
<input type="file" id="myFile" name="files[]" accept="image/jpeg,image/png,image/gif,image/webp" multiple>
|
||||
<input type="submit" value="Hochladen">
|
||||
<p class="mt-2 mb-2" style="font-size:14px;">
|
||||
JPG, PNG, GIF oder WebP – maximal <?= e($uploadLimit) ?> pro Bild.
|
||||
<section class="gallery-upload" aria-labelledby="gallery-upload-title">
|
||||
<h2 id="gallery-upload-title">Bilder hochladen</h2>
|
||||
<p>
|
||||
JPG, PNG, GIF oder WebP · bis zu <?= e($uploadLimit) ?> pro Bild.<br>
|
||||
HEIC/HEIF (iPhone) bitte vorher als JPG exportieren.
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<?php if ($current && $current->isAdmin()): ?>
|
||||
<a style="color:red; font-size:40px;" href="/tour/gallery/<?= e($tour_id) ?>/show_deleted">Gelöschte Bilder</a>
|
||||
<?php endif; ?>
|
||||
<form method="post" action="/tour/gallery/<?= e($tour_id) ?>" enctype="multipart/form-data">
|
||||
<?= csrf_field() ?>
|
||||
|
||||
<label class="gallery-drop" id="galleryDrop" for="myFile">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
||||
<path d="m17 8-5-5-5 5"/><path d="M12 3v12"/>
|
||||
</svg>
|
||||
<span class="gallery-drop-title">Bilder auswählen</span>
|
||||
<span class="gallery-drop-hint">oder hierher ziehen</span>
|
||||
<input class="gallery-file-input" type="file" id="myFile" name="files[]"
|
||||
accept="image/jpeg,image/png,image/gif,image/webp" multiple>
|
||||
</label>
|
||||
|
||||
<div class="gallery-preview" id="galleryPreview" aria-live="polite"></div>
|
||||
|
||||
<div class="gallery-upload-actions">
|
||||
<button type="submit" class="btn btn-primary gallery-btn">Jetzt hochladen</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var drop = document.getElementById('galleryDrop');
|
||||
var input = document.getElementById('myFile');
|
||||
var preview = document.getElementById('galleryPreview');
|
||||
|
||||
if (!drop || !input || !preview) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Verhindert, dass ein versehentlich daneben abgelegtes Bild den
|
||||
// Browser dazu bringt, die Datei direkt zu öffnen.
|
||||
['dragover', 'drop'].forEach(function (eventName) {
|
||||
document.addEventListener(eventName, function (event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
var maxPreview = 12;
|
||||
|
||||
function renderPreview() {
|
||||
preview.innerHTML = '';
|
||||
|
||||
var files = Array.prototype.slice.call(input.files || []);
|
||||
if (files.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var count = document.createElement('p');
|
||||
count.className = 'gallery-preview-count';
|
||||
count.textContent = files.length === 1 ? '1 Bild ausgewählt' : files.length + ' Bilder ausgewählt';
|
||||
preview.appendChild(count);
|
||||
|
||||
var grid = document.createElement('div');
|
||||
grid.className = 'gallery-preview-grid';
|
||||
|
||||
files.slice(0, maxPreview).forEach(function (file) {
|
||||
if (!file.type || file.type.indexOf('image/') !== 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var figure = document.createElement('figure');
|
||||
figure.className = 'gallery-preview-item';
|
||||
|
||||
var img = document.createElement('img');
|
||||
img.alt = file.name;
|
||||
var url = URL.createObjectURL(file);
|
||||
img.src = url;
|
||||
img.onload = function () { URL.revokeObjectURL(url); };
|
||||
|
||||
figure.appendChild(img);
|
||||
grid.appendChild(figure);
|
||||
});
|
||||
|
||||
if (files.length > maxPreview) {
|
||||
var more = document.createElement('figure');
|
||||
more.className = 'gallery-preview-item gallery-preview-more';
|
||||
more.textContent = '+' + (files.length - maxPreview);
|
||||
grid.appendChild(more);
|
||||
}
|
||||
|
||||
preview.appendChild(grid);
|
||||
}
|
||||
|
||||
input.addEventListener('change', renderPreview);
|
||||
|
||||
['dragenter', 'dragover'].forEach(function (eventName) {
|
||||
drop.addEventListener(eventName, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
drop.classList.add('is-dragover');
|
||||
});
|
||||
});
|
||||
|
||||
['dragleave', 'drop'].forEach(function (eventName) {
|
||||
drop.addEventListener(eventName, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
drop.classList.remove('is-dragover');
|
||||
});
|
||||
});
|
||||
|
||||
drop.addEventListener('drop', function (event) {
|
||||
if (!event.dataTransfer || !event.dataTransfer.files || event.dataTransfer.files.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
input.files = event.dataTransfer.files;
|
||||
renderPreview();
|
||||
} catch (e) {
|
||||
// Ältere Browser: nativen Datei-Dialog verwenden.
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,25 +1,78 @@
|
|||
<div class="container text-center text-light mt-5">
|
||||
<h1><?= e($tour_name) ?></h1>
|
||||
<h1 style="color:red">Gelöschte Bilder</h1>
|
||||
<?php
|
||||
$imageCount = count($imagelist);
|
||||
$lightboxGroup = 'tour-galerie-' . $tour_id . '-geloescht';
|
||||
?>
|
||||
|
||||
<div class="container text-primary" style="display:flex">
|
||||
<ul class="list-group offset-2 col-8" style="display:flex; flex-direction: row;">
|
||||
<?php foreach ($imagelist as $img_tpl): ?>
|
||||
<label style="display:flex; flex-direction: column;">
|
||||
<a title="<?= e($img_tpl[1]) ?>" style="display: inline;" href="/img_storage/tour-<?= e($tour_id) ?>-DELETED/<?= e($img_tpl[0]) ?>_gross.jpg" data-lightbox="/img_storage/tour-<?= e($tour_id) ?>/<?= e($img_tpl[0]) ?>_gross.jpg" data-title="<?= e($img_tpl[1]) ?>">
|
||||
<img class="mt-3 ml-3" src="/img_storage/tour-<?= e($tour_id) ?>-DELETED/<?= e($img_tpl[0]) ?>.jpg">
|
||||
<div class="gallery-page gallery-page--deleted">
|
||||
<a class="gallery-back" href="/tour/gallery/<?= e($tour_id) ?>">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M19 12H5"/><path d="m12 19-7-7 7-7"/>
|
||||
</svg>
|
||||
Zurück zur Galerie
|
||||
</a>
|
||||
|
||||
<header class="gallery-head">
|
||||
<div>
|
||||
<p class="gallery-eyebrow gallery-eyebrow--danger">Papierkorb</p>
|
||||
<h1 class="gallery-title"><?= e($tour_name) ?></h1>
|
||||
</div>
|
||||
|
||||
<div class="gallery-head-meta">
|
||||
<span class="gallery-count">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M3 6h18"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
|
||||
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/><path d="M10 11v6"/><path d="M14 11v6"/>
|
||||
</svg>
|
||||
<?= $imageCount === 1 ? '1 Bild' : $imageCount . ' Bilder' ?>
|
||||
</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<?php if ($imageCount === 0): ?>
|
||||
<div class="gallery-empty">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="56" height="56" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<path d="M3 6h18"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
|
||||
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/>
|
||||
</svg>
|
||||
<p class="gallery-empty-title">Der Papierkorb ist leer</p>
|
||||
<p class="gallery-empty-text">Gelöschte Bilder dieser Tour erscheinen hier.</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="gallery-grid">
|
||||
<?php foreach ($imagelist as $i => $img): ?>
|
||||
<?php $caption = $tour_name . ' – Bild ' . ($i + 1); ?>
|
||||
<figure class="gallery-item" style="--i:<?= $i % 20 ?>">
|
||||
<a class="gallery-item-link"
|
||||
href="/img_storage/tour-<?= e($tour_id) ?>-DELETED/<?= e($img[0]) ?>_gross.jpg"
|
||||
data-lightbox="<?= e($lightboxGroup) ?>"
|
||||
data-title="<?= e($caption) ?> (gelöscht)">
|
||||
<img src="/img_storage/tour-<?= e($tour_id) ?>-DELETED/<?= e($img[0]) ?>.jpg"
|
||||
alt="<?= e($caption) ?>, gelöscht"
|
||||
loading="lazy" decoding="async" width="256" height="192">
|
||||
<span class="gallery-badge">Gelöscht</span>
|
||||
<span class="gallery-overlay" aria-hidden="true">
|
||||
<span class="gallery-zoom">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"
|
||||
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||
stroke-linejoin="round">
|
||||
<circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/>
|
||||
<path d="M11 8v6"/><path d="M8 11h6"/>
|
||||
</svg>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<div>
|
||||
<form action="/tour/gallery/<?= e($tour_id) ?>/restore_image/<?= e($img_tpl[0]) ?>.jpg" method="POST" style="display:inline;">
|
||||
<?= csrf_field() ?>
|
||||
<button type="submit" style="color:red;border:none;background:none;padding:0;cursor:pointer;" data-toggle="tooltip" title="Wiederherstellen">Wiederherstellen</button>
|
||||
</form>
|
||||
</div>
|
||||
</label>
|
||||
<form class="gallery-restore"
|
||||
action="/tour/gallery/<?= e($tour_id) ?>/restore_image/<?= e($img[0]) ?>.jpg"
|
||||
method="POST">
|
||||
<?= csrf_field() ?>
|
||||
<button type="submit">Wiederherstellen</button>
|
||||
</form>
|
||||
</figure>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<a style="color:green; font-size:40px;" href="/tour/gallery/<?= e($tour_id) ?>">Zurück</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue