From 1aa98ce3381627dd362638a69a4eb29e396368f6 Mon Sep 17 00:00:00 2001 From: Romain Date: Sat, 30 Nov 2024 15:51:55 +0100 Subject: [PATCH] profil + routes --- .gitignore | 3 +- migrations/Version20241017134137.php | 67 ---------------- migrations/Version20241017142722.php | 52 ------------- migrations/Version20241017152949.php | 46 ----------- migrations/Version20241114132304.php | 110 --------------------------- migrations/Version20241121135116.php | 32 -------- migrations/Version20241121140219.php | 38 --------- migrations/Version20241121153037.php | 31 -------- src/Controller/IndexController.php | 2 +- src/Controller/ProfileController.php | 29 +++++++ templates/base.html.twig | 43 +++++++++-- templates/profile/employee.html.twig | 7 ++ templates/profile/index.html.twig | 19 +++++ templates/profile/intern.html.twig | 14 ++++ 14 files changed, 110 insertions(+), 383 deletions(-) delete mode 100644 migrations/Version20241017134137.php delete mode 100644 migrations/Version20241017142722.php delete mode 100644 migrations/Version20241017152949.php delete mode 100644 migrations/Version20241114132304.php delete mode 100644 migrations/Version20241121135116.php delete mode 100644 migrations/Version20241121140219.php delete mode 100644 migrations/Version20241121153037.php create mode 100644 src/Controller/ProfileController.php create mode 100644 templates/profile/employee.html.twig create mode 100644 templates/profile/index.html.twig create mode 100644 templates/profile/intern.html.twig diff --git a/.gitignore b/.gitignore index 7540fb1..739e1e8 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,5 @@ /public/assets/ /assets/vendor/ ###< symfony/asset-mapper ### -.idea \ No newline at end of file +.idea +/migrations/ \ No newline at end of file diff --git a/migrations/Version20241017134137.php b/migrations/Version20241017134137.php deleted file mode 100644 index 0dc3e3c..0000000 --- a/migrations/Version20241017134137.php +++ /dev/null @@ -1,67 +0,0 @@ -addSql('CREATE SEQUENCE announcement_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE company_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE userApp_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE TABLE announcement (id INT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE company (id INT NOT NULL, name VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, tel VARCHAR(255) NOT NULL, mail VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE employee (id INT NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE intern (id INT NOT NULL, cover_letter TEXT NOT NULL, resume VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE userApp (id INT NOT NULL, nickname VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, tel VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, mail VARCHAR(255) NOT NULL, DISCRIMINATOR VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_NICKNAME ON userApp (nickname)'); - $this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)'); - $this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)'); - $this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)'); - $this->addSql('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$ - BEGIN - PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text); - RETURN NEW; - END; - $$ LANGUAGE plpgsql;'); - $this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;'); - $this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();'); - $this->addSql('ALTER TABLE employee ADD CONSTRAINT FK_5D9F75A1BF396750 FOREIGN KEY (id) REFERENCES userApp (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE intern ADD CONSTRAINT FK_A5795F36BF396750 FOREIGN KEY (id) REFERENCES userApp (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - } - - 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 announcement_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE company_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE userApp_id_seq CASCADE'); - $this->addSql('ALTER TABLE employee DROP CONSTRAINT FK_5D9F75A1BF396750'); - $this->addSql('ALTER TABLE intern DROP CONSTRAINT FK_A5795F36BF396750'); - $this->addSql('DROP TABLE announcement'); - $this->addSql('DROP TABLE company'); - $this->addSql('DROP TABLE employee'); - $this->addSql('DROP TABLE intern'); - $this->addSql('DROP TABLE userApp'); - $this->addSql('DROP TABLE messenger_messages'); - } -} diff --git a/migrations/Version20241017142722.php b/migrations/Version20241017142722.php deleted file mode 100644 index 73818a8..0000000 --- a/migrations/Version20241017142722.php +++ /dev/null @@ -1,52 +0,0 @@ -addSql('CREATE SEQUENCE status_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE TABLE status (id INT NOT NULL, label VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('ALTER TABLE announcement ADD company_id INT NOT NULL'); - $this->addSql('ALTER TABLE announcement ADD status_id INT NOT NULL'); - $this->addSql('ALTER TABLE announcement ADD CONSTRAINT FK_4DB9D91C979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE announcement ADD CONSTRAINT FK_4DB9D91C6BF700BD FOREIGN KEY (status_id) REFERENCES status (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('CREATE INDEX IDX_4DB9D91C979B1AD6 ON announcement (company_id)'); - $this->addSql('CREATE INDEX IDX_4DB9D91C6BF700BD ON announcement (status_id)'); - $this->addSql('ALTER TABLE employee ADD company_id INT NOT NULL'); - $this->addSql('ALTER TABLE employee ADD CONSTRAINT FK_5D9F75A1979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('CREATE INDEX IDX_5D9F75A1979B1AD6 ON employee (company_id)'); - } - - 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('ALTER TABLE announcement DROP CONSTRAINT FK_4DB9D91C6BF700BD'); - $this->addSql('DROP SEQUENCE status_id_seq CASCADE'); - $this->addSql('DROP TABLE status'); - $this->addSql('ALTER TABLE announcement DROP CONSTRAINT FK_4DB9D91C979B1AD6'); - $this->addSql('DROP INDEX IDX_4DB9D91C979B1AD6'); - $this->addSql('DROP INDEX IDX_4DB9D91C6BF700BD'); - $this->addSql('ALTER TABLE announcement DROP company_id'); - $this->addSql('ALTER TABLE announcement DROP status_id'); - $this->addSql('ALTER TABLE employee DROP CONSTRAINT FK_5D9F75A1979B1AD6'); - $this->addSql('DROP INDEX IDX_5D9F75A1979B1AD6'); - $this->addSql('ALTER TABLE employee DROP company_id'); - } -} diff --git a/migrations/Version20241017152949.php b/migrations/Version20241017152949.php deleted file mode 100644 index 1282d23..0000000 --- a/migrations/Version20241017152949.php +++ /dev/null @@ -1,46 +0,0 @@ -addSql('CREATE TABLE favorites (intern_id INT NOT NULL, announcement_id INT NOT NULL, PRIMARY KEY(intern_id, announcement_id))'); - $this->addSql('CREATE INDEX IDX_E46960F5525DD4B4 ON favorites (intern_id)'); - $this->addSql('CREATE INDEX IDX_E46960F5913AEA17 ON favorites (announcement_id)'); - $this->addSql('CREATE TABLE applications (intern_id INT NOT NULL, announcement_id INT NOT NULL, PRIMARY KEY(intern_id, announcement_id))'); - $this->addSql('CREATE INDEX IDX_F7C966F0525DD4B4 ON applications (intern_id)'); - $this->addSql('CREATE INDEX IDX_F7C966F0913AEA17 ON applications (announcement_id)'); - $this->addSql('ALTER TABLE favorites ADD CONSTRAINT FK_E46960F5525DD4B4 FOREIGN KEY (intern_id) REFERENCES intern (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE favorites ADD CONSTRAINT FK_E46960F5913AEA17 FOREIGN KEY (announcement_id) REFERENCES announcement (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE applications ADD CONSTRAINT FK_F7C966F0525DD4B4 FOREIGN KEY (intern_id) REFERENCES intern (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE applications ADD CONSTRAINT FK_F7C966F0913AEA17 FOREIGN KEY (announcement_id) REFERENCES announcement (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - } - - 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('ALTER TABLE favorites DROP CONSTRAINT FK_E46960F5525DD4B4'); - $this->addSql('ALTER TABLE favorites DROP CONSTRAINT FK_E46960F5913AEA17'); - $this->addSql('ALTER TABLE applications DROP CONSTRAINT FK_F7C966F0525DD4B4'); - $this->addSql('ALTER TABLE applications DROP CONSTRAINT FK_F7C966F0913AEA17'); - $this->addSql('DROP TABLE favorites'); - $this->addSql('DROP TABLE applications'); - } -} diff --git a/migrations/Version20241114132304.php b/migrations/Version20241114132304.php deleted file mode 100644 index e87512c..0000000 --- a/migrations/Version20241114132304.php +++ /dev/null @@ -1,110 +0,0 @@ -addSql('CREATE SEQUENCE degree_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE faq_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE intern_application_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE intern_degree_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE intern_favorite_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE intern_skill_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE message_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE skill_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE TABLE degree (id INT NOT NULL, label VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE faq (id INT NOT NULL, question TEXT NOT NULL, answer TEXT DEFAULT NULL, update_date DATE NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE TABLE intern_application (id INT NOT NULL, application_id INT DEFAULT NULL, intern_id INT DEFAULT NULL, application_date DATE NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_4EDBBCC83E030ACD ON intern_application (application_id)'); - $this->addSql('CREATE INDEX IDX_4EDBBCC8525DD4B4 ON intern_application (intern_id)'); - $this->addSql('CREATE TABLE intern_degree (id INT NOT NULL, degree_id INT DEFAULT NULL, intern_id INT DEFAULT NULL, graduation_date DATE NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_E68CCB23B35C5756 ON intern_degree (degree_id)'); - $this->addSql('CREATE INDEX IDX_E68CCB23525DD4B4 ON intern_degree (intern_id)'); - $this->addSql('CREATE TABLE intern_favorite (id INT NOT NULL, announcement_id INT DEFAULT NULL, intern_id INT DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_A709862E913AEA17 ON intern_favorite (announcement_id)'); - $this->addSql('CREATE INDEX IDX_A709862E525DD4B4 ON intern_favorite (intern_id)'); - $this->addSql('CREATE TABLE intern_skill (id INT NOT NULL, skill_id INT DEFAULT NULL, intern_id INT DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_75E1C4DC5585C142 ON intern_skill (skill_id)'); - $this->addSql('CREATE INDEX IDX_75E1C4DC525DD4B4 ON intern_skill (intern_id)'); - $this->addSql('CREATE TABLE message (id INT NOT NULL, sender_id INT DEFAULT NULL, receiver_id INT DEFAULT NULL, content TEXT NOT NULL, sending_date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_B6BD307FF624B39D ON message (sender_id)'); - $this->addSql('CREATE INDEX IDX_B6BD307FCD53EDB6 ON message (receiver_id)'); - $this->addSql('CREATE TABLE skill (id INT NOT NULL, label VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('ALTER TABLE intern_application ADD CONSTRAINT FK_4EDBBCC83E030ACD FOREIGN KEY (application_id) REFERENCES announcement (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE intern_application ADD CONSTRAINT FK_4EDBBCC8525DD4B4 FOREIGN KEY (intern_id) REFERENCES intern (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE intern_degree ADD CONSTRAINT FK_E68CCB23B35C5756 FOREIGN KEY (degree_id) REFERENCES degree (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE intern_degree ADD CONSTRAINT FK_E68CCB23525DD4B4 FOREIGN KEY (intern_id) REFERENCES intern (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE intern_favorite ADD CONSTRAINT FK_A709862E913AEA17 FOREIGN KEY (announcement_id) REFERENCES announcement (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE intern_favorite ADD CONSTRAINT FK_A709862E525DD4B4 FOREIGN KEY (intern_id) REFERENCES intern (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE intern_skill ADD CONSTRAINT FK_75E1C4DC5585C142 FOREIGN KEY (skill_id) REFERENCES skill (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE intern_skill ADD CONSTRAINT FK_75E1C4DC525DD4B4 FOREIGN KEY (intern_id) REFERENCES intern (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE message ADD CONSTRAINT FK_B6BD307FF624B39D FOREIGN KEY (sender_id) REFERENCES userApp (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE message ADD CONSTRAINT FK_B6BD307FCD53EDB6 FOREIGN KEY (receiver_id) REFERENCES userApp (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE favorites DROP CONSTRAINT fk_e46960f5525dd4b4'); - $this->addSql('ALTER TABLE favorites DROP CONSTRAINT fk_e46960f5913aea17'); - $this->addSql('ALTER TABLE applications DROP CONSTRAINT fk_f7c966f0525dd4b4'); - $this->addSql('ALTER TABLE applications DROP CONSTRAINT fk_f7c966f0913aea17'); - $this->addSql('DROP TABLE favorites'); - $this->addSql('DROP TABLE applications'); - $this->addSql('ALTER TABLE announcement ADD creation_date DATE NOT NULL'); - } - - 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 degree_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE faq_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE intern_application_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE intern_degree_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE intern_favorite_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE intern_skill_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE message_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE skill_id_seq CASCADE'); - $this->addSql('CREATE TABLE favorites (intern_id INT NOT NULL, announcement_id INT NOT NULL, PRIMARY KEY(intern_id, announcement_id))'); - $this->addSql('CREATE INDEX idx_e46960f5913aea17 ON favorites (announcement_id)'); - $this->addSql('CREATE INDEX idx_e46960f5525dd4b4 ON favorites (intern_id)'); - $this->addSql('CREATE TABLE applications (intern_id INT NOT NULL, announcement_id INT NOT NULL, PRIMARY KEY(intern_id, announcement_id))'); - $this->addSql('CREATE INDEX idx_f7c966f0913aea17 ON applications (announcement_id)'); - $this->addSql('CREATE INDEX idx_f7c966f0525dd4b4 ON applications (intern_id)'); - $this->addSql('ALTER TABLE favorites ADD CONSTRAINT fk_e46960f5525dd4b4 FOREIGN KEY (intern_id) REFERENCES intern (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE favorites ADD CONSTRAINT fk_e46960f5913aea17 FOREIGN KEY (announcement_id) REFERENCES announcement (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE applications ADD CONSTRAINT fk_f7c966f0525dd4b4 FOREIGN KEY (intern_id) REFERENCES intern (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE applications ADD CONSTRAINT fk_f7c966f0913aea17 FOREIGN KEY (announcement_id) REFERENCES announcement (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE intern_application DROP CONSTRAINT FK_4EDBBCC83E030ACD'); - $this->addSql('ALTER TABLE intern_application DROP CONSTRAINT FK_4EDBBCC8525DD4B4'); - $this->addSql('ALTER TABLE intern_degree DROP CONSTRAINT FK_E68CCB23B35C5756'); - $this->addSql('ALTER TABLE intern_degree DROP CONSTRAINT FK_E68CCB23525DD4B4'); - $this->addSql('ALTER TABLE intern_favorite DROP CONSTRAINT FK_A709862E913AEA17'); - $this->addSql('ALTER TABLE intern_favorite DROP CONSTRAINT FK_A709862E525DD4B4'); - $this->addSql('ALTER TABLE intern_skill DROP CONSTRAINT FK_75E1C4DC5585C142'); - $this->addSql('ALTER TABLE intern_skill DROP CONSTRAINT FK_75E1C4DC525DD4B4'); - $this->addSql('ALTER TABLE message DROP CONSTRAINT FK_B6BD307FF624B39D'); - $this->addSql('ALTER TABLE message DROP CONSTRAINT FK_B6BD307FCD53EDB6'); - $this->addSql('DROP TABLE degree'); - $this->addSql('DROP TABLE faq'); - $this->addSql('DROP TABLE intern_application'); - $this->addSql('DROP TABLE intern_degree'); - $this->addSql('DROP TABLE intern_favorite'); - $this->addSql('DROP TABLE intern_skill'); - $this->addSql('DROP TABLE message'); - $this->addSql('DROP TABLE skill'); - $this->addSql('ALTER TABLE announcement DROP creation_date'); - } -} diff --git a/migrations/Version20241121135116.php b/migrations/Version20241121135116.php deleted file mode 100644 index c932e51..0000000 --- a/migrations/Version20241121135116.php +++ /dev/null @@ -1,32 +0,0 @@ -addSql('ALTER TABLE userapp ALTER roles DROP NOT NULL'); - } - - 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('ALTER TABLE userApp ALTER roles SET NOT NULL'); - } -} diff --git a/migrations/Version20241121140219.php b/migrations/Version20241121140219.php deleted file mode 100644 index 28107a4..0000000 --- a/migrations/Version20241121140219.php +++ /dev/null @@ -1,38 +0,0 @@ -addSql('ALTER TABLE announcement DROP CONSTRAINT fk_4db9d91c6bf700bd'); - $this->addSql('DROP INDEX idx_4db9d91c6bf700bd'); - $this->addSql('ALTER TABLE announcement ADD status VARCHAR(255) NOT NULL'); - $this->addSql('ALTER TABLE announcement DROP status_id'); - } - - 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('ALTER TABLE announcement ADD status_id INT NOT NULL'); - $this->addSql('ALTER TABLE announcement DROP status'); - $this->addSql('ALTER TABLE announcement ADD CONSTRAINT fk_4db9d91c6bf700bd FOREIGN KEY (status_id) REFERENCES status (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('CREATE INDEX idx_4db9d91c6bf700bd ON announcement (status_id)'); - } -} diff --git a/migrations/Version20241121153037.php b/migrations/Version20241121153037.php deleted file mode 100644 index 9a792b8..0000000 --- a/migrations/Version20241121153037.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('CREATE SCHEMA public'); - } -} diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php index 356aa94..a15ba6f 100644 --- a/src/Controller/IndexController.php +++ b/src/Controller/IndexController.php @@ -9,7 +9,7 @@ use Symfony\Component\Routing\Attribute\Route; class IndexController extends AbstractController { - #[Route('/index', name: 'app_index')] + #[Route('/', name: 'app_index')] public function index(): Response { return $this->render('index/index.html.twig', [ diff --git a/src/Controller/ProfileController.php b/src/Controller/ProfileController.php new file mode 100644 index 0000000..6f0de0f --- /dev/null +++ b/src/Controller/ProfileController.php @@ -0,0 +1,29 @@ +getUser(); + + // Vérifiez les rôles si nécessaire + if (!$user) { + throw $this->createAccessDeniedException('Vous devez être connecté pour accéder à cette page.'); + } + + return $this->render('profile/index.html.twig', [ + 'user' => $user, + ]); + } +} + + + diff --git a/templates/base.html.twig b/templates/base.html.twig index 2fd436e..1b5a07a 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -18,12 +18,12 @@ } - +
- HegreSphere + HegreSphere
- + Profil
-{# Block for the specific page content #} -
+
{% block body %} {% endblock %}
+ +
+
+ +
+

À propos de nous

+

HegreSphere est une plateforme dédiée aux opportunités de stages et au soutien des étudiants dans leur parcours professionnel.

+
+ + +
+

Liens utiles

+ +
+ + +
+

Contactez-nous

+

Email: support@hegresphere.com

+

Téléphone: +33 1 23 45 67 89

+ + Déconnexion + +
+
+
+

© 2024 HegreSphere. Tous droits réservés.

+
+
diff --git a/templates/profile/employee.html.twig b/templates/profile/employee.html.twig new file mode 100644 index 0000000..641f9fe --- /dev/null +++ b/templates/profile/employee.html.twig @@ -0,0 +1,7 @@ +
+

Bonjour {{ app.user.firstName }} {{ app.user.lastName }}

+

Vous êtes employé(e) chez {{ app.user.company }}.

+

Adresse : {{ app.user.address }}

+

Téléphone : {{ app.user.tel }}

+

Email : {{ app.user.mail }}

+
diff --git a/templates/profile/index.html.twig b/templates/profile/index.html.twig new file mode 100644 index 0000000..251ddc1 --- /dev/null +++ b/templates/profile/index.html.twig @@ -0,0 +1,19 @@ +{% extends 'base.html.twig' %} + +{% block title %}Profil{% endblock %} + +{% block body %} +
+

Profil

+ + + {% if 'ROLE_INTERN' in app.user.roles %} + {% include 'profile/intern.html.twig' %} + {% endif %} + + + {% if 'ROLE_EMPLOYEE' in app.user.roles %} + {% include 'profile/employee.html.twig' %} + {% endif %} +
+{% endblock %} diff --git a/templates/profile/intern.html.twig b/templates/profile/intern.html.twig new file mode 100644 index 0000000..5e74532 --- /dev/null +++ b/templates/profile/intern.html.twig @@ -0,0 +1,14 @@ +
+

Bonjour {{ app.user.firstName }} {{ app.user.lastName }}

+

Vous êtes à la recherche d'un stage.

+

Adresse : {{ app.user.address }}

+

Téléphone : {{ app.user.tel }}

+

Email : {{ app.user.mail }}

+ +

Vos compétences :

+
    + {% for comp in app.user.skills %} +
  • comp.label
  • + {% endfor %} +
+