From 0455ab40d927c85b0c72f8b9e4b839352a91cfa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Guillot?= Date: Mon, 10 Jun 2024 15:25:06 +0200 Subject: [PATCH] Fix: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - modal backdrop, pas de backdrop, pas de problème... --- assets/styles/app.scss | 6 +-- migrations/Version20240610115931.php | 53 +++++++++++++++++++ src/Twig/Components/MangaSearch.php | 13 +++-- templates/components/BootstrapModal.html.twig | 3 +- templates/manga/show_chapters.html.twig | 6 +-- 5 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 migrations/Version20240610115931.php diff --git a/assets/styles/app.scss b/assets/styles/app.scss index 8eba4cb..6448108 100644 --- a/assets/styles/app.scss +++ b/assets/styles/app.scss @@ -8,8 +8,8 @@ body { } .modal { + @apply hidden fixed top-0 left-0 w-full h-full outline-none; z-index: 1072!important; - @apply hidden fixed top-0 left-0 w-full h-full outline-none } .modal-dialog { @@ -21,10 +21,10 @@ body { } .modal-backdrop { - z-index: 9!important; + @apply relative bg-black top-0 left-0; + z-index: -1!important; width: 100vw; height: 100vh; - @apply fixed bg-black top-0 left-0 } .modal-backdrop.fade { diff --git a/migrations/Version20240610115931.php b/migrations/Version20240610115931.php new file mode 100644 index 0000000..0a1fd60 --- /dev/null +++ b/migrations/Version20240610115931.php @@ -0,0 +1,53 @@ +addSql('CREATE SEQUENCE content_source_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE content_source (id INT NOT NULL, base_url VARCHAR(255) NOT NULL, image_selector VARCHAR(255) NOT NULL, next_page_selector VARCHAR(255) NOT NULL, chapter_url_format VARCHAR(255) NOT NULL, scraping_type VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('ALTER TABLE chapter ADD volume INT DEFAULT NULL'); + $this->addSql('ALTER TABLE chapter ADD title VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE chapter ADD local_path VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE manga ADD created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL'); + $this->addSql('ALTER TABLE manga ADD rating DOUBLE PRECISION DEFAULT NULL'); + $this->addSql('ALTER TABLE manga ADD author VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE manga ADD external_id VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE manga ADD status VARCHAR(255) DEFAULT NULL'); + $this->addSql('COMMENT ON COLUMN manga.created_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('CREATE UNIQUE INDEX UNIQ_765A9E03989D9B62 ON manga (slug)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('DROP SEQUENCE content_source_id_seq CASCADE'); + $this->addSql('DROP TABLE content_source'); + $this->addSql('DROP INDEX UNIQ_765A9E03989D9B62'); + $this->addSql('ALTER TABLE manga DROP created_at'); + $this->addSql('ALTER TABLE manga DROP rating'); + $this->addSql('ALTER TABLE manga DROP author'); + $this->addSql('ALTER TABLE manga DROP external_id'); + $this->addSql('ALTER TABLE manga DROP status'); + $this->addSql('ALTER TABLE chapter DROP volume'); + $this->addSql('ALTER TABLE chapter DROP title'); + $this->addSql('ALTER TABLE chapter DROP local_path'); + } +} diff --git a/src/Twig/Components/MangaSearch.php b/src/Twig/Components/MangaSearch.php index cfd1ae1..ee24e46 100644 --- a/src/Twig/Components/MangaSearch.php +++ b/src/Twig/Components/MangaSearch.php @@ -2,6 +2,7 @@ namespace App\Twig\Components; +use App\Repository\MangaRepository; use App\Service\MangadexProvider; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; @@ -20,7 +21,7 @@ class MangaSearch #[LiveProp(writable: true)] public ?string $query = null; - public function __construct(private readonly MangadexProvider $mangadexProvider) + public function __construct(private readonly MangadexProvider $mangadexProvider, private MangaRepository $mangaRepository) { } @@ -29,10 +30,12 @@ class MangaSearch */ public function getMangas(): Collection|null { - if ($this->query === null || $this->query === '') { - return null; - } + return new ArrayCollection($this->mangaRepository->findAll()); - return $this->mangadexProvider->search($this->query); +// if ($this->query === null || $this->query === '') { +// return null; +// } +// +// return $this->mangadexProvider->search($this->query); } } diff --git a/templates/components/BootstrapModal.html.twig b/templates/components/BootstrapModal.html.twig index e99311d..7f0976e 100644 --- a/templates/components/BootstrapModal.html.twig +++ b/templates/components/BootstrapModal.html.twig @@ -5,9 +5,10 @@ id: id ? id : false, }) }} data-controller="bootstrap-modal" + data-bs-backdrop="false" >