From 374780898595b1e79aa6eadb64fdadff98ccf5ba Mon Sep 17 00:00:00 2001 From: Zahdi <ZahdiMohcine20@gmail.com> Date: Sun, 23 Mar 2025 17:06:59 +0100 Subject: [PATCH] [Progress] minor changes --- .env | 3 +- migrations/Version20250319154617.php | 37 ----------------- migrations/Version20250319232441.php | 37 ----------------- migrations/Version20250319235558.php | 35 ---------------- migrations/Version20250319235641.php | 39 ------------------ migrations/Version20250320000820.php | 35 ---------------- migrations/Version20250320000903.php | 35 ---------------- migrations/Version20250320001018.php | 39 ------------------ migrations/Version20250320001428.php | 41 ------------------- migrations/Version20250320001458.php | 37 ----------------- migrations/Version20250320001931.php | 41 ------------------- migrations/Version20250320001951.php | 37 ----------------- migrations/Version20250320002407.php | 37 ----------------- ...tController.php => WishlistController.php} | 26 ++++++------ templates/whishlist/_delete_form.html.twig | 4 -- templates/whishlist/edit.html.twig | 13 ------ templates/wishlist/_delete_form.html.twig | 4 ++ .../{whishlist => wishlist}/_form.html.twig | 0 templates/wishlist/edit.html.twig | 13 ++++++ .../{whishlist => wishlist}/index.html.twig | 6 +-- .../{whishlist => wishlist}/new.html.twig | 4 +- .../{whishlist => wishlist}/show.html.twig | 18 ++++++-- 22 files changed, 50 insertions(+), 491 deletions(-) delete mode 100644 migrations/Version20250319154617.php delete mode 100644 migrations/Version20250319232441.php delete mode 100644 migrations/Version20250319235558.php delete mode 100644 migrations/Version20250319235641.php delete mode 100644 migrations/Version20250320000820.php delete mode 100644 migrations/Version20250320000903.php delete mode 100644 migrations/Version20250320001018.php delete mode 100644 migrations/Version20250320001428.php delete mode 100644 migrations/Version20250320001458.php delete mode 100644 migrations/Version20250320001931.php delete mode 100644 migrations/Version20250320001951.php delete mode 100644 migrations/Version20250320002407.php rename src/Controller/{WhishlistController.php => WishlistController.php} (67%) delete mode 100644 templates/whishlist/_delete_form.html.twig delete mode 100644 templates/whishlist/edit.html.twig create mode 100644 templates/wishlist/_delete_form.html.twig rename templates/{whishlist => wishlist}/_form.html.twig (100%) create mode 100644 templates/wishlist/edit.html.twig rename templates/{whishlist => wishlist}/index.html.twig (79%) rename templates/{whishlist => wishlist}/new.html.twig (56%) rename templates/{whishlist => wishlist}/show.html.twig (59%) diff --git a/.env b/.env index 3815cbdc..89db3161 100644 --- a/.env +++ b/.env @@ -16,7 +16,6 @@ ###> symfony/framework-bundle ### APP_ENV=dev -APP_SECRET= ###< symfony/framework-bundle ### MESSENGER_TRANSPORT_DSN=sync:// @@ -28,6 +27,6 @@ MESSENGER_TRANSPORT_DSN=sync:// # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" -DATABASE_URL="mysql://aa:aaa@127.0.0.1:3306/citation_db1?serverVersion=8.0" +DATABASE_URL="mysql://root:root@172.18.0.3:3306/wishlist?serverVersion=8.0" ###< doctrine/doctrine-bundle ### diff --git a/migrations/Version20250319154617.php b/migrations/Version20250319154617.php deleted file mode 100644 index 923e42fd..00000000 --- a/migrations/Version20250319154617.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250319154617 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); - $this->addSql('DROP TABLE item'); - $this->addSql('DROP TABLE purchase_proof'); - $this->addSql('DROP TABLE messenger_messages'); - } -} diff --git a/migrations/Version20250319232441.php b/migrations/Version20250319232441.php deleted file mode 100644 index 80297575..00000000 --- a/migrations/Version20250319232441.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250319232441 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); - $this->addSql('DROP TABLE item'); - $this->addSql('DROP TABLE purchase_proof'); - $this->addSql('DROP TABLE messenger_messages'); - } -} diff --git a/migrations/Version20250319235558.php b/migrations/Version20250319235558.php deleted file mode 100644 index ff767113..00000000 --- a/migrations/Version20250319235558.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250319235558 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL'); - $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); - $this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof'); - $this->addSql('ALTER TABLE purchase_proof DROP item_id'); - } -} diff --git a/migrations/Version20250319235641.php b/migrations/Version20250319235641.php deleted file mode 100644 index 328a77c4..00000000 --- a/migrations/Version20250319235641.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250319235641 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); - $this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL'); - $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); - $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); - $this->addSql('DROP TABLE item'); - $this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof'); - $this->addSql('ALTER TABLE purchase_proof DROP item_id'); - } -} diff --git a/migrations/Version20250320000820.php b/migrations/Version20250320000820.php deleted file mode 100644 index d8e5490b..00000000 --- a/migrations/Version20250320000820.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250320000820 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); - $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); - $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); - $this->addSql('DROP TABLE purchase_proof'); - } -} diff --git a/migrations/Version20250320000903.php b/migrations/Version20250320000903.php deleted file mode 100644 index c4b987f4..00000000 --- a/migrations/Version20250320000903.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250320000903 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); - $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); - $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); - $this->addSql('DROP TABLE purchase_proof'); - } -} diff --git a/migrations/Version20250320001018.php b/migrations/Version20250320001018.php deleted file mode 100644 index e292a9b8..00000000 --- a/migrations/Version20250320001018.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250320001018 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); - $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); - $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); - $this->addSql('DROP TABLE item'); - $this->addSql('DROP TABLE purchase_proof'); - $this->addSql('DROP TABLE messenger_messages'); - } -} diff --git a/migrations/Version20250320001428.php b/migrations/Version20250320001428.php deleted file mode 100644 index cba08978..00000000 --- a/migrations/Version20250320001428.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250320001428 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); - $this->addSql('DROP INDEX UNIQ_1F1B251EFECA7547 ON item'); - $this->addSql('ALTER TABLE item DROP purchase_proof_id'); - $this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL'); - $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE item ADD purchase_proof_id INT DEFAULT NULL'); - $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id) ON UPDATE NO ACTION ON DELETE NO ACTION'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_1F1B251EFECA7547 ON item (purchase_proof_id)'); - $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); - $this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof'); - $this->addSql('ALTER TABLE purchase_proof DROP item_id'); - } -} diff --git a/migrations/Version20250320001458.php b/migrations/Version20250320001458.php deleted file mode 100644 index 345d1e8f..00000000 --- a/migrations/Version20250320001458.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250320001458 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); - $this->addSql('DROP TABLE item'); - $this->addSql('DROP TABLE purchase_proof'); - $this->addSql('DROP TABLE messenger_messages'); - } -} diff --git a/migrations/Version20250320001931.php b/migrations/Version20250320001931.php deleted file mode 100644 index acff1075..00000000 --- a/migrations/Version20250320001931.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250320001931 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); - $this->addSql('DROP INDEX UNIQ_1F1B251EFECA7547 ON item'); - $this->addSql('ALTER TABLE item DROP purchase_proof_id'); - $this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL'); - $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE item ADD purchase_proof_id INT DEFAULT NULL'); - $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id) ON UPDATE NO ACTION ON DELETE NO ACTION'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_1F1B251EFECA7547 ON item (purchase_proof_id)'); - $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); - $this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof'); - $this->addSql('ALTER TABLE purchase_proof DROP item_id'); - } -} diff --git a/migrations/Version20250320001951.php b/migrations/Version20250320001951.php deleted file mode 100644 index 97040f22..00000000 --- a/migrations/Version20250320001951.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250320001951 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); - $this->addSql('DROP TABLE item'); - $this->addSql('DROP TABLE purchase_proof'); - $this->addSql('DROP TABLE messenger_messages'); - } -} diff --git a/migrations/Version20250320002407.php b/migrations/Version20250320002407.php deleted file mode 100644 index 57bc4aed..00000000 --- a/migrations/Version20250320002407.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20250320002407 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); - $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); - $this->addSql('DROP TABLE item'); - $this->addSql('DROP TABLE purchase_proof'); - $this->addSql('DROP TABLE messenger_messages'); - } -} diff --git a/src/Controller/WhishlistController.php b/src/Controller/WishlistController.php similarity index 67% rename from src/Controller/WhishlistController.php rename to src/Controller/WishlistController.php index 4709e430..38de54b4 100644 --- a/src/Controller/WhishlistController.php +++ b/src/Controller/WishlistController.php @@ -12,17 +12,17 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; #[Route('/wishlist')] -final class WhishlistController extends AbstractController +final class WishlistController extends AbstractController { - #[Route(name: 'app_whishlist_index', methods: ['GET'])] + #[Route(name: 'app_wishlist_index', methods: ['GET'])] public function index(WishlistRepository $wishlistRepository): Response { - return $this->render('whishlist/index.html.twig', [ + return $this->render('wishlist/index.html.twig', [ 'wishlists' => $wishlistRepository->findAll(), ]); } - #[Route('/new', name: 'app_whishlist_new', methods: ['GET', 'POST'])] + #[Route('/new', name: 'app_wishlist_new', methods: ['GET', 'POST'])] public function new(Request $request, EntityManagerInterface $entityManager): Response { $wishlist = new Wishlist(); @@ -33,24 +33,24 @@ final class WhishlistController extends AbstractController $entityManager->persist($wishlist); $entityManager->flush(); - return $this->redirectToRoute('app_whishlist_index', [], Response::HTTP_SEE_OTHER); + return $this->redirectToRoute('app_wishlist_index', [], Response::HTTP_SEE_OTHER); } - return $this->render('whishlist/new.html.twig', [ + return $this->render('wishlist/new.html.twig', [ 'wishlist' => $wishlist, 'form' => $form, ]); } - #[Route('/{id}', name: 'app_whishlist_show', methods: ['GET'])] + #[Route('/{id}', name: 'app_wishlist_show', methods: ['GET'])] public function show(Wishlist $wishlist): Response { - return $this->render('whishlist/show.html.twig', [ + return $this->render('wishlist/show.html.twig', [ 'wishlist' => $wishlist, ]); } - #[Route('/{id}/edit', name: 'app_whishlist_edit', methods: ['GET', 'POST'])] + #[Route('/{id}/edit', name: 'app_wishlist_edit', methods: ['GET', 'POST'])] public function edit(Request $request, Wishlist $wishlist, EntityManagerInterface $entityManager): Response { $form = $this->createForm(WishlistType::class, $wishlist); @@ -59,16 +59,16 @@ final class WhishlistController extends AbstractController if ($form->isSubmitted() && $form->isValid()) { $entityManager->flush(); - return $this->redirectToRoute('app_whishlist_index', [], Response::HTTP_SEE_OTHER); + return $this->redirectToRoute('app_wishlist_index', [], Response::HTTP_SEE_OTHER); } - return $this->render('whishlist/edit.html.twig', [ + return $this->render('wishlist/edit.html.twig', [ 'wishlist' => $wishlist, 'form' => $form, ]); } - #[Route('/{id}', name: 'app_whishlist_delete', methods: ['POST'])] + #[Route('/{id}', name: 'app_wishlist_delete', methods: ['POST'])] public function delete(Request $request, Wishlist $wishlist, EntityManagerInterface $entityManager): Response { if ($this->isCsrfTokenValid('delete'.$wishlist->getId(), $request->getPayload()->getString('_token'))) { @@ -76,6 +76,6 @@ final class WhishlistController extends AbstractController $entityManager->flush(); } - return $this->redirectToRoute('app_whishlist_index', [], Response::HTTP_SEE_OTHER); + return $this->redirectToRoute('app_wishlist_index', [], Response::HTTP_SEE_OTHER); } } diff --git a/templates/whishlist/_delete_form.html.twig b/templates/whishlist/_delete_form.html.twig deleted file mode 100644 index f5360a00..00000000 --- a/templates/whishlist/_delete_form.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -<form method="post" action="{{ path('app_whishlist_delete', {'id': wishlist.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');"> - <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ wishlist.id) }}"> - <button class="btn">Delete</button> -</form> diff --git a/templates/whishlist/edit.html.twig b/templates/whishlist/edit.html.twig deleted file mode 100644 index 9544c2b2..00000000 --- a/templates/whishlist/edit.html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Edit Wishlist{% endblock %} - -{% block body %} - <h1>Edit Wishlist</h1> - - {{ include('whishlist/_form.html.twig', {'button_label': 'Update'}) }} - - <a href="{{ path('app_whishlist_index') }}">back to list</a> - - {{ include('whishlist/_delete_form.html.twig') }} -{% endblock %} diff --git a/templates/wishlist/_delete_form.html.twig b/templates/wishlist/_delete_form.html.twig new file mode 100644 index 00000000..8dbb7d86 --- /dev/null +++ b/templates/wishlist/_delete_form.html.twig @@ -0,0 +1,4 @@ +<form method="post" action="{{ path('app_wishlist_delete', {'id': wishlist.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');"> + <input type="hidden" name="_token" value="{{ csrf_token('delete' ~ wishlist.id) }}"> + <button class="btn">Delete</button> +</form> diff --git a/templates/whishlist/_form.html.twig b/templates/wishlist/_form.html.twig similarity index 100% rename from templates/whishlist/_form.html.twig rename to templates/wishlist/_form.html.twig diff --git a/templates/wishlist/edit.html.twig b/templates/wishlist/edit.html.twig new file mode 100644 index 00000000..0002ccaa --- /dev/null +++ b/templates/wishlist/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Wishlist{% endblock %} + +{% block body %} + <h1>Edit Wishlist</h1> + + {{ include('wishlist/_form.html.twig', {'button_label': 'Update'}) }} + + <a href="{{ path('app_wishlist_index') }}">back to list</a> + + {{ include('wishlist/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/whishlist/index.html.twig b/templates/wishlist/index.html.twig similarity index 79% rename from templates/whishlist/index.html.twig rename to templates/wishlist/index.html.twig index 60cac94a..ecf8ee42 100644 --- a/templates/whishlist/index.html.twig +++ b/templates/wishlist/index.html.twig @@ -23,8 +23,8 @@ <td>{{ wishlist.deadline ? wishlist.deadline|date('Y-m-d H:i:s') : '' }}</td> <td>{{ wishlist.isDisabled ? 'Yes' : 'No' }}</td> <td> - <a href="{{ path('app_whishlist_show', {'id': wishlist.id}) }}">show</a> - <a href="{{ path('app_whishlist_edit', {'id': wishlist.id}) }}">edit</a> + <a href="{{ path('app_wishlist_show', {'id': wishlist.id}) }}">show</a> + <a href="{{ path('app_wishlist_edit', {'id': wishlist.id}) }}">edit</a> </td> </tr> {% else %} @@ -35,5 +35,5 @@ </tbody> </table> - <a href="{{ path('app_whishlist_new') }}">Create new</a> + <a href="{{ path('app_wishlist_new') }}">Create new</a> {% endblock %} diff --git a/templates/whishlist/new.html.twig b/templates/wishlist/new.html.twig similarity index 56% rename from templates/whishlist/new.html.twig rename to templates/wishlist/new.html.twig index 3bbb2c1f..4f115810 100644 --- a/templates/whishlist/new.html.twig +++ b/templates/wishlist/new.html.twig @@ -5,7 +5,7 @@ {% block body %} <h1>Create new Wishlist</h1> - {{ include('whishlist/_form.html.twig') }} + {{ include('wishlist/_form.html.twig') }} - <a href="{{ path('app_whishlist_index') }}">back to list</a> + <a href="{{ path('app_wishlist_index') }}">back to list</a> {% endblock %} diff --git a/templates/whishlist/show.html.twig b/templates/wishlist/show.html.twig similarity index 59% rename from templates/whishlist/show.html.twig rename to templates/wishlist/show.html.twig index 3d74ac9f..f752ff17 100644 --- a/templates/whishlist/show.html.twig +++ b/templates/wishlist/show.html.twig @@ -3,7 +3,17 @@ {% block title %}Wishlist{% endblock %} {% block body %} - <h1>Wishlist</h1> + + <header> + <div class="user-icon"></div> + <div style="display:flex;justify-content:center;align-items:center;"> + + <h1>My wishlists</h1> + + </div> + <input type="text" placeholder="Search…" class="search-bar"> + </header> + <table class="table"> <tbody> @@ -26,9 +36,9 @@ </tbody> </table> - <a href="{{ path('app_whishlist_index') }}">back to list</a> + <a href="{{ path('app_wishlist_index') }}">back to list</a> - <a href="{{ path('app_whishlist_edit', {'id': wishlist.id}) }}">edit</a> + <a href="{{ path('app_wishlist_edit', {'id': wishlist.id}) }}">edit</a> - {{ include('whishlist/_delete_form.html.twig') }} + {{ include('wishlist/_delete_form.html.twig') }} {% endblock %} -- GitLab