82 lines
5.3 KiB
Twig
82 lines
5.3 KiB
Twig
{% extends 'base.html.twig' %}
|
|
|
|
{% block body %}
|
|
<div class="container mx-auto p-4">
|
|
<h1 class="text-2xl font-bold mb-6">Correspondances trouvées :</h1>
|
|
|
|
{% if mangas %}
|
|
{% for manga in mangas %}
|
|
<div class="bg-white shadow-lg rounded-lg overflow-hidden mb-8">
|
|
<div class="flex bg-gray-100 p-4">
|
|
<div class="flex-none w-48">
|
|
<img src="{{ manga.imageUrl ?? 'https://placehold.co/150x220' }}" alt="{{ manga.title }}"
|
|
class="w-full h-full object-cover rounded" style="width: 150px; height: 220px;">
|
|
</div>
|
|
<div class="flex-grow ml-4">
|
|
<h2 class="text-xl font-bold text-gray-900">{{ manga.title }} <span class="text-gray-500">({{ manga.publicationYear }})</span></h2>
|
|
<div class="mt-2">
|
|
{% for genre in manga.genres %}
|
|
<span class="inline-block bg-gray-200 text-gray-800 text-xs font-semibold mr-2 mb-2 px-2.5 py-0.5 rounded">
|
|
{{ genre }}
|
|
</span>
|
|
{% endfor %}
|
|
</div>
|
|
<p class="text-gray-700 text-sm mt-2">{{ manga.description|truncate(150) }}</p>
|
|
<div class="mt-2">
|
|
<span class="text-gray-600 text-sm">
|
|
<i class="fas fa-star text-yellow-500"></i>
|
|
{{ manga.rating }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if chapters[manga.slug] is iterable %}
|
|
{% for volume, volumeChapters in chapters[manga.slug] %}
|
|
{% set is_first = loop.first %}
|
|
<div data-controller="table">
|
|
<div class="border-t border-gray-200">
|
|
<div class="bg-gray-50 px-4 py-3 flex justify-between items-center cursor-pointer" data-action="click->table#toggle">
|
|
<h3 class="text-lg font-semibold">Volume {{ '%02d'|format(volume) }}</h3>
|
|
<div class="flex items-center">
|
|
<span class="text-gray-600 mr-2">{{ volumeChapters|length }} Chapitres</span>
|
|
<i data-table-target="toggleIcon" class="fas fa-chevron-down"></i>
|
|
</div>
|
|
</div>
|
|
<div data-table-target="body" class="" style="display: none;">
|
|
<table class="min-w-full divide-y divide-gray-200">
|
|
<tbody class="bg-white divide-y divide-gray-200">
|
|
{% for chapter in volumeChapters %}
|
|
<tr>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ chapter.number }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ chapter.title ?? 'Sans titre' }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
|
<form method="post" action="{{ path('import_confirm') }}" class="mt-4 sm:mt-0">
|
|
<input type="hidden" name="manga_slug" value="{{ manga.slug }}">
|
|
<input type="hidden" name="volume" value="{{ volume }}">
|
|
<button type="submit" name="action" value="confirm" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-green-600 text-base font-medium text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500 sm:ml-3 sm:w-auto sm:text-sm">
|
|
Confirmer
|
|
</button>
|
|
<button type="submit" name="action" value="refuse" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm">
|
|
Refuser
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
<p class="text-gray-700">Aucune correspondance trouvée.</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|