mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
xbvr sync
This commit is contained in:
@@ -31,12 +31,12 @@
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- View mode switcher -->
|
||||
<div class="flex gap-1" role="group">
|
||||
<!-- Enhanced View mode switcher -->
|
||||
<div class="flex gap-1 bg-gray-100 rounded-lg p-1" role="group">
|
||||
{% for mode in view_modes %}
|
||||
<a
|
||||
href="?view={{ mode }}&sort={{ sort }}{% if search %}&search={{ search }}{% endif %}{% if pagination.per_page != 24 %}&per_page={{ pagination.per_page }}{% endif %}{% for genre in filters.genres %}&genres[]={{ genre }}{% endfor %}{% for director in filters.directors %}&directors[]={{ director }}{% endfor %}{% for source in filters.sources %}&sources[]={{ source }}{% endfor %}"
|
||||
class="inline-flex items-center px-3 py-2 border border-gray-300 bg-gray-800 text-gray-300 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 {{ view_mode == mode ? 'bg-blue-600 border-blue-500 text-white' : '' }}"
|
||||
href="?view={{ mode }}{% if search %}&search={{ search }}{% endif %}{% if pagination.per_page != 24 %}&per_page={{ pagination.per_page }}{% endif %}{% for genre in filters.genres %}&genres[]={{ genre }}{% endfor %}{% for director in filters.directors %}&directors[]={{ director }}{% endfor %}{% for source in filters.sources %}&sources[]={{ source }}{% endfor %}"
|
||||
class="inline-flex items-center px-3 py-2 text-sm font-medium rounded-md transition-all duration-200 {{ view_mode == mode ? 'bg-white text-blue-600 shadow-sm' : 'text-gray-600 hover:text-gray-900 hover:bg-gray-200' }}"
|
||||
title="{{ mode|title }} View"
|
||||
>
|
||||
{% if mode == 'grid' %}
|
||||
@@ -59,6 +59,40 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Size slider -->
|
||||
<div class="flex items-center gap-2 bg-gray-100 rounded-lg px-3 py-2" x-data="{
|
||||
size: localStorage.getItem('adultCardSize') || 'medium',
|
||||
sizes: {
|
||||
small: { label: 'S', cols: 'grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6', scale: 'scale-90' },
|
||||
medium: { label: 'M', cols: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6', scale: 'scale-100' },
|
||||
large: { label: 'L', cols: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', scale: 'scale-110' },
|
||||
xlarge: { label: 'XL', cols: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3', scale: 'scale-125' }
|
||||
},
|
||||
updateSize(newSize) {
|
||||
this.size = newSize;
|
||||
localStorage.setItem('adultCardSize', newSize);
|
||||
// Dispatch custom event to update grid
|
||||
window.dispatchEvent(new CustomEvent('adultCardSizeChanged', { detail: { sizeKey: newSize, sizeData: this.sizes[newSize] } }));
|
||||
}
|
||||
}" @mounted="updateSize(size)">
|
||||
<svg class="h-4 w-4 text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"/>
|
||||
</svg>
|
||||
<span class="text-xs font-medium text-gray-600 hidden sm:inline mr-1">Size:</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<template x-for="(sizeData, sizeKey) in sizes" :key="sizeKey">
|
||||
<button
|
||||
@click="updateSize(sizeKey)"
|
||||
:class="size === sizeKey ? 'bg-blue-600 text-white shadow-sm' : 'text-gray-600 hover:text-gray-900 hover:bg-gray-200'"
|
||||
class="px-2 py-1 text-xs font-medium rounded transition-all duration-200"
|
||||
:title="'Set card size to ' + sizeKey"
|
||||
>
|
||||
<span x-text="sizeData.label"></span>
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sort dropdown -->
|
||||
<div class="relative" x-data="{ open: false }">
|
||||
<button @click="open = !open" class="inline-flex items-center px-3 py-2 border border-gray-300 rounded-md bg-gray-800 text-gray-300 hover:bg-gray-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
|
||||
@@ -226,256 +260,205 @@
|
||||
|
||||
{% block content %}
|
||||
<!-- Main content area -->
|
||||
<div class="p-6">
|
||||
<!-- Header -->
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-gray-900">Adult Videos</h1>
|
||||
{% if pagination.total_items > 0 %}
|
||||
<div class="text-gray-500 text-sm mt-1">
|
||||
{{ pagination.total_items }} videos
|
||||
{% if search %}
|
||||
matching "{{ search }}"
|
||||
{% endif %}
|
||||
{% if filters.genres or filters.directors or filters.sources %}
|
||||
{% if filters.genres %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800 ml-2">{{ filters.genres|join(', ') }}</span>
|
||||
{% endif %}
|
||||
{% if filters.directors %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 ml-2">{{ filters.directors|join(', ') }}</span>
|
||||
{% endif %}
|
||||
{% if filters.sources %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 ml-2">{{ filters.sources|join(', ') }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div class="min-h-screen bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-50">
|
||||
<div class="p-6">
|
||||
<!-- Header -->
|
||||
<div class="mb-8">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="text-4xl font-bold bg-gradient-to-r from-slate-900 via-blue-900 to-indigo-900 bg-clip-text text-transparent">Adult Videos Library</h1>
|
||||
{% if pagination.total_items > 0 %}
|
||||
<div class="text-slate-600 text-sm mt-2 flex items-center gap-2">
|
||||
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
{{ pagination.total_items }} adult videos from {{ movies|length > 0 ? movies|reduce((carry, movie) => carry + 1, 0) : 0 }} sources
|
||||
{% if search %}
|
||||
<span class="inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
|
||||
<svg class="w-3 h-3 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
|
||||
</svg>
|
||||
"{{ search }}"
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if pagination.total_items > 0 %}
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% if filters.genres %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-gradient-to-r from-blue-500 to-blue-600 text-white shadow-sm">
|
||||
<svg class="w-3 h-3 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a.997.997 0 01-1.414 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/>
|
||||
</svg>
|
||||
{{ filters.genres|join(', ') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if filters.directors %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-gradient-to-r from-purple-500 to-purple-600 text-white shadow-sm">
|
||||
<svg class="w-3 h-3 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
|
||||
</svg>
|
||||
{{ filters.directors|join(', ') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if filters.sources %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-gradient-to-r from-green-500 to-green-600 text-white shadow-sm">
|
||||
<svg class="w-3 h-3 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"/>
|
||||
</svg>
|
||||
{{ filters.sources|join(', ') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if error %}
|
||||
<div class="alert alert-danger mb-4">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="text-muted small">
|
||||
Sorted by: {{ sort_options[sort] }}
|
||||
</div>
|
||||
|
||||
{% if error %}
|
||||
<div class="alert alert-danger mb-4">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="text-muted small">
|
||||
Sorted by: {{ sort_options[sort] }}
|
||||
</div>
|
||||
|
||||
{% if movies is empty %}
|
||||
<div class="text-center py-5">
|
||||
<svg class="mx-auto text-muted mb-3" width="48" height="48" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
<h3 class="h5 fw-medium text-dark">
|
||||
{% if search or filters.genres or filters.directors or filters.sources %}
|
||||
No adult videos found matching your criteria
|
||||
{% else %}
|
||||
No adult videos found
|
||||
<!-- Enhanced empty state -->
|
||||
<div class="flex flex-col items-center justify-center py-16 px-4">
|
||||
<div class="relative mb-8">
|
||||
<!-- Animated background circles -->
|
||||
<div class="absolute inset-0 flex items-center justify-center">
|
||||
<div class="w-32 h-32 bg-gradient-to-br from-blue-100 to-indigo-100 rounded-full animate-pulse"></div>
|
||||
<div class="absolute w-24 h-24 bg-gradient-to-br from-indigo-100 to-purple-100 rounded-full animate-pulse animation-delay-1000"></div>
|
||||
<div class="absolute w-16 h-16 bg-gradient-to-br from-purple-100 to-pink-100 rounded-full animate-pulse animation-delay-2000"></div>
|
||||
</div>
|
||||
|
||||
<!-- Main icon -->
|
||||
<div class="relative bg-white rounded-2xl shadow-xl p-8 border border-gray-100">
|
||||
<svg class="w-20 h-20 text-slate-400 mx-auto" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-center max-w-md">
|
||||
<h3 class="text-2xl font-bold text-gray-900 mb-3">
|
||||
{% if search or filters.genres or filters.directors or filters.sources %}
|
||||
No adult videos found
|
||||
{% else %}
|
||||
Your library is empty
|
||||
{% endif %}
|
||||
</h3>
|
||||
|
||||
<p class="text-slate-600 text-lg mb-8 leading-relaxed">
|
||||
{% if search or filters.genres or filters.directors or filters.sources %}
|
||||
We couldn't find any adult videos matching your current search and filter criteria. Try adjusting your filters or search terms to discover more videos.
|
||||
{% else %}
|
||||
Start building your adult video library by syncing with XBVR or Stash sources. Your videos will appear here once synced.
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<div class="flex flex-col sm:flex-row gap-4 justify-center">
|
||||
{% if search or filters.genres or filters.directors or filters.sources %}
|
||||
<a href="{{ path_for('adult.index') }}"
|
||||
class="inline-flex items-center px-6 py-3 bg-gradient-to-r from-blue-600 to-blue-700 text-white font-semibold rounded-xl hover:from-blue-700 hover:to-blue-800 transition-all duration-200 shadow-lg hover:shadow-xl transform hover:-translate-y-0.5">
|
||||
<svg class="w-5 h-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
|
||||
</svg>
|
||||
Clear Filters
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ path_for('admin.index') }}"
|
||||
class="inline-flex items-center px-6 py-3 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-xl hover:from-indigo-700 hover:to-purple-700 transition-all duration-200 shadow-lg hover:shadow-xl transform hover:-translate-y-0.5">
|
||||
<svg class="w-5 h-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
|
||||
</svg>
|
||||
Setup Sync
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path_for('search.index') }}"
|
||||
class="inline-flex items-center px-6 py-3 bg-white text-gray-700 font-semibold rounded-xl border-2 border-gray-200 hover:border-gray-300 hover:bg-gray-50 transition-all duration-200 shadow-sm hover:shadow-md">
|
||||
<svg class="w-5 h-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
|
||||
</svg>
|
||||
Search All Media
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Additional help text -->
|
||||
{% if not (search or filters.genres or filters.directors or filters.sources) %}
|
||||
<div class="mt-8 p-4 bg-blue-50 rounded-lg border border-blue-200">
|
||||
<div class="flex items-start">
|
||||
<svg class="w-5 h-5 text-blue-600 mt-0.5 mr-3 flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
<div class="text-left">
|
||||
<p class="text-sm font-medium text-blue-900 mb-1">Need help getting started?</p>
|
||||
<p class="text-sm text-blue-700">Check out the XBVR or Stash integration documentation for assistance with syncing your adult video libraries.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<p class="text-muted">
|
||||
{% if search or filters.genres or filters.directors or filters.sources %}
|
||||
Try adjusting your search terms or filters.
|
||||
{% else %}
|
||||
Adult videos will appear here after syncing with XBVR or Stash sources.
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if search or filters.genres or filters.directors or filters.sources %}
|
||||
<a href="{{ path_for('adult.index') }}" class="btn btn-primary mt-3">
|
||||
Clear filters
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<!-- Adult videos content based on view mode -->
|
||||
{% if view_mode == 'list' %}
|
||||
<!-- List view -->
|
||||
<div class="bg-white rounded-lg shadow-md border border-gray-200">
|
||||
<ul class="divide-y divide-gray-200">
|
||||
<!-- Enhanced list view using component -->
|
||||
<div class="bg-white rounded-xl shadow-lg border border-gray-100 overflow-hidden">
|
||||
<ul class="divide-y divide-gray-100">
|
||||
{% for movie in movies %}
|
||||
<li class="px-4 py-3">
|
||||
<div class="flex justify-between items-center">
|
||||
<div class="flex items-center">
|
||||
{% if movie.poster_url %}
|
||||
<img class="rounded mr-3" style="width: 64px; height: 96px; object-fit: contain; background-color: #f8f9fa;" src="{{ movie.poster_url }}" alt="{{ movie.title }}">
|
||||
{% else %}
|
||||
<div class="bg-gray-100 rounded mr-3 flex items-center justify-center" style="width: 64px; height: 96px;">
|
||||
<svg class="text-gray-600" width="32" height="32" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="flex-1">
|
||||
<h3 class="text-sm font-semibold mb-1">
|
||||
<a href="{{ path_for('adult.show', {'id': movie.id}) }}" class="no-underline text-gray-900 hover:text-blue-600">
|
||||
{{ movie.title }}
|
||||
</a>
|
||||
</h3>
|
||||
<div class="flex items-center gap-3 text-sm text-gray-600">
|
||||
{% if movie.release_date %}
|
||||
<span>{{ movie.release_date|date('Y') }}</span>
|
||||
{% endif %}
|
||||
{% if movie.rating %}
|
||||
<span>⭐ {{ movie.rating }}/10</span>
|
||||
{% endif %}
|
||||
{% if movie.runtime_minutes %}
|
||||
<span>{{ (movie.runtime_minutes / 60)|round(1) }}h {{ movie.runtime_minutes % 60 }}m</span>
|
||||
{% endif %}
|
||||
<span>{{ movie.source_name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
{% if movie.watched %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
|
||||
Watched
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if movie.is_favorite %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800">
|
||||
Favorite
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{% include 'components/adult-card.twig' with {'movie': movie, 'view_mode': 'list'} %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% elseif view_mode == 'covers' %}
|
||||
<!-- Enhanced Cover grid view -->
|
||||
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 gap-4">
|
||||
<!-- Enhanced cover grid view using component with dynamic sizing -->
|
||||
<div
|
||||
class="grid gap-6 transition-all duration-300"
|
||||
x-data="{
|
||||
currentSize: localStorage.getItem('adultCardSize') || 'medium',
|
||||
sizeClasses: {
|
||||
small: 'grid-cols-3 sm:grid-cols-4 md:grid-cols-5 lg:grid-cols-6 xl:grid-cols-8',
|
||||
medium: 'grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6',
|
||||
large: 'grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5',
|
||||
xlarge: 'grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4'
|
||||
}
|
||||
}"
|
||||
:class="sizeClasses[currentSize]"
|
||||
x-init="
|
||||
window.addEventListener('adultCardSizeChanged', (e) => {
|
||||
currentSize = e.detail.sizeKey;
|
||||
});
|
||||
// Set initial class
|
||||
$el.classList.add(...sizeClasses[currentSize].split(' '));
|
||||
"
|
||||
>
|
||||
{% for movie in movies %}
|
||||
<div class="group relative bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden hover:shadow-2xl transition-all duration-300 transform hover:-translate-y-1">
|
||||
{% if movie.poster_url %}
|
||||
<div class="relative {{ movie.poster_aspect_ratio ? 'aspect-custom' : 'aspect-[2/3]' }} overflow-hidden">
|
||||
<img src="{{ movie.poster_url }}" alt="{{ movie.title }}" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300">
|
||||
<!-- Overlay with movie info -->
|
||||
<div class="absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300">
|
||||
<div class="absolute bottom-0 left-0 right-0 p-3">
|
||||
{% if movie.rating %}
|
||||
<div class="flex items-center mb-2">
|
||||
<svg class="w-4 h-4 text-yellow-400 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"/>
|
||||
</svg>
|
||||
<span class="text-white text-sm font-medium">{{ movie.rating }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.watched %}
|
||||
<div class="flex items-center mb-1">
|
||||
<svg class="w-3 h-3 text-green-400 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
<span class="text-green-400 text-xs">Watched</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="flex items-center justify-center bg-gradient-to-br from-gray-100 to-gray-200 aspect-[2/3] min-h-[200px]">
|
||||
<svg class="text-gray-400 w-12 h-12" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 4V2a1 1 0 011-1h8a1 1 0 011 1v2h4a1 1 0 010 2h-1v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6H3a1 1 0 010-2h4z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="p-4">
|
||||
<h6 class="text-sm font-bold truncate mb-1" title="{{ movie.title }}">
|
||||
<a href="{{ path_for('adult.show', {'id': movie.id}) }}" class="no-underline text-gray-900 hover:text-blue-600 transition-colors">
|
||||
{{ movie.title }}
|
||||
</a>
|
||||
</h6>
|
||||
{% if movie.release_date %}
|
||||
<p class="text-xs text-gray-600 font-medium">{{ movie.release_date|date('Y') }}</p>
|
||||
{% endif %}
|
||||
{% if movie.genre %}
|
||||
<div class="mt-2">
|
||||
{% for genre in movie.genre|split(',')|slice(0, 2) %}
|
||||
<span class="inline-block bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full font-medium mr-1 mb-1">{{ genre|trim }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% include 'components/adult-card.twig' with {'movie': movie, 'view_mode': 'covers'} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<!-- Default grid view -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-4">
|
||||
<!-- Enhanced grid view using component with dynamic sizing -->
|
||||
<div
|
||||
class="grid gap-6 transition-all duration-300"
|
||||
x-data="{
|
||||
currentSize: localStorage.getItem('adultCardSize') || 'medium',
|
||||
sizeClasses: {
|
||||
small: 'grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6',
|
||||
medium: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6',
|
||||
large: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
xlarge: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3'
|
||||
}
|
||||
}"
|
||||
:class="sizeClasses[currentSize]"
|
||||
x-init="
|
||||
window.addEventListener('adultCardSizeChanged', (e) => {
|
||||
currentSize = e.detail.sizeKey;
|
||||
});
|
||||
// Set initial class
|
||||
$el.classList.add(...sizeClasses[currentSize].split(' '));
|
||||
"
|
||||
>
|
||||
{% for movie in movies %}
|
||||
<div class="bg-white rounded-lg shadow-md border border-gray-200 h-full">
|
||||
<div class="p-4">
|
||||
<div class="flex items-center">
|
||||
<div class="flex-shrink-0">
|
||||
{% if movie.poster_url %}
|
||||
<img class="rounded" style="width: 64px; height: 96px; object-fit: contain; background-color: #f8f9fa;" src="{{ movie.poster_url }}" alt="{{ movie.title }}">
|
||||
{% else %}
|
||||
<div class="bg-gray-100 rounded flex items-center justify-center" style="width: 64px; height: 96px;">
|
||||
<svg class="text-gray-600" width="32" height="32" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="ml-3 flex-1">
|
||||
<h5 class="text-lg font-semibold mb-1">
|
||||
<a href="{{ path_for('adult.show', {'id': movie.id}) }}" class="no-underline text-gray-900 hover:text-blue-600">
|
||||
{{ movie.title }}
|
||||
</a>
|
||||
</h5>
|
||||
<div class="flex items-center gap-2 text-sm text-gray-600 mb-2">
|
||||
{% if movie.release_date %}
|
||||
<span>{{ movie.release_date|date('Y') }}</span>
|
||||
{% endif %}
|
||||
{% if movie.rating %}
|
||||
<span>⭐ {{ movie.rating }}/10</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if movie.source_name %}
|
||||
<p class="text-sm text-gray-600 mb-2">
|
||||
{{ movie.source_name }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if movie.overview %}
|
||||
<div class="mt-3">
|
||||
<p class="text-sm text-gray-600" style="display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;">
|
||||
{{ movie.overview|slice(0, 150) }}{% if movie.overview|length > 150 %}...{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="mt-3 flex justify-between items-center text-sm text-gray-600">
|
||||
{% if movie.runtime_minutes %}
|
||||
<span>{{ (movie.runtime_minutes / 60)|round(1) }}h {{ movie.runtime_minutes % 60 }}m</span>
|
||||
{% endif %}
|
||||
<div class="flex gap-1">
|
||||
{% if movie.watched %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
|
||||
Watched
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if movie.is_favorite %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800">
|
||||
Favorite
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'components/adult-card.twig' with {'movie': movie, 'view_mode': 'grid'} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -485,7 +468,7 @@
|
||||
<div class="flex items-center justify-between mb-6 p-4 bg-gray-50 rounded-lg">
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="text-sm text-gray-700">
|
||||
Showing {{ (pagination.current_page - 1) * pagination.per_page + 1 }} to {{ min(pagination.current_page * pagination.per_page, pagination.total_items) }} of {{ pagination.total_items }} videos
|
||||
Showing {{ (pagination.current_page - 1) * pagination.per_page + 1 }} to {{ min(pagination.current_page * pagination.per_page, pagination.total_items) }} of {{ pagination.total_items }} adult videos
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<label for="per_page_top" class="text-sm font-medium text-gray-700">Show:</label>
|
||||
@@ -597,6 +580,30 @@
|
||||
.select2-selection__choice__remove:hover {
|
||||
color: #f8f9fa !important;
|
||||
}
|
||||
|
||||
/* Animation delays for empty state */
|
||||
.animation-delay-1000 {
|
||||
animation-delay: 1s;
|
||||
}
|
||||
|
||||
.animation-delay-2000 {
|
||||
animation-delay: 2s;
|
||||
}
|
||||
|
||||
/* Line clamping utilities */
|
||||
.line-clamp-2 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.line-clamp-3 {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user