Add video support with unified media display.
All checks were successful
Docker / build (release) Successful in 9s
All checks were successful
Docker / build (release) Successful in 9s
This commit is contained in:
parent
a634cc88bd
commit
f4052a3d99
16 changed files with 700 additions and 224 deletions
|
|
@ -68,6 +68,20 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||
outline-offset: -5px;
|
||||
}
|
||||
|
||||
/* Play button overlay for video thumbnails in the grid */
|
||||
.photo-item[data-video]::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 50%;
|
||||
background: rgba(0, 0, 0, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M6.79 5.093A.5.5 0 0 0 6 5.5v5a.5.5 0 0 0 .79.407l3.5-2.5a.5.5 0 0 0 0-.814l-3.5-2.5z'/%3E%3C/svg%3E") center/32px no-repeat;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Language selector */
|
||||
.lang-select {
|
||||
border: none;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from django.contrib.auth import get_user_model
|
|||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import FileResponse, Http404
|
||||
from django.views.generic import ListView, View
|
||||
from photologue.models import Gallery, Photo
|
||||
from photologue.models import Gallery, Photo, Video
|
||||
|
||||
|
||||
class MediaAccess(View):
|
||||
|
|
@ -29,6 +29,12 @@ class MediaAccess(View):
|
|||
image__startswith=original_dir + '/',
|
||||
galleries__is_public=True,
|
||||
).exists()
|
||||
# Video files and their thumbnails
|
||||
if not allowed:
|
||||
allowed = (
|
||||
Video.objects.filter(file=path, galleries__is_public=True).exists()
|
||||
or Video.objects.filter(thumbnail=path, galleries__is_public=True).exists()
|
||||
)
|
||||
except Exception:
|
||||
return redirect_to_login(request.get_full_path())
|
||||
if not allowed:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue