mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
xbvr sync
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
{% extends "layouts/app.twig" %}
|
||||
|
||||
{% block nav_controls %}
|
||||
<!-- Enhanced Search form -->
|
||||
<form method="GET" class="flex gap-3 items-center">
|
||||
<!-- Search form -->
|
||||
<form method="GET" class="flex gap-2">
|
||||
<input type="hidden" name="view" value="{{ view_mode }}">
|
||||
<input type="hidden" name="per_page" value="{{ pagination.per_page }}">
|
||||
{% for genre in filters.genres %}
|
||||
@@ -13,6 +13,7 @@
|
||||
{% endfor %}
|
||||
</form>
|
||||
|
||||
|
||||
<!-- Enhanced View mode switcher -->
|
||||
<div class="flex gap-1 bg-gray-100 rounded-lg p-1" role="group">
|
||||
{% for mode in view_modes %}
|
||||
@@ -40,6 +41,41 @@
|
||||
</a>
|
||||
{% 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('tvshowCardSize') || '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('tvshowCardSize', newSize);
|
||||
// Dispatch custom event to update grid
|
||||
window.dispatchEvent(new CustomEvent('tvshowCardSizeChanged', { 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 gap-1 bg-gray-100 rounded-lg p-1" x-data="{ open: false }">
|
||||
<button @click="open = !open" 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' }}">
|
||||
@@ -52,7 +88,7 @@
|
||||
<div class="py-1">
|
||||
{% for key, label in sort_options %}
|
||||
<a class="flex items-center justify-between px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 {{ sort == key ? 'bg-gray-50' : '' }}"
|
||||
href="?sort={{ key }}&view={{ 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 %}">
|
||||
href="?sort={{ key }}&view={{ 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 year in filters.years %}&years[]={{ year }}{% endfor %}">
|
||||
{{ label }}
|
||||
{% if sort == key %}
|
||||
<svg class="h-4 w-4 text-blue-600" fill="currentColor" viewBox="0 0 16 16">
|
||||
@@ -182,340 +218,197 @@
|
||||
|
||||
{% block content %}
|
||||
<!-- Main content area -->
|
||||
<div class="min-h-screen bg-gradient-to-br from-gray-50 to-gray-100" data-content>
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||
<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 text-gray-900 mb-2">TV Shows</h1>
|
||||
<h1 class="text-4xl font-bold bg-gradient-to-r from-slate-900 via-blue-900 to-indigo-900 bg-clip-text text-transparent">TV Shows Library</h1>
|
||||
{% if pagination.total_items > 0 %}
|
||||
<div class="flex items-center gap-3 text-gray-600">
|
||||
<span class="text-lg">{{ pagination.total_items }} TV shows</span>
|
||||
<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 }} TV shows from {{ tvshows|length > 0 ? tvshows|reduce((carry, tvshow) => carry + 1, 0) : 0 }} sources
|
||||
{% if search %}
|
||||
<span class="text-sm bg-blue-50 text-blue-700 px-3 py-1 rounded-full">matching "{{ search }}"</span>
|
||||
{% endif %}
|
||||
{% if filters.genres %}
|
||||
<span class="text-sm bg-purple-50 text-purple-700 px-3 py-1 rounded-full">{{ filters.genres|join(', ') }}</span>
|
||||
{% endif %}
|
||||
{% if filters.years %}
|
||||
<span class="text-sm bg-green-50 text-green-700 px-3 py-1 rounded-full">{{ filters.years|join(', ') }}</span>
|
||||
<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>
|
||||
<!-- Sort dropdown -->
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="flex items-center gap-2">
|
||||
<label for="sort" class="text-sm font-medium text-gray-700">Sort by:</label>
|
||||
<select id="sort" class="text-sm border border-gray-300 rounded-lg px-3 py-2 bg-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors">
|
||||
<option value="title_asc" {{ sort == 'title_asc' ? 'selected' : '' }}>Title A-Z</option>
|
||||
<option value="title_desc" {{ sort == 'title_desc' ? 'selected' : '' }}>Title Z-A</option>
|
||||
<option value="year_desc" {{ sort == 'year_desc' ? 'selected' : '' }}>Newest First</option>
|
||||
<option value="year_asc" {{ sort == 'year_asc' ? 'selected' : '' }}>Oldest First</option>
|
||||
<option value="rating_desc" {{ sort == 'rating_desc' ? 'selected' : '' }}>Highest Rated</option>
|
||||
<option value="rating_asc" {{ sort == 'rating_asc' ? 'selected' : '' }}>Lowest Rated</option>
|
||||
</select>
|
||||
</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.years %}
|
||||
<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="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
{{ filters.years|join(', ') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if tvshows is empty %}
|
||||
<div class="text-center py-16">
|
||||
<div class="mx-auto w-24 h-24 bg-gradient-to-br from-gray-100 to-gray-200 rounded-full flex items-center justify-center mb-6">
|
||||
<svg class="w-12 h-12 text-gray-400" 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>
|
||||
<!-- 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>
|
||||
<h3 class="text-2xl font-semibold text-gray-900 mb-3">
|
||||
{% if search or filters.genres or filters.years %}
|
||||
No TV shows found matching your criteria
|
||||
{% else %}
|
||||
No TV shows found
|
||||
|
||||
<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.years %}
|
||||
No TV shows 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.years %}
|
||||
We couldn't find any TV shows matching your current search and filter criteria. Try adjusting your filters or search terms to discover more TV shows.
|
||||
{% else %}
|
||||
Start building your TV show library by syncing with Jellyfin, Plex, or other media sources. Your TV shows 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.years %}
|
||||
<a href="{{ path_for('tvshows.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.years) %}
|
||||
<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 Jellyfin or Plex integration documentation for assistance with syncing your TV show libraries.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<p class="text-gray-600 text-lg mb-6 max-w-md mx-auto">
|
||||
{% if search or filters.genres or filters.years %}
|
||||
Try adjusting your search terms or filters to find what you're looking for.
|
||||
{% else %}
|
||||
Start syncing your TV show libraries to see your collection here.
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if search or filters.genres or filters.years %}
|
||||
<a href="{{ path_for('tvshows.index') }}" class="inline-flex items-center px-6 py-3 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">
|
||||
<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>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<!-- TV Shows content based on view mode -->
|
||||
{% if view_mode == 'list' %}
|
||||
<!-- Enhanced List view -->
|
||||
<div class="bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden">
|
||||
<!-- 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 tvshow in tvshows %}
|
||||
<li class="group hover:bg-gray-50 transition-colors duration-200">
|
||||
<div class="px-6 py-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center space-x-4 flex-1">
|
||||
<!-- Poster -->
|
||||
<div class="flex-shrink-0">
|
||||
{% if tvshow.poster_url %}
|
||||
<div class="relative overflow-hidden rounded-lg shadow-sm group-hover:shadow-md transition-shadow duration-200">
|
||||
<img class="w-16 h-24 object-cover transform group-hover:scale-105 transition-transform duration-200" src="/images/{{ tvshow.poster_url }}" alt="{{ tvshow.title }}">
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="w-16 h-24 bg-gradient-to-br from-gray-100 to-gray-200 rounded-lg flex items-center justify-center shadow-sm">
|
||||
<svg class="w-8 h-8 text-gray-400" 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>
|
||||
|
||||
<!-- Content -->
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-start justify-between">
|
||||
<div class="flex-1">
|
||||
<h3 class="text-lg font-semibold text-gray-900 mb-1 group-hover:text-blue-600 transition-colors">
|
||||
<a href="{{ path_for('tvshows.show', {'id': tvshow.id}) }}" class="block truncate">
|
||||
{{ tvshow.title }}
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
<!-- Metadata row -->
|
||||
<div class="flex items-center gap-4 text-sm text-gray-600 mb-2">
|
||||
{% if tvshow.first_air_date %}
|
||||
<div class="flex items-center gap-1">
|
||||
<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="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
<span>{{ tvshow.first_air_date|date('Y') }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if tvshow.rating %}
|
||||
<div class="flex items-center gap-1">
|
||||
<svg class="w-4 h-4 text-yellow-500" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
|
||||
</svg>
|
||||
<span>{{ tvshow.rating }}/10</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if tvshow.number_of_seasons %}
|
||||
<div class="flex items-center gap-1">
|
||||
<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="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/>
|
||||
</svg>
|
||||
<span>{{ tvshow.number_of_seasons }} season{{ tvshow.number_of_seasons > 1 ? 's' : '' }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if tvshow.number_of_episodes %}
|
||||
<div class="flex items-center gap-1">
|
||||
<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>
|
||||
<span>{{ tvshow.number_of_episodes }} episode{{ tvshow.number_of_episodes > 1 ? 's' : '' }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Overview preview -->
|
||||
{% if tvshow.overview %}
|
||||
<p class="text-sm text-gray-600 line-clamp-2 mb-2">
|
||||
{{ tvshow.overview|slice(0, 120) }}{% if tvshow.overview|length > 120 %}...{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<!-- Source -->
|
||||
<div class="flex items-center gap-1 text-xs text-gray-500">
|
||||
<svg class="w-3 h-3" 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>
|
||||
<span>{{ tvshow.source_name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Actions -->
|
||||
<div class="flex items-center gap-3">
|
||||
{% if tvshow.is_favorite %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-red-100 text-red-800 border border-red-200">
|
||||
<svg class="w-3 h-3 mr-1" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
|
||||
</svg>
|
||||
Favorite
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path_for('tvshows.show', {'id': tvshow.id}) }}"
|
||||
class="inline-flex items-center px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors opacity-0 group-hover:opacity-100 transform translate-x-2 group-hover:translate-x-0 transition-all duration-200">
|
||||
View Details
|
||||
<svg class="w-4 h-4 ml-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{% include 'components/tvshow-card.twig' with {'tvshow': tvshow, 'view_mode': 'list'} %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{% elseif view_mode == 'covers' %}
|
||||
<!-- Cover grid view -->
|
||||
<div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 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('tvshowCardSize') || '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('tvshowCardSizeChanged', (e) => {
|
||||
currentSize = e.detail.sizeKey;
|
||||
});
|
||||
// Set initial class
|
||||
$el.classList.add(...sizeClasses[currentSize].split(' '));
|
||||
"
|
||||
>
|
||||
{% for tvshow in tvshows %}
|
||||
<div class="bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden h-full">
|
||||
{% if tvshow.poster_url %}
|
||||
<div class="relative aspect-[2/3] overflow-hidden">
|
||||
<img src="/images/{{ tvshow.poster_url }}" alt="{{ tvshow.title }}" class="w-full h-full object-cover">
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="flex items-center justify-center bg-gray-100 aspect-[2/3] min-h-[200px]">
|
||||
<svg class="text-gray-600" width="48" height="48" 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-3">
|
||||
<h6 class="text-sm font-semibold truncate" title="{{ tvshow.title }}">
|
||||
<a href="{{ path_for('tvshows.show', {'id': tvshow.id}) }}" class="no-underline text-gray-900 hover:text-blue-600">
|
||||
{{ tvshow.title }}
|
||||
</a>
|
||||
</h6>
|
||||
{% if tvshow.first_air_date %}
|
||||
<p class="text-xs text-gray-600 mt-1">{{ tvshow.first_air_date|date('Y') }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% include 'components/tvshow-card.twig' with {'tvshow': tvshow, 'view_mode': 'covers'} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
<!-- Enhanced Default grid view -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-6 gap-6">
|
||||
<!-- Enhanced grid view using component with dynamic sizing -->
|
||||
<div
|
||||
class="grid gap-6 transition-all duration-300"
|
||||
x-data="{
|
||||
currentSize: localStorage.getItem('tvshowCardSize') || '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('tvshowCardSizeChanged', (e) => {
|
||||
currentSize = e.detail.sizeKey;
|
||||
});
|
||||
// Set initial class
|
||||
$el.classList.add(...sizeClasses[currentSize].split(' '));
|
||||
"
|
||||
>
|
||||
{% for tvshow in tvshows %}
|
||||
<div class="group bg-white rounded-xl shadow-lg border border-gray-200 hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1 h-full overflow-hidden">
|
||||
<div class="p-6">
|
||||
<div class="flex items-start space-x-4">
|
||||
<!-- Poster -->
|
||||
<div class="flex-shrink-0">
|
||||
{% if tvshow.poster_url %}
|
||||
<div class="relative overflow-hidden rounded-lg shadow-md group-hover:shadow-lg transition-shadow duration-300">
|
||||
<img class="w-20 h-30 object-cover transform group-hover:scale-105 transition-transform duration-300" src="/images/{{ tvshow.poster_url }}" alt="{{ tvshow.title }}">
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="w-20 h-30 bg-gradient-to-br from-gray-100 to-gray-200 rounded-lg flex items-center justify-center shadow-sm">
|
||||
<svg class="w-8 h-8 text-gray-400" 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>
|
||||
|
||||
<!-- Content -->
|
||||
<div class="flex-1 min-w-0">
|
||||
<h5 class="text-xl font-bold text-gray-900 mb-2 group-hover:text-blue-600 transition-colors line-clamp-2">
|
||||
<a href="{{ path_for('tvshows.show', {'id': tvshow.id}) }}" class="block">
|
||||
{{ tvshow.title }}
|
||||
</a>
|
||||
</h5>
|
||||
|
||||
<!-- Metadata -->
|
||||
<div class="flex items-center gap-3 text-sm text-gray-600 mb-3">
|
||||
{% if tvshow.first_air_date %}
|
||||
<div class="flex items-center gap-1">
|
||||
<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="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
<span>{{ tvshow.first_air_date|date('Y') }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if tvshow.rating %}
|
||||
<div class="flex items-center gap-1">
|
||||
<svg class="w-4 h-4 text-yellow-500" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
|
||||
</svg>
|
||||
<span class="font-medium">{{ tvshow.rating }}/10</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Source -->
|
||||
{% if tvshow.source_name %}
|
||||
<div class="flex items-center gap-1 text-sm text-gray-500 mb-3">
|
||||
<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="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>
|
||||
<span>{{ tvshow.source_name }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Overview -->
|
||||
{% if tvshow.overview %}
|
||||
<div class="mb-4">
|
||||
<p class="text-sm text-gray-600 line-clamp-3 leading-relaxed">
|
||||
{{ tvshow.overview|slice(0, 180) }}{% if tvshow.overview|length > 180 %}...{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Footer -->
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-3 text-sm text-gray-600">
|
||||
{% if tvshow.number_of_seasons %}
|
||||
<span class="flex items-center gap-1">
|
||||
<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="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/>
|
||||
</svg>
|
||||
{{ tvshow.number_of_seasons }} season{{ tvshow.number_of_seasons > 1 ? 's' : '' }}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if tvshow.number_of_episodes %}
|
||||
<span class="flex items-center gap-1">
|
||||
<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>
|
||||
{{ tvshow.number_of_episodes }} episode{{ tvshow.number_of_episodes > 1 ? 's' : '' }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-2">
|
||||
{% if tvshow.is_favorite %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-red-100 text-red-800 border border-red-200">
|
||||
<svg class="w-3 h-3 mr-1" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/>
|
||||
</svg>
|
||||
Favorite
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ path_for('tvshows.show', {'id': tvshow.id}) }}"
|
||||
class="inline-flex items-center px-3 py-2 bg-blue-600 text-white text-sm font-medium rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors opacity-0 group-hover:opacity-100 transform translate-x-2 group-hover:translate-x-0 transition-all duration-200">
|
||||
View
|
||||
<svg class="w-4 h-4 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'components/tvshow-card.twig' with {'tvshow': tvshow, 'view_mode': 'grid'} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -637,6 +530,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