Files
Mangarr/templates/manga/index.html.twig
Jérémy Guillot 858a5bed06 Added:
- toolbar and fixes
2024-06-29 14:51:10 +02:00

63 lines
2.6 KiB
Twig

{% extends 'base.html.twig' %}
{% block toolbar %}
{% set left_group %}
<twig:ToolBarButton icon="sync-alt" text="Tout actualiser" action="refresh"/>
<twig:ToolBarButton icon="rss" text="Synchro RSS" action="syncRss"/>
<twig:Divider/>
<twig:ToolBarButton icon="search" text="Rechercher tout" action="search"/>
<twig:ToolBarButton icon="user-plus" text="Importation manuelle" action="import"/>
<twig:Divider/>
<twig:ToolBarButton icon="wrench" text="Modifier Mangas" action="editMangas"/>
{% endset %}
{% set right_group %}
<twig:ToolBarButton icon="th-large" text="Options" action="showOptions"/>
<twig:DropdownMenu
icon="eye"
text="Vue"
items="{{ toolbarItems.viewOptions }}"
/>
<twig:Divider/>
<twig:DropdownMenu
icon="sort"
text="Trier"
items="{{ toolbarItems.sortItems }}"
/>
<twig:DropdownMenu
icon="filter"
text="Filtre"
items="{{ toolbarItems.filterItems }}"
/>
{% endset %}
<twig:Toolbar
left_group="{{ left_group }}"
right_group="{{ right_group }}"
data-action="click@window->toolbar#clickOutside"
/>
{% endblock %}
{% block body %}
<div class="w-full p-4 grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-8 2xl:grid-cols-12 gap-4">
{% for manga in mangas %}
<div
class="bg-white overflow-hidden border border-gray-200 hover:shadow-2xl hover:border-gray-400 transition-all duration-300 flex flex-col">
<a href="{{ path('app_manga_show', { 'mangaSlug': manga.slug }) }}"
class="block relative w-full pb-[150%] overflow-hidden">
<img src="{{ manga.imageUrl ?? 'https://placehold.co/150x220' }}" alt="{{ manga.title }}"
class="absolute top-0 left-0 w-full h-full object-cover">
</a>
<div class="p-2 flex flex-col justify-between flex-grow">
<div>
<h3 class="text-sm font-semibold truncate">{{ manga.title }}</h3>
<p class="text-xs text-gray-500">{{ manga.publicationYear }}</p>
</div>
<p class="text-xs text-gray-400 mt-1">Added: {{ manga.createdAt|date('M d, Y') }}</p>
</div>
</div>
{% else %}
<p class="col-span-full text-center text-gray-500">Aucun manga trouvé.</p>
{% endfor %}
</div>
{% endblock %}