- trop de trucs d'un coup... je vais faire attention ensuite ^^'
This commit is contained in:
@@ -1,80 +1,6 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% block body %}
|
||||
<div class="container w-full ml-60 p-4">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
|
||||
<div class="relative h-10 w-72 min-w-[200px]">
|
||||
<label for="manga-select"></label>
|
||||
<select id="manga-select"
|
||||
class="peer h-full w-full rounded-[7px] border border-blue-gray-200 border-t-transparent
|
||||
bg-transparent px-3 py-2.5 font-sans text-sm font-normal text-blue-gray-700 outline
|
||||
outline-0 transition-all placeholder-shown:border placeholder-shown:border-blue-gray-200
|
||||
placeholder-shown:border-t-blue-gray-200 empty:!bg-gray-900 focus:border-2
|
||||
focus:border-gray-900 focus:border-t-transparent focus:outline-0 disabled:border-0
|
||||
disabled:bg-blue-gray-50">
|
||||
{% for manga in availableManga %}
|
||||
<option
|
||||
value="{{ path('manga_show', { 'mangaSlug': manga.slug }) }}">{{ manga.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<label
|
||||
class="before:content[' '] after:content[' '] pointer-events-none absolute left-0 -top-1.5 flex
|
||||
h-full w-full select-none text-[11px] font-normal leading-tight text-blue-gray-400
|
||||
transition-all before:pointer-events-none before:mt-[6.5px] before:mr-1 before:box-border
|
||||
before:block before:h-1.5 before:w-2.5 before:rounded-tl-md before:border-t before:border-l
|
||||
before:border-blue-gray-200 before:transition-all after:pointer-events-none after:mt-[6.5px]
|
||||
after:ml-1 after:box-border after:block after:h-1.5 after:w-2.5 after:flex-grow
|
||||
after:rounded-tr-md after:border-t after:border-r after:border-blue-gray-200
|
||||
after:transition-all peer-placeholder-shown:text-sm peer-placeholder-shown:leading-[3.75]
|
||||
peer-placeholder-shown:text-blue-gray-500 peer-placeholder-shown:before:border-transparent
|
||||
peer-placeholder-shown:after:border-transparent peer-focus:text-[11px] peer-focus:leading-tight
|
||||
peer-focus:text-gray-900 peer-focus:before:border-t-2 peer-focus:before:border-l-2
|
||||
peer-focus:before:border-gray-900 peer-focus:after:border-t-2 peer-focus:after:border-r-2
|
||||
peer-focus:after:border-gray-900 peer-disabled:text-transparent
|
||||
peer-disabled:before:border-transparent peer-disabled:after:border-transparent
|
||||
peer-disabled:peer-placeholder-shown:text-blue-gray-500">
|
||||
Select a Manga
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="container w-full p-4">
|
||||
<form>
|
||||
<div class="relative w-full min-w-[200px] h-10">
|
||||
<input
|
||||
class="peer w-full h-full bg-transparent text-blue-gray-700 font-sans font-normal outline outline-0
|
||||
focus:outline-0 disabled:bg-blue-gray-50 disabled:border-0 transition-all placeholder-shown:border
|
||||
placeholder-shown:border-blue-gray-200 placeholder-shown:border-t-blue-gray-200 border focus:border-2
|
||||
border-t-transparent focus:border-t-transparent text-sm px-3 py-2.5 rounded-[7px] border-blue-gray-200
|
||||
focus:border-gray-900" placeholder=" "/>
|
||||
<label class="flex w-full h-full select-none pointer-events-none absolute left-0 font-normal
|
||||
!overflow-visible truncate peer-placeholder-shown:text-blue-gray-500 leading-tight
|
||||
peer-focus:leading-tight peer-disabled:text-transparent peer-disabled:peer-placeholder-shown:text-blue-gray-500
|
||||
transition-all -top-1.5 peer-placeholder-shown:text-sm text-[11px] peer-focus:text-[11px]
|
||||
before:content[' '] before:block before:box-border before:w-2.5 before:h-1.5
|
||||
before:mt-[6.5px] before:mr-1 peer-placeholder-shown:before:border-transparent before:rounded-tl-md
|
||||
before:border-t peer-focus:before:border-t-2 before:border-l peer-focus:before:border-l-2
|
||||
before:pointer-events-none before:transition-all peer-disabled:before:border-transparent after:content[' ']
|
||||
after:block after:flex-grow after:box-border after:w-2.5 after:h-1.5 after:mt-[6.5px] after:ml-1
|
||||
peer-placeholder-shown:after:border-transparent after:rounded-tr-md after:border-t peer-focus:after:border-t-2
|
||||
after:border-r peer-focus:after:border-r-2 after:pointer-events-none after:transition-all peer-disabled:after:border-transparent
|
||||
peer-placeholder-shown:leading-[3.75] text-gray-500 peer-focus:text-gray-900 before:border-blue-gray-200
|
||||
peer-focus:before:!border-gray-900 after:border-blue-gray-200 peer-focus:after:!border-gray-900">
|
||||
Manga
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
<div class="p-4">
|
||||
{{ component('MangaSearch', {query: query}) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
<script>
|
||||
const mangaSelect = document.getElementById('manga-select');
|
||||
mangaSelect.addEventListener('change', () => {
|
||||
const selectedUrl = mangaSelect.options[mangaSelect.selectedIndex].value;
|
||||
window.open(selectedUrl, '_top');
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,16 +1,42 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% block toolbar %}
|
||||
<div class="bg-gray-800 p-3 min-h-14">
|
||||
<div class="flex flex-row items-center justify-between">
|
||||
<div class="flex mr-2 items-center">
|
||||
<twig:ToolBarButton icon="sync-alt" text="Tout actualiser"/>
|
||||
<twig:ToolBarButton icon="rss" text="Synchro RSS"/>
|
||||
<div class="min-h-14 mx-4 border-r opacity-50 border-green-500"></div>
|
||||
<twig:ToolBarButton icon="search" text="Rechercher tout"/>
|
||||
<twig:ToolBarButton icon="user-plus" text="Importation manuelle"/>
|
||||
<div class="min-h-14 mx-4 border-r opacity-50 border-green-500"></div>
|
||||
<twig:ToolBarButton icon="wrench" text="Modifier Mangas"/>
|
||||
</div>
|
||||
<div class="flex mr-2 items-center">
|
||||
<twig:ToolBarButton icon="th-large" text="Options"/>
|
||||
<div class="min-h-14 mx-4 border-r opacity-50 border-green-500"></div>
|
||||
<twig:ToolBarButton icon="eye" text="Vue"/>
|
||||
<twig:ToolBarButton icon="sort" text="Trier"/>
|
||||
<twig:ToolBarButton icon="filter" text="Filtre"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div class="container w-full ml-60 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">
|
||||
<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-gray-300 hover:shadow-2xl hover:border transition-shadow duration-300">
|
||||
<div
|
||||
class="bg-white overflow-hidden border-gray-300 hover:shadow-2xl hover:border transition-shadow duration-300">
|
||||
<a href="{{ path('manga_show', { 'mangaSlug': manga.slug }) }}">
|
||||
<img src="{{ manga.imageUrl ?? 'https://placehold.co/150x220' }}" alt="{{ manga.title }}" class="w-full">
|
||||
{# <img src="https://placehold.co/150x220" alt="{{ manga.title }}" class="w-full">#}
|
||||
<img src="{{ manga.imageUrl ?? 'https://placehold.co/150x220' }}" alt="{{ manga.title }}"
|
||||
class="w-full">
|
||||
</a>
|
||||
<div class="p-4">
|
||||
<p class="text-lg font-semibold">{{ manga.title }}</p>
|
||||
<p class="text-gray-600">Auteur</p>
|
||||
<p class="text-gray-500">Ajouter: Jun 2 2024</p>
|
||||
<div class="flex justify-between text-xl">
|
||||
<span>{{ manga.title }}</span>
|
||||
<span class="text-md text-gray-500 ml-2">({{ manga.publicationYear }})</span>
|
||||
</div>
|
||||
<p class="text-gray-500">Added: {{ manga.createdAt|date('M d, Y') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
@@ -1,64 +1,135 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% block toolbar %}
|
||||
<div class="bg-gray-800 p-3 min-h-14">
|
||||
<div class="flex flex-row items-center justify-between">
|
||||
<div class="flex mr-2 items-center">
|
||||
<twig:ToolBarButton icon="sync-alt" text="Tout actualiser"/>
|
||||
<twig:ToolBarButton icon="search" text="Rechercher le manga"/>
|
||||
<div class="min-h-14 mx-4 border-r opacity-50 border-green-500"></div>
|
||||
<twig:ToolBarButton icon="sitemap" text="Aperçu renommage"/>
|
||||
<twig:ToolBarButton icon="user-plus" text="Importation manuelle"/>
|
||||
<div class="min-h-14 mx-4 border-r opacity-50 border-green-500"></div>
|
||||
<twig:ToolBarButton icon="wrench" text="Éditer"/>
|
||||
<twig:ToolBarButton icon="trash-can" text="Supprimer"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div class="container w-full ml-60 p-4">
|
||||
<h1 class="text-4xl font-bold mb-8">Chapitres de {{ manga.title }}</h1>
|
||||
|
||||
<ul class="list-disc pl-5">
|
||||
{% for chapter in manga.chapters|sort((a, b) => a.number <=> b.number) %}
|
||||
<li class="my-2">
|
||||
<a class="text-blue-600 hover:text-blue-800" href="{{ path('read_chapter_page', { 'mangaSlug': manga.slug, 'chapterNumber': chapter.number, 'pageNumber': 1 }) }}">
|
||||
Chapitre : {{ chapter.number }}
|
||||
</a>
|
||||
<a class="text-blue-600 hover:text-blue-800" href="{{ path('download_chapter', {'mangaSlug': manga.slug, 'chapterNumber': chapter.number}) }}"><i class="fas fa-save"></i></a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li>Aucun chapitre trouvé.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h2 class="text-2xl font-semibold mb-4">Scrapper un chapitre</h2>
|
||||
<form id="scrape-form" action="{{ path('manga_scrape') }}" method="post" class="space-y-4">
|
||||
<input type="hidden" name="mangaSlug" value="{{ manga.slug }}">
|
||||
<div>
|
||||
<label for="chapterNumber" class="block mb-1">Numéro de chapitre :</label>
|
||||
<input type="number" name="chapterNumber" id="chapterNumber" class="border border-gray-300 p-2 rounded">
|
||||
<div class="relative">
|
||||
<div class="shadow-lg text-white">
|
||||
<div class="relative h-96 bg-cover bg-center" style="background-image: url('{{ manga.imageUrl }}')">
|
||||
<div class="absolute inset-0 bg-black opacity-50"></div>
|
||||
<div class="absolute inset-0 flex flex-row justify-center p-4">
|
||||
<div class="hidden mr-12 xl:block 2xl:block">
|
||||
<img src="{{ manga.imageUrl }}" alt="{{ manga.title }}" class="max-w-72 max-h-72 ml-4">
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<div class="flex items-center mb-4">
|
||||
<i class="fas fa-bookmark text-white text-3xl"></i>
|
||||
<h1 class="text-3xl font-bold ml-4">{{ manga.title }}</h1>
|
||||
</div>
|
||||
<div class="flex items-center mb-4">
|
||||
<span class="mr-4">{{ manga.publicationYear }}</span>
|
||||
<span>Chapters: {{ manga.chapters.count }}</span>
|
||||
</div>
|
||||
<div class="flex items-center mb-4">
|
||||
<i class="fas fa-folder text-gray-400 mr-2"></i>
|
||||
<span class="truncate">/media/mangas/{{ manga.title }} ({{ manga.publicationYear }})</span>
|
||||
<span class="ml-auto bg-green-600 py-1 px-2 rounded">{{ manga.status ?? 'Terminé' }}</span>
|
||||
</div>
|
||||
<div class="flex items-center mb-4">
|
||||
{% set genre_count = 0 %}
|
||||
{% for genre in manga.genres %}
|
||||
{% if genre_count < 5 %}
|
||||
<span class="bg-gray-700 py-1 px-2 rounded-sm mr-2">{{ genre }}</span>
|
||||
{% set genre_count = genre_count + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if genre_count == 5 and manga.genres|length > 5 %}
|
||||
<span class="bg-gray-700 py-1 px-2 rounded-sm mr-2">...</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<div class="flex items-center mb-2">
|
||||
<i class="fas fa-heart text-red-500 mr-2"></i>
|
||||
<span>{{ manga.rating|round(2) }}</span>
|
||||
</div>
|
||||
<p>{{ manga.description|truncate(500) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label for="availableChapters" class="block mb-1">Chapitres disponibles :</label>
|
||||
<select id="availableChapters" class="border border-gray-300 p-2 rounded">
|
||||
<option value="" selected disabled>Choisissez un chapitre</option>
|
||||
{% for chapter in availableChapters %}
|
||||
<option value="{{ chapter.number }}">{{ chapter.number }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
<input type="checkbox" name="scrapeFromChapter" id="scrapeFromChapter" class="rounded">
|
||||
<label for="scrapeFromChapter">Depuis ce chapitre :</label>
|
||||
</div>
|
||||
<input type="submit" value="Scrapper" class="button bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-4 rounded">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
<script>
|
||||
document.getElementById('scrape-form').addEventListener('submit', function(event) {
|
||||
const chapterNumberInput = document.getElementById('chapterNumber');
|
||||
const availableChaptersSelect = document.getElementById('availableChapters');
|
||||
if (availableChaptersSelect.value) {
|
||||
chapterNumberInput.value = availableChaptersSelect.value;
|
||||
}
|
||||
});
|
||||
<div class="p-4">
|
||||
{% for volume, chapters in chapters_by_volume %}
|
||||
{% set non_null_chapters = chapters|filter(chapter => chapter.localPath is not null) %}
|
||||
{% set total_chapters = chapters|length %}
|
||||
<div data-controller="table">
|
||||
<div class="bg-white rounded-sm shadow mb-4">
|
||||
<div class="flex items-center justify-between bg-white p-4 rounded-t-sm">
|
||||
<div class="flex flex-row gap-4">
|
||||
<i class="fas fa-bookmark text-gray-500 text-3xl"></i>
|
||||
<h2 class="text-xl font-semibold">Volume {{ volume }}</h2>
|
||||
<div class="flex items-center">
|
||||
<span
|
||||
class="px-2 py-1 text-sm rounded {{ non_null_chapters|length > 0 ? 'bg-green-500 text-white' : 'bg-red-500 text-white' }}">
|
||||
{{ non_null_chapters|length }} / {{ total_chapters }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<span class="text-gray-600 mr-2">{{ chapters|length }} Chapters</span>
|
||||
<i data-action="click->table#collapse" class="fas fa-chevron-down cursor-pointer"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div data-table-target="body" class="p-4 border-t">
|
||||
<table class="min-w-full table-auto">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="px-4 py-2 text-left">#</th>
|
||||
<th class="px-4 py-2 text-left">Title</th>
|
||||
<th class="px-4 py-2 text-right">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for chapter in chapters %}
|
||||
<tr class="border-t hover:bg-green-100">
|
||||
{% if chapter.pages|length > 0 %}
|
||||
<td class="px-4 py-2 text-green-500">
|
||||
<a href="{{ path('read_chapter_page', { mangaSlug: manga.slug, chapterNumber: chapter.number }) }}">
|
||||
{{ chapter.number }}</a>
|
||||
</td>
|
||||
{% else %}
|
||||
<td class="px-4 py-2">{{ chapter.number }}</td>
|
||||
{% endif %}
|
||||
|
||||
document.getElementById('scrapeFromChapter').addEventListener('change', function(event) {
|
||||
const form = document.getElementById('scrape-form');
|
||||
if (event.target.checked) {
|
||||
form.action = "{{ path('manga_scrape_from_chapter') }}";
|
||||
} else {
|
||||
form.action = "{{ path('manga_scrape') }}";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
<td class="px-4 py-2 w-full text-left">
|
||||
{% if chapter.pages|length > 0 %}
|
||||
<a class=""
|
||||
href="{{ path('read_chapter_page', { mangaSlug: manga.slug, chapterNumber: chapter.number }) }}">{{ chapter.title ?? 'No title' }}</a>
|
||||
{% else %}
|
||||
{{ chapter.title ?? 'No title'}}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="px-4 py-2 flex justify-end gap-2">
|
||||
{# <twig:DownloadChapter mangaSlug="{{ manga.slug }}" chapterNumber="{{ chapter.number }}" /> #}
|
||||
<a href="#" class="text-gray-500 hover:text-green-500">
|
||||
<i class="fas fa-download"></i>
|
||||
</a>
|
||||
{# <a href="#" class="text-gray-500 hover:text-green-500"> #}
|
||||
{# <i class="fas fa-trash"></i> #}
|
||||
{# </a> #}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user