Compare commits
21 Commits
6f05f1e846
...
5834b02fdc
Author | SHA1 | Date | |
---|---|---|---|
5834b02fdc | |||
1d5798a265 | |||
741887b7f7 | |||
c2882f645d | |||
d80e67c96a | |||
5aa2c3a4b5 | |||
1eb8418cff | |||
6deb9b30cd | |||
f22a2a2b9b | |||
69e772938c | |||
95fcc26fe8 | |||
3902207427 | |||
f66fb6028d | |||
3be6867e5e | |||
88be0086ce | |||
0d43ba4f47 | |||
2ed64a3027 | |||
3d693511d0 | |||
4af5d73497 | |||
1aa98ce338 | |||
90b8de828e |
2
.env
2
.env
@ -26,7 +26,7 @@ APP_SECRET=f024eb6ed2c61908ec7842f29b9a6334
|
||||
# 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="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
|
||||
DATABASE_URL="postgresql://allavenavr:Btssio2024@172.20.96.1:5432/hegresphere?serverVersion=16&charset=utf8"
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
||||
###> symfony/messenger ###
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -20,4 +20,6 @@
|
||||
/public/assets/
|
||||
/assets/vendor/
|
||||
###< symfony/asset-mapper ###
|
||||
.idea
|
||||
.idea
|
||||
|
||||
/migrations/
|
1374
composer.lock
generated
1374
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -14,34 +14,27 @@ security:
|
||||
entity:
|
||||
class: App\Entity\Employee
|
||||
property: nickname
|
||||
|
||||
app_combined_provider:
|
||||
chain:
|
||||
providers: [app_intern_provider, app_employee_provider]
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
intern:
|
||||
main:
|
||||
lazy: true
|
||||
provider: app_intern_provider
|
||||
provider: app_combined_provider
|
||||
form_login:
|
||||
login_path: app_login
|
||||
check_path: app_login
|
||||
default_target_path: app_index
|
||||
enable_csrf: true
|
||||
logout:
|
||||
path: app_logout
|
||||
# where to redirect after logout
|
||||
# target: app_any_route
|
||||
employee:
|
||||
lazy: true
|
||||
provider: app_employee_provider
|
||||
form_login:
|
||||
login_path: app_login
|
||||
check_path: app_login
|
||||
enable_csrf: true
|
||||
logout:
|
||||
path: app_logout
|
||||
# where to redirect after logout
|
||||
# target: app_any_route
|
||||
|
||||
# activate different ways to authenticate
|
||||
# https://symfony.com/doc/current/security.html#the-firewall
|
||||
@ -56,9 +49,9 @@ security:
|
||||
# Easy way to control access for large sections of your site
|
||||
# Note: Only the *first* access control that matches will be used
|
||||
access_control:
|
||||
- { path: ^/login, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/register, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }
|
||||
- { path: ^/login, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/register, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/, roles: IS_AUTHENTICATED_FULLY }
|
||||
# - { path: ^/profile, roles: ROLE_USER }
|
||||
|
||||
when@test:
|
||||
@ -72,4 +65,4 @@ when@test:
|
||||
algorithm: auto
|
||||
cost: 4 # Lowest possible value for bcrypt
|
||||
time_cost: 3 # Lowest possible value for argon
|
||||
memory_cost: 10 # Lowest possible value for argon
|
||||
memory_cost: 10 # Lowest possible value for argon
|
@ -1,67 +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 Version20241017134137 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 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');
|
||||
}
|
||||
}
|
@ -1,52 +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 Version20241017142722 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 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');
|
||||
}
|
||||
}
|
@ -1,46 +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 Version20241017152949 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 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');
|
||||
}
|
||||
}
|
@ -1,110 +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 Version20241114132304 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 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');
|
||||
}
|
||||
}
|
@ -1,32 +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 Version20241121135116 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 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');
|
||||
}
|
||||
}
|
@ -1,38 +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 Version20241121140219 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 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)');
|
||||
}
|
||||
}
|
@ -1,38 +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 Version20241121141451 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('DROP SEQUENCE status_id_seq CASCADE');
|
||||
$this->addSql('DROP TABLE status');
|
||||
$this->addSql('ALTER TABLE userapp ADD is_verified BOOLEAN NOT NULL');
|
||||
$this->addSql('ALTER TABLE userapp ALTER roles SET 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('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 userApp DROP is_verified');
|
||||
$this->addSql('ALTER TABLE userApp ALTER roles DROP NOT NULL');
|
||||
}
|
||||
}
|
@ -1,40 +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 Version20241121141722 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 userapp ALTER first_name DROP NOT NULL');
|
||||
$this->addSql('ALTER TABLE userapp ALTER last_name DROP NOT NULL');
|
||||
$this->addSql('ALTER TABLE userapp ALTER tel DROP NOT NULL');
|
||||
$this->addSql('ALTER TABLE userapp ALTER address DROP NOT NULL');
|
||||
$this->addSql('ALTER TABLE userapp ALTER mail 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 first_name SET NOT NULL');
|
||||
$this->addSql('ALTER TABLE userApp ALTER last_name SET NOT NULL');
|
||||
$this->addSql('ALTER TABLE userApp ALTER tel SET NOT NULL');
|
||||
$this->addSql('ALTER TABLE userApp ALTER address SET NOT NULL');
|
||||
$this->addSql('ALTER TABLE userApp ALTER mail SET NOT NULL');
|
||||
}
|
||||
}
|
@ -1,31 +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 Version20241121141818 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
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
}
|
||||
}
|
@ -1,32 +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 Version20241121141912 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 userapp ALTER is_verified 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 is_verified SET NOT NULL');
|
||||
}
|
||||
}
|
@ -1,34 +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 Version20241121142119 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 intern ALTER cover_letter DROP NOT NULL');
|
||||
$this->addSql('ALTER TABLE intern ALTER resume 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 intern ALTER cover_letter SET NOT NULL');
|
||||
$this->addSql('ALTER TABLE intern ALTER resume SET NOT NULL');
|
||||
}
|
||||
}
|
@ -1,31 +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 Version20241121142432 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
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
}
|
||||
}
|
@ -1,32 +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 Version20241121145353 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 employee ALTER company_id 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 employee ALTER company_id SET NOT NULL');
|
||||
}
|
||||
}
|
@ -1,31 +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 Version20241121151633 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
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
}
|
||||
}
|
@ -1,31 +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 Version20241121153037 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
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
}
|
||||
}
|
@ -1,31 +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 Version20241121162300 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
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
}
|
||||
}
|
@ -1,31 +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 Version20241121164509 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
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
}
|
||||
}
|
@ -3,7 +3,6 @@
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Announcement;
|
||||
use App\Entity\InternApplication;
|
||||
use App\Form\AnnouncementType;
|
||||
use App\Repository\AnnouncementRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
@ -11,117 +10,130 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
#[Route('/announcement', name: 'app_announcement')]
|
||||
class AnnouncementController extends AbstractController
|
||||
#[Route('/announcement')]
|
||||
final class AnnouncementController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly AnnouncementRepository $announcementRepository
|
||||
)
|
||||
#[Route('/', name: 'app_announcement_index')]
|
||||
public function list(Request $request, AnnouncementRepository $announcementRepository): Response
|
||||
{
|
||||
$user = $this->getUser();
|
||||
$announcements = [];
|
||||
|
||||
if (in_array('ROLE_ADMIN', $user->getRoles())) {
|
||||
$showNonValidated = $request->query->get('show_non_validated');
|
||||
|
||||
if ($showNonValidated) {
|
||||
$announcements = $announcementRepository->findBy(['status' => 'notVerified']);
|
||||
}
|
||||
if (!$showNonValidated){
|
||||
$announcements = $announcementRepository->findAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (in_array('ROLE_EMPLOYEE', $user->getRoles())) {
|
||||
$company = $user->getCompany();
|
||||
|
||||
if ($company)
|
||||
{
|
||||
$announcements = $announcementRepository->findBy(['company' => $company]);
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array('ROLE_INTERN', $user->getRoles()))
|
||||
{
|
||||
$announcements = $announcementRepository->findBy(['status' => 'Verified']);
|
||||
}
|
||||
|
||||
return $this->render('announcement/index.html.twig', [
|
||||
'announcements' => $announcements,
|
||||
'showNonValidated' => $request->query->get('show_non_validated', false),
|
||||
]);
|
||||
}
|
||||
#[Route('/add', name: '_add')]
|
||||
#[IsGranted('ROLE_ADMIN')]
|
||||
public function addAnnouncement(Request $request): Response
|
||||
|
||||
|
||||
#[Route('/new', name: 'app_announcement_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
/*$user = $this->getUser();
|
||||
|
||||
if (in_array('ROLE_EMPLOYEE', $user->getRoles())) {
|
||||
$company = $user->getCompany();
|
||||
|
||||
if (!$company)
|
||||
{
|
||||
echo "Compétez votre profile avant de créer une annonce";
|
||||
$this->redirectToRoute('app_user_edit',['id' => $user->getId(),]);
|
||||
}
|
||||
}*/
|
||||
|
||||
$announcement = new Announcement();
|
||||
$form = $this->createForm(AnnouncementType::class, $announcement);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if($form->isSubmitted() && $form->isValid())
|
||||
{
|
||||
//met la date de création de l'annonce au moment où le formulaire est envoyé
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$announcement->setCreationDate(new \DateTime());
|
||||
$announcement->setStatus('notVerified');
|
||||
$entityManager->persist($announcement);
|
||||
$entityManager->flush();
|
||||
|
||||
$this->entityManager->persist($announcement);
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Annonce créée avec succès.');
|
||||
return $this->redirectToRoute('app_announcement_list');
|
||||
return $this->redirectToRoute('app_announcement_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('announcement/add.html.twig', [
|
||||
'announcementForm' => $form,
|
||||
return $this->render('announcement/new.html.twig', [
|
||||
'announcement' => $announcement,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/list', name: '_list')]
|
||||
public function list(): Response
|
||||
#[Route('/{id}', name: 'app_announcement_show', methods: ['GET'])]
|
||||
public function show(Announcement $announcement): Response
|
||||
{
|
||||
$announcements = $this->announcementRepository->findAll();
|
||||
|
||||
return $this->render('announcement/list.html.twig', [
|
||||
'announcements' => $announcements,
|
||||
return $this->render('announcement/show.html.twig', [
|
||||
'announcement' => $announcement,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/update/{id}', name: '_update')]
|
||||
#[IsGranted('ROLE_ADMIN')]
|
||||
public function update(int $id, Request $request): Response
|
||||
#[Route('/{id}/edit', name: 'app_announcement_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, Announcement $announcement, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$announcement = $this->announcementRepository->find($id);
|
||||
$form = $this->createForm(AnnouncementType::class, $announcement);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if($form->isSubmitted() && $form->isValid())
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_announcement_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('announcement/edit.html.twig', [
|
||||
'announcement' => $announcement,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_announcement_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, Announcement $announcement, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$announcement->getId(), $request->getPayload()->getString('_token'))) {
|
||||
$entityManager->remove($announcement);
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('app_announcement_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
#[Route('/{id}/validate', name: 'app_announcement_validate', methods: ['POST'])]
|
||||
public function validate(Request $request, Announcement $announcement, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($announcement->getStatus() !== 'Verified')
|
||||
{
|
||||
$this->entityManager->persist($announcement);
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Annonce modifiéé avec succès.');
|
||||
return $this->redirectToRoute('app_announcement_list');
|
||||
$announcement->setStatus('Verified');
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->render('announcement/add.html.twig', [
|
||||
'formAdd' => $form,
|
||||
]);
|
||||
return $this->redirectToRoute('app_announcement_show',
|
||||
['id' => $announcement->getId()], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
#[Route('/delete/{id}', name: '_delete')]
|
||||
#[IsGranted('ROLE_ADMIN')]
|
||||
public function delete(int $id): Response
|
||||
{
|
||||
$announcement = $this->announcementRepository->find($id);
|
||||
$this->entityManager->remove($announcement);
|
||||
$this->entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_announcement_list');
|
||||
}
|
||||
|
||||
#[Route('/apply/{id}', name: '_apply')]
|
||||
public function applyToAnnouncement(int $id): Response
|
||||
{
|
||||
|
||||
$announcement = $this->announcementRepository->find($id);
|
||||
|
||||
$user = $this->getUser();
|
||||
|
||||
$existingCandidature = $this->entityManager->getRepository(InternApplication::class)->findOneBy([
|
||||
'intern' => $user,
|
||||
'announcement' => $announcement
|
||||
]);
|
||||
|
||||
if($existingCandidature) {
|
||||
$this->addFlash('error', 'Vous avez déjà postulé à cette annonce.');
|
||||
return $this->redirectToRoute('app_announcement_list');
|
||||
}
|
||||
$application = new InternApplication();
|
||||
$application->setIntern($user);
|
||||
$application->setIntern($announcement);
|
||||
$application->setApplicationDate(new \DateTime());
|
||||
|
||||
$this->entityManager->persist($application);
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Votre candidature a été envoyée avec succès.');
|
||||
return $this->redirectToRoute('annonce_list', ['id' => $announcement->getId()]);
|
||||
}
|
||||
|
||||
#[Route('/filterByCompany', name: '_filterByCompany')]
|
||||
public function filterByCompany(int $id): Response
|
||||
{
|
||||
return $this->redirectToRoute('annonce_list', ['id' => $id]);
|
||||
}
|
||||
}
|
||||
|
@ -22,26 +22,6 @@ final class EmployeeController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'app_employee_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$employee = new Employee();
|
||||
$form = $this->createForm(EmployeeType::class, $employee);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($employee);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_employee_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('employee/new.html.twig', [
|
||||
'employee' => $employee,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_employee_show', methods: ['GET'])]
|
||||
public function show(Employee $employee): Response
|
||||
{
|
||||
|
@ -32,6 +32,7 @@ final class FAQController extends AbstractController
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$fAQ->setUpdateDate(new \DateTime());
|
||||
$entityManager->persist($fAQ);
|
||||
$entityManager->flush();
|
||||
|
||||
@ -60,6 +61,7 @@ final class FAQController extends AbstractController
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$fAQ->setUpdateDate(new \DateTime());
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_faq_index', [], Response::HTTP_SEE_OTHER);
|
||||
@ -82,4 +84,4 @@ final class FAQController extends AbstractController
|
||||
|
||||
return $this->redirectToRoute('app_faq_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@ class IndexController extends AbstractController
|
||||
{
|
||||
}
|
||||
|
||||
#[Route('/index', name: 'app_index')]
|
||||
#[Route('/', name: 'app_index')]
|
||||
public function index(): Response
|
||||
{
|
||||
$companies = $this->companyRepository->findAll();
|
||||
@ -43,6 +43,7 @@ class IndexController extends AbstractController
|
||||
}
|
||||
return $this->render('index/index.html.twig', [
|
||||
'companies' => $companiescoord,
|
||||
'id' => $this->getUser()->getId(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -22,26 +22,6 @@ final class InternController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'app_intern_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$intern = new Intern();
|
||||
$form = $this->createForm(InternType::class, $intern);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->persist($intern);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_intern_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('intern/new.html.twig', [
|
||||
'intern' => $intern,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_intern_show', methods: ['GET'])]
|
||||
public function show(Intern $intern): Response
|
||||
{
|
||||
|
@ -3,8 +3,10 @@
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Message;
|
||||
use App\Entity\UserApp;
|
||||
use App\Form\MessageType;
|
||||
use App\Repository\MessageRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -17,27 +19,56 @@ final class MessageController extends AbstractController
|
||||
#[Route(name: 'app_message_index', methods: ['GET'])]
|
||||
public function index(MessageRepository $messageRepository): Response
|
||||
{
|
||||
$user = $this->getUser();
|
||||
$messages = $messageRepository->findLatestMessagesByUser($user);
|
||||
|
||||
return $this->render('message/index.html.twig', [
|
||||
'messages' => $messageRepository->findAll(),
|
||||
'messages' => $messages,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'app_message_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
#[Route('/conversation/{id}', name: 'app_message_conversation', methods: ['GET'])]
|
||||
public function conversation(Message $message, MessageRepository $messageRepository): Response
|
||||
{
|
||||
$user = $this->getUser();
|
||||
$otherUser = $message->getSender() === $user ? $message->getReceiver() : $message->getSender();
|
||||
|
||||
$conversation = $messageRepository->findByConversation($user, $otherUser);
|
||||
|
||||
return $this->render('message/conversation.html.twig', [
|
||||
'conversation' => $conversation,
|
||||
'receiverId' => $otherUser->getId(),
|
||||
'receiver' => $otherUser,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
#[Route('/new/{receiverId}', name: 'app_message_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager, ?int $receiverId = null, UserRepository $userRepository): Response
|
||||
{
|
||||
$message = new Message();
|
||||
|
||||
if ($receiverId) {
|
||||
$receiver = $userRepository->find($receiverId);
|
||||
if ($receiver) {
|
||||
$message->setReceiver($receiver);
|
||||
}
|
||||
}
|
||||
|
||||
$form = $this->createForm(MessageType::class, $message);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$message->setSendingDate(new \DateTime());
|
||||
$message->setSender($this->getUser());
|
||||
|
||||
$entityManager->persist($message);
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_message_index', [], Response::HTTP_SEE_OTHER);
|
||||
return $this->redirectToRoute('app_message_index');
|
||||
}
|
||||
|
||||
return $this->render('message/new.html.twig', [
|
||||
'message' => $message,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
@ -57,6 +88,7 @@ final class MessageController extends AbstractController
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$message->setSendingDate(new \DateTime());
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_message_index', [], Response::HTTP_SEE_OTHER);
|
||||
@ -78,4 +110,6 @@ final class MessageController extends AbstractController
|
||||
|
||||
return $this->redirectToRoute('app_message_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
48
src/Controller/ProfileController.php
Normal file
48
src/Controller/ProfileController.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\UserApp;
|
||||
use App\Form\UserAppType;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class ProfileController extends AbstractController
|
||||
{
|
||||
#[Route('/profile', name: 'app_profile')]
|
||||
public function profile(): Response
|
||||
{
|
||||
// Charger l'utilisateur connecté
|
||||
$user = $this->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,
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('profile/{id}/edit', name: 'app_profile_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, UserApp $userApp, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(UserAppType::class, $userApp);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_profile', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('profile/edit.html.twig', [
|
||||
'user_app' => $userApp,
|
||||
'form' => $form,
|
||||
]);
|
||||
}
|
||||
}
|
@ -37,7 +37,7 @@ class RegistrationController extends AbstractController
|
||||
|
||||
// do anything else you need here, like send an email
|
||||
|
||||
return $security->login($user, 'form_login', 'intern');
|
||||
return $security->login($user, 'form_login', 'main');
|
||||
}
|
||||
|
||||
return $this->render('registration/register.html.twig', [
|
||||
@ -65,7 +65,7 @@ class RegistrationController extends AbstractController
|
||||
|
||||
// do anything else you need here, like send an email
|
||||
|
||||
return $security->login($user, 'form_login', 'employee');
|
||||
return $security->login($user, 'form_login', 'main');
|
||||
}
|
||||
|
||||
return $this->render('registration/register.html.twig', [
|
||||
|
@ -14,7 +14,7 @@ use Symfony\Component\Routing\Attribute\Route;
|
||||
#[Route('/user')]
|
||||
final class UserAppController extends AbstractController
|
||||
{
|
||||
#[Route(name: 'app_user_app_index', methods: ['GET'])]
|
||||
#[Route(name: 'app_user_index', methods: ['GET'])]
|
||||
public function index(UserRepository $userRepository): Response
|
||||
{
|
||||
return $this->render('user_app/index.html.twig', [
|
||||
@ -22,27 +22,7 @@ final class UserAppController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
// #[Route('/new', name: 'app_user_app_new', methods: ['GET', 'POST'])]
|
||||
// public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
// {
|
||||
// $userApp = new UserApp();
|
||||
// $form = $this->createForm(UserAppType::class, $userApp);
|
||||
// $form->handleRequest($request);
|
||||
//
|
||||
// if ($form->isSubmitted() && $form->isValid()) {
|
||||
// $entityManager->persist($userApp);
|
||||
// $entityManager->flush();
|
||||
//
|
||||
// return $this->redirectToRoute('app_user_app_index', [], Response::HTTP_SEE_OTHER);
|
||||
// }
|
||||
//
|
||||
// return $this->render('user_app/new.html.twig', [
|
||||
// 'user_app' => $userApp,
|
||||
// 'form' => $form,
|
||||
// ]);
|
||||
// }
|
||||
|
||||
#[Route('/{id}', name: 'app_user_app_show', methods: ['GET'])]
|
||||
#[Route('/{id}', name: 'app_user_show', methods: ['GET'])]
|
||||
public function show(UserApp $userApp): Response
|
||||
{
|
||||
return $this->render('user_app/show.html.twig', [
|
||||
@ -50,7 +30,7 @@ final class UserAppController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}/edit', name: 'app_user_app_edit', methods: ['GET', 'POST'])]
|
||||
#[Route('/{id}/edit', name: 'app_user_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Request $request, UserApp $userApp, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$form = $this->createForm(UserAppType::class, $userApp);
|
||||
@ -59,7 +39,7 @@ final class UserAppController extends AbstractController
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_user_app_index', [], Response::HTTP_SEE_OTHER);
|
||||
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
return $this->render('user_app/edit.html.twig', [
|
||||
@ -68,7 +48,7 @@ final class UserAppController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/{id}', name: 'app_user_app_delete', methods: ['POST'])]
|
||||
#[Route('/{id}', name: 'app_user_delete', methods: ['POST'])]
|
||||
public function delete(Request $request, UserApp $userApp, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
if ($this->isCsrfTokenValid('delete'.$userApp->getId(), $request->getPayload()->getString('_token'))) {
|
||||
@ -76,6 +56,6 @@ final class UserAppController extends AbstractController
|
||||
$entityManager->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('app_user_app_index', [], Response::HTTP_SEE_OTHER);
|
||||
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
}
|
||||
}
|
@ -22,15 +22,18 @@ class Announcement
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $description = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_MUTABLE)]
|
||||
private ?\DateTimeInterface $creationDate = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'announcements')]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
private ?Company $company = null;
|
||||
|
||||
#[ORM\Column(length: 255,nullable: false)]
|
||||
private ?string $status = "notVerified";
|
||||
#[ORM\Column(nullable: false)]
|
||||
private ?string $status = "notVerfied";
|
||||
|
||||
#[ORM\Column(nullable: false)]
|
||||
private ?string $date = null;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_MUTABLE)]
|
||||
private ?\DateTimeInterface $creationDate = null;
|
||||
|
||||
/**
|
||||
* @var ?Collection<int, InternApplication>
|
||||
@ -96,7 +99,7 @@ class Announcement
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
public function setStatus(?string $status): static
|
||||
public function setStatus(?string $status): self
|
||||
{
|
||||
$this->status = $status;
|
||||
|
||||
@ -174,4 +177,16 @@ class Announcement
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
public function getDate(): ?string
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
public function setDate(string $date): self
|
||||
{
|
||||
$this->date = $date;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
@ -186,18 +186,6 @@ class UserApp implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isVerified(): bool
|
||||
{
|
||||
return $this->isVerified;
|
||||
}
|
||||
|
||||
public function setVerified(bool $isVerified): static
|
||||
{
|
||||
$this->isVerified = $isVerified;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
class AnnouncementType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
@ -20,9 +20,12 @@ class AnnouncementType extends AbstractType
|
||||
->add('description')
|
||||
->add('company', EntityType::class, [
|
||||
'class' => Company::class,
|
||||
'choice_label' => 'id',
|
||||
'choice_label' => 'name',
|
||||
])
|
||||
->add('date', TextType::class, [
|
||||
'label' => 'Date de stage',
|
||||
'required' => true,
|
||||
])
|
||||
->add('submit', SubmitType::class)
|
||||
;
|
||||
}
|
||||
|
||||
@ -32,4 +35,4 @@ class AnnouncementType extends AbstractType
|
||||
'data_class' => Announcement::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
@ -13,11 +13,7 @@ class FAQType extends AbstractType
|
||||
{
|
||||
$builder
|
||||
->add('question')
|
||||
->add('answer')
|
||||
->add('updateDate', null, [
|
||||
'widget' => 'single_text',
|
||||
])
|
||||
;
|
||||
->add('answer');
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
|
@ -15,16 +15,10 @@ class MessageType extends AbstractType
|
||||
{
|
||||
$builder
|
||||
->add('content')
|
||||
->add('sendingDate', null, [
|
||||
'widget' => 'single_text',
|
||||
])
|
||||
->add('sender', EntityType::class, [
|
||||
'class' => UserApp::class,
|
||||
'choice_label' => 'id',
|
||||
])
|
||||
|
||||
->add('receiver', EntityType::class, [
|
||||
'class' => UserApp::class,
|
||||
'choice_label' => 'id',
|
||||
'choice_label' => 'nickname',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
@ -45,14 +45,7 @@ class RegistrationFormType extends AbstractType
|
||||
new NotBlank(),
|
||||
]
|
||||
])
|
||||
// ->add('agreeTerms', CheckboxType::class, [
|
||||
// 'mapped' => false,
|
||||
// 'constraints' => [
|
||||
// new IsTrue([
|
||||
// 'message' => 'Vous devez accepter les conditions d\'utilisation.',
|
||||
// ]),
|
||||
// ],
|
||||
// ])
|
||||
//
|
||||
->add('plainPassword', PasswordType::class, [
|
||||
// instead of being set onto the object directly,
|
||||
// this is read and encoded in the controller
|
||||
|
@ -13,7 +13,6 @@ class UserAppType extends AbstractType
|
||||
{
|
||||
$builder
|
||||
->add('nickname')
|
||||
->add('roles')
|
||||
->add('password')
|
||||
->add('firstName')
|
||||
->add('lastName')
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Message;
|
||||
use App\Entity\UserApp;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
@ -16,28 +17,50 @@ class MessageRepository extends ServiceEntityRepository
|
||||
parent::__construct($registry, Message::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Message[] Returns an array of Message objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('m')
|
||||
// ->andWhere('m.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('m.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
public function findByUser(UserApp $user): array
|
||||
{
|
||||
return $this->createQueryBuilder('m')
|
||||
->where('m.sender = :user OR m.receiver = :user')
|
||||
->setParameter('user', $user)
|
||||
->orderBy('m.sendingDate', 'ASC')
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
public function findByConversation(UserApp $user1, UserApp $user2): array
|
||||
{
|
||||
return $this->createQueryBuilder('m')
|
||||
->where('(m.sender = :user1 AND m.receiver = :user2) OR (m.sender = :user2 AND m.receiver = :user1)')
|
||||
->setParameter('user1', $user1)
|
||||
->setParameter('user2', $user2)
|
||||
->orderBy('m.sendingDate', 'ASC')
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
public function findLatestMessagesByUser(UserApp $user): array
|
||||
{
|
||||
$query = $this->createQueryBuilder('m')
|
||||
->where('m.sender = :user OR m.receiver = :user')
|
||||
->setParameter('user', $user)
|
||||
->orderBy('m.sendingDate', 'DESC')
|
||||
->getQuery()
|
||||
->getResult();
|
||||
|
||||
$lastMessages = [];
|
||||
foreach ($query as $message) {
|
||||
// Identifier l'autre utilisateur dans la conversation
|
||||
$otherUser = $message->getSender() === $user ? $message->getReceiver() : $message->getSender();
|
||||
$key = $otherUser->getId();
|
||||
|
||||
// Conserver uniquement le dernier message avec cet utilisateur
|
||||
if (!isset($lastMessages[$key])) {
|
||||
$lastMessages[$key] = $message;
|
||||
}
|
||||
}
|
||||
|
||||
return $lastMessages;
|
||||
}
|
||||
|
||||
|
||||
// public function findOneBySomeField($value): ?Message
|
||||
// {
|
||||
// return $this->createQueryBuilder('m')
|
||||
// ->andWhere('m.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
|
4
templates/announcement/_delete_form.html.twig
Normal file
4
templates/announcement/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
<form method="post" action="{{ path('app_announcement_delete', {'id': announcement.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ announcement.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/announcement/_form.html.twig
Normal file
4
templates/announcement/_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
@ -1,4 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% block body %}
|
||||
{{ form(announcementForm) }}
|
||||
{% endblock %}
|
63
templates/announcement/edit.html.twig
Normal file
63
templates/announcement/edit.html.twig
Normal file
@ -0,0 +1,63 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Modifier l'Annonce{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold text-center mb-6">Modifier l'Annonce</h1>
|
||||
|
||||
<div class="max-w-4xl mx-auto bg-white p-6 rounded-lg shadow-lg">
|
||||
<form method="post" action="{{ path('app_announcement_edit', { id: announcement.id }) }}" class="space-y-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
<div class="mb-4">
|
||||
<!-- Nom de l'entreprise -->
|
||||
<label for="announcement_company" class="block text-gray-700 font-semibold">Entreprise</label>
|
||||
<div>
|
||||
{{ form_widget(form.company, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Titre de l'annonce -->
|
||||
<div class="mb-4">
|
||||
<label for="announcement_title" class="block text-gray-700 font-semibold">Titre de l'annonce</label>
|
||||
<div>
|
||||
{{ form_widget(form.title, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Description -->
|
||||
<div>
|
||||
<label for="announcement_description" class="block text-gray-700 font-semibold">Description</label>
|
||||
<div>
|
||||
{{ form_widget(form.description, { 'attr': { 'class': 'w-full p-3 border rounded-md' } }) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Date du stage -->
|
||||
<div>
|
||||
<label for="announcement_date" class="block text-gray-700 font-semibold">Date du stage</label>
|
||||
<div>
|
||||
{{ form_widget(form.date, { 'attr': { 'class': 'w-full p-3 border rounded-md' } }) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="text-center">
|
||||
<button type="submit" class="bg-teal-500 text-white px-6 py-3 rounded-md hover:bg-teal-600">
|
||||
Enregistrer les modifications
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Bouton Retour -->
|
||||
<div class="mt-4">
|
||||
<a href="{{ path('app_announcement_index') }}" class="text-teal-500 flex items-center">
|
||||
<i class="fas fa-arrow-left mr-2"></i>Retour à la liste des annonces
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,20 +1,82 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Hello AnnouncementController!{% endblock %}
|
||||
{% block title %}Liste des Annonces{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
|
||||
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
|
||||
</style>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-6 text-center">Liste des Annonces</h1>
|
||||
|
||||
<div class="example-wrapper">
|
||||
<h1>Hello {{ controller_name }}! ✅</h1>
|
||||
{% if 'ROLE_ADMIN' in app.user.roles %}
|
||||
<!-- Formulaire pour afficher uniquement les annonces non validées -->
|
||||
<form method="get" class="mb-6 text-center">
|
||||
<label class="flex items-center justify-center space-x-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
name="show_non_validated"
|
||||
value="1"
|
||||
{% if showNonValidated %}checked{% endif %}
|
||||
class="rounded text-teal-500"
|
||||
>
|
||||
<span class="text-gray-700">Afficher uniquement les annonces non validées</span>
|
||||
</label>
|
||||
<button type="submit" class="ml-4 bg-teal-500 text-white px-4 py-2 rounded mt-2">
|
||||
Appliquer
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
This friendly message is coming from:
|
||||
<ul>
|
||||
<li>Your controller at <code>C:/Users/csese/Romain/Phpstorm_projets/ProjetHegreSphere/hegresphere/src/Controller/AnnouncementController.php</code></li>
|
||||
<li>Your template at <code>C:/Users/csese/Romain/Phpstorm_projets/ProjetHegreSphere/hegresphere/templates/announcement/index.html.twig</code></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if 'ROLE_EMPLOYEE' in app.user.roles %}
|
||||
<!-- Bouton pour créer une annonce -->
|
||||
<div class="text-center mb-6">
|
||||
<a href="{{ path('app_announcement_new') }}" class="bg-teal-500 text-white px-6 py-3 rounded-md hover:bg-teal-600">
|
||||
Créer une annonce
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Liste des annonces -->
|
||||
<div class="max-w-4xl mx-auto">
|
||||
{% for announcement in announcements %}
|
||||
<div class="bg-white p-6 rounded-lg shadow mb-4 relative">
|
||||
<!-- Statut en haut à droite -->
|
||||
<div class="absolute top-4 right-4">
|
||||
{% if announcement.status == 'notVerified' %}
|
||||
<span class="text-red-500 font-semibold">Non validée</span>
|
||||
{% else %}
|
||||
<span class="text-green-500 font-semibold">Validée</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Titre de l'annonce -->
|
||||
<h2 class="text-3xl font-semibold mb-2">{{ announcement.title }}</h2>
|
||||
|
||||
<!-- Nom de l'entreprise -->
|
||||
<p class="text-gray-600 mb-2">{{ announcement.company.name }}</p>
|
||||
|
||||
<div class="text-gray-500 text-sm mb-4">
|
||||
<!-- Date du stage -->
|
||||
<div class="mb-2">
|
||||
<i class="fas fa-calendar-alt mr-1"></i>
|
||||
<span>Date du stage : {{ announcement.date }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Adresse de l'entreprise -->
|
||||
<div>
|
||||
<i class="fas fa-map-marker-alt mr-1"></i>
|
||||
<span>{{ announcement.company.address }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Lien vers la page de détails -->
|
||||
<a href="{{ path('app_announcement_show', { id: announcement.id }) }}"
|
||||
class="bg-teal-500 text-white px-4 py-2 rounded">
|
||||
Détails
|
||||
</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-center text-gray-500">Aucune annonce disponible.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Bienvenue sur Hegreshpere{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<style>
|
||||
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
|
||||
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
|
||||
</style>
|
||||
|
||||
<h1> Liste des annonces</h1>
|
||||
{% for ann in announcements %}
|
||||
<h2> {{ ann.title }} </h2>
|
||||
<h3> {{ ann.company.name }} </h3>
|
||||
<p> {{ ann.description }} </p>
|
||||
------------------------------
|
||||
|
||||
<p> {{ ann.creationDate|format("d-m-y") }} </p>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% endblock %}
|
31
templates/announcement/new.html.twig
Normal file
31
templates/announcement/new.html.twig
Normal file
@ -0,0 +1,31 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Créer une Annonce{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Créer une Annonce</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
<div class="mb-4">
|
||||
{{ form_label(form.title) }}
|
||||
{{ form_widget(form.title, {'attr': {'class': 'form-input w-full p-2 rounded border'}}) }}
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
{{ form_label(form.description) }}
|
||||
{{ form_widget(form.description, {'attr': {'class': 'form-input w-full p-2 rounded border'}}) }}
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
{{ form_label(form.date) }}
|
||||
{{ form_widget(form.date, {'attr': {'class': 'form-input w-full p-2 rounded border'}}) }}
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
{{ form_label(form.company) }}
|
||||
{{ form_widget(form.company, {'attr': {'class': 'form-input w-full p-2 rounded border'}}) }}
|
||||
</div>
|
||||
<button type="submit" class="bg-teal-500 text-white px-4 py-2 rounded">
|
||||
Créer l'annonce
|
||||
</button>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
81
templates/announcement/show.html.twig
Normal file
81
templates/announcement/show.html.twig
Normal file
@ -0,0 +1,81 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Détails de l'Annonce{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-6">Détails de l'Annonce</h1>
|
||||
|
||||
<!-- Détails de l'annonce -->
|
||||
<div class="bg-white p-6 rounded-lg shadow mb-4">
|
||||
<!-- Titre de l'annonce -->
|
||||
<h2 class="text-3xl font-semibold mb-2">{{ announcement.title }}</h2>
|
||||
|
||||
<!-- Nom de l'entreprise -->
|
||||
<p class="text-gray-600 mb-2">{{ announcement.company.name }}</p>
|
||||
|
||||
<div class="text-gray-500 text-sm mb-4">
|
||||
<!-- Date du stage -->
|
||||
<div class="mb-2">
|
||||
<i class="fas fa-calendar-alt mr-1"></i>
|
||||
<span>Date du stage : {{ announcement.date }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Adresse de l'entreprise -->
|
||||
<div>
|
||||
<i class="fas fa-map-marker-alt mr-1"></i>
|
||||
<span>{{ announcement.company.address }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Description du stage -->
|
||||
<div class="mb-4">
|
||||
<strong>Description du stage : </strong>
|
||||
<p>{{ announcement.description }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Statut de l'annonce -->
|
||||
<div class="mb-4">
|
||||
<strong>Statut : </strong>
|
||||
<span class="text-sm {% if announcement.status == 'notVerified' %}text-red-500{% else %}text-green-500{% endif %}">
|
||||
{% if announcement.status == 'notVerified' %}
|
||||
Non validée
|
||||
{% else %}
|
||||
Validée
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Date de création -->
|
||||
<div class="mb-4">
|
||||
<strong>Date de création : </strong>
|
||||
<span>{{ announcement.creationDate | date('d/m/Y') }}</span>
|
||||
</div>
|
||||
|
||||
{% if 'ROLE_ADMIN' in app.user.roles %}
|
||||
|
||||
<!-- Boutons Modifier et Valider -->
|
||||
<div class="mt-4 flex space-x-4">
|
||||
<a href="{{ path('app_announcement_edit', { id: announcement.id }) }}"
|
||||
class="bg-teal-500 text-white px-4 py-2 rounded hover:bg-teal-600">
|
||||
Modifier l'annonce
|
||||
</a>
|
||||
|
||||
{% if announcement.status == 'notVerified' %}
|
||||
<form method="post" action="{{ path('app_announcement_validate', { id: announcement.id }) }}">
|
||||
<button type="submit" class="bg-green-500 text-white px-4 py-2 rounded hover:bg-green-600">
|
||||
Valider l'annonce
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Bouton de retour à la liste -->
|
||||
<a href="{{ path('app_announcement_index') }}" class="text-teal-500 flex items-center mb-4">
|
||||
<i class="fas fa-arrow-left mr-2"></i>Retour à la liste des annonces
|
||||
</a>
|
||||
</div>
|
||||
{% endblock %}
|
@ -5,8 +5,6 @@
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
<title>{% block title %}Hegreshere{% endblock %}</title>
|
||||
|
||||
|
||||
|
||||
{# Tailwind CSS CDN #}
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
@ -20,33 +18,58 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-100">
|
||||
<body class="bg-gray-100 flex flex-col min-h-screen">
|
||||
<header class="bg-gray-900 text-white">
|
||||
<div class="container mx-auto flex justify-between items-center py-4 px-6">
|
||||
<div class="flex items-center">
|
||||
<i class="fas fa-briefcase text-2xl mr-2"></i>
|
||||
<span class="text-xl font-bold">HegreSphere</span>
|
||||
</div>
|
||||
<nav class="space-x-6">
|
||||
<nav class="space-x-20">
|
||||
<a class="hover:text-teal-400" href="{{ path('app_index') }}">Accueil</a>
|
||||
<a class="hover:text-teal-400" href="{{ path('app_index') }}">Stages</a>
|
||||
<a class="hover:text-teal-400" href="{{ path('app_index') }}">À propos de nous</a>
|
||||
<a class="hover:text-teal-400" href="{{ path('app_index') }}">Nous contacter</a>
|
||||
<a class="hover:text-teal-400" href="{{ path('app_announcement_index') }}">Stages</a>
|
||||
<a class="hover:text-teal-400" href="{{ path('app_faq_index') }}">FAQ</a>
|
||||
<a class="hover:text-teal-400" href="{{ path('app_message_index') }}">Messagerie</a>
|
||||
</nav>
|
||||
{% if app.user %}
|
||||
<div>
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full" href="{{ path('app_user_app_show', { id: app.user.id }) }}">
|
||||
<div class="flex space-x-4">
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full" href="{{ path('app_profile') }}">
|
||||
Profil
|
||||
</a>
|
||||
<a class="bg-red-500 hover:bg-red-600 text-white py-2 px-4 rounded-full" href="{{ path('app_logout') }}">
|
||||
Déconnexion
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{# Block for the specific page content #}
|
||||
<main>
|
||||
<main class="flex-grow">
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
</main>
|
||||
|
||||
<footer class="bg-gray-800 text-gray-400">
|
||||
<div class="container mx-auto py-6 px-6 grid grid-cols-1 md:grid-cols-3 gap-6">
|
||||
<!-- Company Info -->
|
||||
<div>
|
||||
<h3 class="text-white text-lg font-bold mb-4">À propos de nous</h3>
|
||||
<p>HegreSphere est une plateforme dédiée aux opportunités de stages et au soutien des étudiants dans leur parcours professionnel.</p>
|
||||
</div>
|
||||
|
||||
<!-- Quick Links -->
|
||||
<div>
|
||||
<h3 class="text-white text-lg font-bold mb-4">Liens utiles</h3>
|
||||
<ul class="space-y-2">
|
||||
<li><a href="{{ path('app_index') }}" class="hover:text-teal-400">Accueil</a></li>
|
||||
<li><a href="{{ path('app_announcement_index') }}" class="hover:text-teal-400">Liste des stages</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h3 class="text-white text-lg font-bold mb-4">Contactez-nous</h3>
|
||||
<p>Email: support@hegresphere.com</p>
|
||||
<p>Téléphone: +33 1 23 45 67 89</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,13 +1,55 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Company{% endblock %}
|
||||
{% block title %}Modifier l'entreprise{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Company</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Modifier l'entreprise</h1>
|
||||
|
||||
{{ include('company/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
<a href="{{ path('app_company_index') }}">back to list</a>
|
||||
<div class="mb-4">
|
||||
<label for="company_name" class="block text-lg font-medium text-gray-700 mb-2">Nom de l'entreprise</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.name, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ include('company/_delete_form.html.twig') }}
|
||||
<div class="mb-4">
|
||||
<label for="company_address" class="block text-lg font-medium text-gray-700 mb-2">Adresse</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.address, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="company_tel" class="block text-lg font-medium text-gray-700 mb-2">Téléphone</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.tel, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="company_mail" class="block text-lg font-medium text-gray-700 mb-2">Email</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.mail, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
|
||||
Mettre à jour l'entreprise
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="{{ path('app_company_index') }}" class="text-teal-500 hover:text-teal-700">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des entreprises
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,41 +1,50 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Company index{% endblock %}
|
||||
{% block title %}Liste des Entreprises{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Company index</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Liste des Entreprises</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Name</th>
|
||||
<th>Address</th>
|
||||
<th>Tel</th>
|
||||
<th>Mail</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for company in companies %}
|
||||
<tr>
|
||||
<td>{{ company.id }}</td>
|
||||
<td>{{ company.name }}</td>
|
||||
<td>{{ company.address }}</td>
|
||||
<td>{{ company.tel }}</td>
|
||||
<td>{{ company.mail }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_company_show', {'id': company.id}) }}">show</a>
|
||||
<a href="{{ path('app_company_edit', {'id': company.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="6">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="overflow-x-auto bg-white shadow-lg rounded-lg">
|
||||
<table class="min-w-full table-auto">
|
||||
<thead>
|
||||
<tr class="bg-gray-800 text-white">
|
||||
<th class="px-4 py-2 text-left">ID</th>
|
||||
<th class="px-4 py-2 text-left">Nom de l'entreprise</th>
|
||||
<th class="px-4 py-2 text-left">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for company in companies %}
|
||||
<tr class="border-b">
|
||||
<td class="px-4 py-2">{{ company.id }}</td>
|
||||
<td class="px-4 py-2">{{ company.name }}</td>
|
||||
<td class="px-4 py-2 flex items-center gap-4">
|
||||
<a href="{{ path('app_company_show', {'id': company.id}) }}" class="text-teal-500 hover:text-teal-700">
|
||||
<i class="fas fa-eye"></i> Voir
|
||||
</a>
|
||||
<a href="{{ path('app_company_edit', {'id': company.id}) }}" class="text-yellow-500 hover:text-yellow-700">
|
||||
<i class="fas fa-edit"></i> Modifier
|
||||
</a>
|
||||
<form method="post" action="{{ path('app_company_delete', {'id': company.id}) }}" style="display:inline;">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ company.id) }}">
|
||||
<button type="submit" class="text-red-500 hover:text-red-700">
|
||||
<i class="fas fa-trash-alt"></i> Supprimer
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<a href="{{ path('app_company_new') }}">Create new</a>
|
||||
<div class="mt-4">
|
||||
<a href="{{ path('app_company_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
|
||||
<i class="fas fa-plus-circle"></i> Ajouter une nouvelle entreprise
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,11 +1,47 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Company{% endblock %}
|
||||
{% block title %}Nouvelle Entreprise{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Company</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-6">Créer une nouvelle entreprise</h1>
|
||||
|
||||
{{ include('company/_form.html.twig') }}
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
<a href="{{ path('app_company_index') }}">back to list</a>
|
||||
<div class="mb-4">
|
||||
<label for="company_name" class="block text-lg font-medium text-gray-700 mb-2">Nom de l'entreprise</label>
|
||||
{{ form_widget(form.name, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="company_address" class="block text-lg font-medium text-gray-700 mb-2">Adresse de l'entreprise</label>
|
||||
{{ form_widget(form.address, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="company_tel" class="block text-lg font-medium text-gray-700 mb-2">Numéro de téléphone</label>
|
||||
{{ form_widget(form.tel, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="company_mail" class="block text-lg font-medium text-gray-700 mb-2">Email de l'entreprise</label>
|
||||
{{ form_widget(form.mail, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
|
||||
Créer l'entreprise
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<a href="{{ path('app_company_index') }}" class="text-teal-500 hover:text-teal-700">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des entreprises
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,38 +1,56 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Company{% endblock %}
|
||||
{% block title %}Détail de l'entreprise{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Company</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Détail de l'entreprise</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ company.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ company.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Address</th>
|
||||
<td>{{ company.address }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Tel</th>
|
||||
<td>{{ company.tel }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Mail</th>
|
||||
<td>{{ company.mail }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<table class="min-w-full">
|
||||
<tbody>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">ID</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ company.id }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Nom</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ company.name }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Adresse</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ company.address }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Téléphone</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ company.tel }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Email</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ company.mail }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<a href="{{ path('app_company_index') }}">back to list</a>
|
||||
<div class="mt-6 flex justify-between">
|
||||
<a href="{{ path('app_company_index') }}" class="text-teal-500 hover:text-teal-700">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des entreprises
|
||||
</a>
|
||||
|
||||
<a href="{{ path('app_company_edit', {'id': company.id}) }}">edit</a>
|
||||
<a href="{{ path('app_company_edit', {'id': company.id}) }}" class="text-yellow-500 hover:text-yellow-700">
|
||||
<i class="fas fa-edit"></i> Modifier cette entreprise
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{ include('company/_delete_form.html.twig') }}
|
||||
<div class="mt-6">
|
||||
<form method="post" action="{{ path('app_company_delete', {'id': company.id}) }}" style="display:inline;">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ company.id) }}">
|
||||
<button type="submit" class="text-red-500 hover:text-red-700">
|
||||
<i class="fas fa-trash-alt"></i> Supprimer cette entreprise
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,13 +1,36 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Degree{% endblock %}
|
||||
{% block title %}Modifier un Diplôme{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Degree</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-4xl font-semibold text-gray-800 mb-6">Modifier le Diplôme</h1>
|
||||
|
||||
{{ include('degree/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<h2 class="text-2xl font-medium text-gray-700 mb-6">Modifier les informations du diplôme</h2>
|
||||
|
||||
<a href="{{ path('app_degree_index') }}">back to list</a>
|
||||
{{ form_start(form) }}
|
||||
<div class="mb-4">
|
||||
<label for="degree_label" class="block text-lg font-medium text-gray-700 mb-2">Label du diplôme</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.label, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ include('degree/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
<div class="mt-6">
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
|
||||
Mettre à jour
|
||||
</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
|
||||
|
||||
<div class="mt-6 flex justify-between">
|
||||
<a href="{{ path('app_degree_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des diplômes
|
||||
</a>
|
||||
|
||||
{{ include('degree/_delete_form.html.twig') }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,35 +1,57 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Degree index{% endblock %}
|
||||
{% block title %}List of Degrees{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Degree index</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Liste des Diplômes</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Label</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for degree in degrees %}
|
||||
<tr>
|
||||
<td>{{ degree.id }}</td>
|
||||
<td>{{ degree.label }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_degree_show', {'id': degree.id}) }}">show</a>
|
||||
<a href="{{ path('app_degree_edit', {'id': degree.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- Tableau des diplômes -->
|
||||
<div class="overflow-x-auto bg-white shadow-lg rounded-lg">
|
||||
<table class="min-w-full table-auto">
|
||||
<thead>
|
||||
<tr class="bg-gray-800 text-white">
|
||||
<th class="px-4 py-2 text-left">ID</th>
|
||||
<th class="px-4 py-2 text-left">Label</th>
|
||||
<th class="px-4 py-2 text-left">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for degree in degrees %}
|
||||
<tr class="border-b">
|
||||
<td class="px-4 py-2">{{ degree.id }}</td>
|
||||
<td class="px-4 py-2">{{ degree.label }}</td>
|
||||
<td class="px-4 py-2">
|
||||
<!-- Voir le diplôme -->
|
||||
<a href="{{ path('app_degree_show', {'id': degree.id}) }}" class="text-teal-500 hover:text-teal-700 mr-3">
|
||||
<i class="fas fa-eye"></i> Voir
|
||||
</a>
|
||||
|
||||
<a href="{{ path('app_degree_new') }}">Create new</a>
|
||||
<!-- Modifier le diplôme -->
|
||||
<a href="{{ path('app_degree_edit', {'id': degree.id}) }}" class="text-yellow-500 hover:text-yellow-700 mr-3">
|
||||
<i class="fas fa-edit"></i> Modifier
|
||||
</a>
|
||||
|
||||
<!-- Formulaire pour supprimer le diplôme -->
|
||||
<form method="post" action="{{ path('app_degree_delete', {'id': degree.id}) }}" style="display:inline;">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ degree.id) }}">
|
||||
<button type="submit" class="text-red-500 hover:text-red-700">
|
||||
<i class="fas fa-trash-alt"></i> Supprimer
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Lien pour ajouter un nouveau diplôme -->
|
||||
<div class="mt-4">
|
||||
<a href="{{ path('app_degree_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
|
||||
<i class="fas fa-plus-circle"></i> Ajouter un nouveau diplôme
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,11 +1,34 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Degree{% endblock %}
|
||||
{% block title %}Créer un Nouveau Diplôme{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Degree</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-4xl font-semibold text-gray-800 mb-6">Créer un Nouveau Diplôme</h1>
|
||||
|
||||
{{ include('degree/_form.html.twig') }}
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
<a href="{{ path('app_degree_index') }}">back to list</a>
|
||||
<div class="mb-6">
|
||||
<label for="degree_label" class="block text-lg font-medium text-gray-700 mb-2">Label du Diplôme</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.label, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
|
||||
Créer le Diplôme
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="{{ path('app_degree_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des diplômes
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,26 +1,42 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Degree{% endblock %}
|
||||
{% block title %}Détail du Diplôme{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Degree</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-4xl font-semibold text-gray-800 mb-6">Détail du Diplôme</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ degree.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Label</th>
|
||||
<td>{{ degree.label }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<table class="min-w-full">
|
||||
<tbody>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">ID</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ degree.id }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Label</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ degree.label }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<a href="{{ path('app_degree_index') }}">back to list</a>
|
||||
<div class="mt-6 flex justify-between">
|
||||
<a href="{{ path('app_degree_index') }}"
|
||||
class="text-teal-500 hover:text-teal-700 text-lg">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des diplômes
|
||||
</a>
|
||||
|
||||
<a href="{{ path('app_degree_edit', {'id': degree.id}) }}">edit</a>
|
||||
|
||||
{{ include('degree/_delete_form.html.twig') }}
|
||||
<div class="flex items-center space-x-4">
|
||||
<a href="{{ path('app_degree_edit', {'id': degree.id}) }}"
|
||||
class="text-yellow-500 hover:text-yellow-700 text-lg">
|
||||
<i class="fas fa-edit"></i> Modifier ce diplôme
|
||||
</a>
|
||||
<a href="{{ path('app_degree_delete', {'id': degree.id}) }}"
|
||||
class="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg">
|
||||
<i class="fas fa-trash-alt"></i> Supprimer
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -45,5 +45,4 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_employee_new') }}">Create new</a>
|
||||
{% endblock %}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% extends 'base.html.twig' %} <a href="{{ path('app_employee_new') }}">Create new</a>
|
||||
|
||||
|
||||
{% block title %}New Employee{% endblock %}
|
||||
|
||||
|
@ -1,13 +1,40 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit FAQ{% endblock %}
|
||||
{% block title %}Modifier la FAQ{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit FAQ</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Modifier la FAQ</h1>
|
||||
|
||||
{{ include('faq/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
<a href="{{ path('app_faq_index') }}">back to list</a>
|
||||
<div class="mb-4">
|
||||
<label for="faq_question" class="block text-lg font-medium text-gray-700 mb-2">Question</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.question, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ include('faq/_delete_form.html.twig') }}
|
||||
<div class="mb-4">
|
||||
<label for="faq_answer" class="block text-lg font-medium text-gray-700 mb-2">Réponse</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.answer, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
|
||||
Mettre à jour la FAQ
|
||||
</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="{{ path('app_faq_index') }}" class="text-teal-500 hover:text-teal-700">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des FAQs
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,39 +1,55 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}FAQ index{% endblock %}
|
||||
{% block title %}Liste des FAQs{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>FAQ index</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Liste des FAQs</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Question</th>
|
||||
<th>Answer</th>
|
||||
<th>UpdateDate</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for faq in faqs %}
|
||||
<tr>
|
||||
<td>{{ faq.id }}</td>
|
||||
<td>{{ faq.question }}</td>
|
||||
<td>{{ faq.answer }}</td>
|
||||
<td>{{ faq.updateDate ? faq.updateDate|date('Y-m-d') : '' }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_faq_show', {'id': faq.id}) }}">show</a>
|
||||
<a href="{{ path('app_faq_edit', {'id': faq.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="5">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="overflow-x-auto bg-white shadow-lg rounded-lg">
|
||||
<table class="min-w-full table-auto">
|
||||
<thead>
|
||||
<tr class="bg-gray-800 text-white">
|
||||
<th class="px-4 py-2 text-left">Question</th>
|
||||
<th class="px-4 py-2 text-left">Réponse</th>
|
||||
<th class="px-4 py-2 text-left">Denrnière modif</th>
|
||||
<th class="px-4 py-2 text-left">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for faq in faqs %}
|
||||
<tr class="border-b">
|
||||
<td class="px-4 py-2">{{ faq.question }}</td>
|
||||
<td class="px-4 py-2">{{ faq.answer }}</td>
|
||||
<td class="px-4 py-2">{{ faq.updateDate|date("d-m-y") }}</td>
|
||||
<td class="px-4 py-2">
|
||||
<a href="{{ path('app_faq_show', {'id': faq.id}) }}" class="text-teal-500 hover:text-teal-700 mr-3">
|
||||
<i class="fas fa-eye"></i> Voir
|
||||
</a>
|
||||
|
||||
<a href="{{ path('app_faq_new') }}">Create new</a>
|
||||
<a href="{{ path('app_faq_edit', {'id': faq.id}) }}" class="text-yellow-500 hover:text-yellow-700 mr-3">
|
||||
<i class="fas fa-edit"></i> Modifier
|
||||
</a>
|
||||
|
||||
<form method="post" action="{{ path('app_faq_delete', {'id': faq.id}) }}" style="display:inline;">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ faq.id) }}">
|
||||
<button type="submit" class="text-red-500 hover:text-red-700">
|
||||
<i class="fas fa-trash-alt"></i> Supprimer
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<a href="{{ path('app_faq_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
|
||||
<i class="fas fa-plus-circle"></i> Ajouter une FAQ
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,11 +1,40 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New FAQ{% endblock %}
|
||||
{% block title %}Créer une FAQ{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new FAQ</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Créer une nouvelle FAQ</h1>
|
||||
|
||||
{{ include('faq/_form.html.twig') }}
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
<a href="{{ path('app_faq_index') }}">back to list</a>
|
||||
<div class="mb-4">
|
||||
<label for="faq_question" class="block text-lg font-medium text-gray-700 mb-2">Question</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.question, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label for="faq_answer" class="block text-lg font-medium text-gray-700 mb-2">Réponse</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.answer, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
|
||||
Créer la FAQ
|
||||
</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="{{ path('app_faq_index') }}" class="text-teal-500 hover:text-teal-700">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des FAQs
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,34 +1,48 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}FAQ{% endblock %}
|
||||
{% block title %}Détail de la FAQ{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>FAQ</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Détail de la FAQ</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ faq.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Question</th>
|
||||
<td>{{ faq.question }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Answer</th>
|
||||
<td>{{ faq.answer }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>UpdateDate</th>
|
||||
<td>{{ faq.updateDate ? faq.updateDate|date('Y-m-d') : '' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<table class="min-w-full">
|
||||
<tbody>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">ID</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ faq.id }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Question</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ faq.question }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Réponse</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ faq.answer }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="mt-6 flex justify-between">
|
||||
<!-- Bouton Retour à la liste -->
|
||||
<a href="{{ path('app_faq_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des FAQs
|
||||
</a>
|
||||
|
||||
<a href="{{ path('app_faq_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_faq_edit', {'id': faq.id}) }}">edit</a>
|
||||
|
||||
{{ include('faq/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
<!-- Boutons Modifier et Supprimer -->
|
||||
<div class="flex items-center space-x-4">
|
||||
<a href="{{ path('app_faq_edit', {'id': faq.id}) }}" class="text-yellow-500 hover:text-yellow-700 text-lg">
|
||||
<i class="fas fa-edit"></i> Modifier cette FAQ
|
||||
</a>
|
||||
<form method="post" action="{{ path('app_faq_delete', {'id': faq.id}) }}" style="display:inline;">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ faq.id) }}">
|
||||
<button type="submit" class="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg">
|
||||
<i class="fas fa-trash-alt"></i> Supprimer
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@ -3,8 +3,8 @@
|
||||
{% block title %}Accueil - Job Portal{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="L" />
|
||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin="L"></script>
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="anonymous" />
|
||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin="anonymous"></script>
|
||||
<script src="https://maps.google.com/maps/api/js?sensor=false"></script>
|
||||
{# <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBugXaHb_TDr1YhckLB2FrWJpPfnh9SN5g&libraries=geometry">#}
|
||||
<section class="bg-cover bg-center py-20" style="background-image: url('{{ asset('images/fond_site.png') }}');">
|
||||
@ -24,6 +24,7 @@
|
||||
</label>
|
||||
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-6 rounded">Trouvez un stage</button>
|
||||
</div>
|
||||
<p class="text-black"> la recherche n'est pas encore implémenté </p>
|
||||
</div>
|
||||
<div class="flex justify-center space-x-8 mt-8">
|
||||
<div class="text-center">
|
||||
@ -56,39 +57,4 @@
|
||||
var marker = L.marker([coordX,coordY]).addTo(map).bindPopup(name);
|
||||
{% endfor %}
|
||||
</script>
|
||||
<section class="container mx-auto py-12">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h2 class="text-2xl font-bold">Propositions de stages </h2>
|
||||
<a class="text-teal-500 hover:underline" href="{{ path('app_announcement_list') }}">Voir tout</a>
|
||||
</div>
|
||||
<div class="space-y-6">
|
||||
{# Loop over recent offers (replace with dynamic data)
|
||||
{% for offer in recent_offers %}
|
||||
<div class="bg-white p-6 rounded-lg shadow flex justify-between items-center">
|
||||
<div class="flex items-center space-x-4">
|
||||
<div class="text-gray-500 text-sm">{{ offer.time_ago }}</div>
|
||||
<div>
|
||||
<h3 class="text-lg font-bold">{{ offer.title }}</h3>
|
||||
<p class="text-gray-600">{{ offer.company }}</p>
|
||||
<div class="flex items-center space-x-2 text-gray-500 text-sm mt-2">
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-briefcase mr-1"></i> {{ offer.category }}
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-clock mr-1"></i> {{ offer.type }}
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-dollar-sign mr-1"></i> {{ offer.salary }}
|
||||
</span>
|
||||
<span class="flex items-center">
|
||||
<i class="fas fa-map-marker-alt mr-1"></i> {{ offer.location }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded">Détails de l'offre</button>
|
||||
</div>
|
||||
{% endfor %}#}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
@ -48,6 +48,4 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_intern_new') }}">Create new</a>
|
||||
{% endblock %}
|
||||
|
29
templates/message/conversation.html.twig
Normal file
29
templates/message/conversation.html.twig
Normal file
@ -0,0 +1,29 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Conversation{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-6 text-center">Conversation avec {{ receiver.nickname }}</h1>
|
||||
|
||||
<div class="conversation bg-gray-100 p-6 rounded-lg shadow-lg">
|
||||
{% for msg in conversation %}
|
||||
<div class="message {% if msg.sender == app.user %}bg-teal-500 text-white self-end{% else %}bg-gray-200 text-gray-700 self-start{% endif %} p-4 my-2 rounded-lg max-w-xs">
|
||||
<p class="font-semibold">{{ msg.sender.nickname }} :</p>
|
||||
<p class="mt-2">{{ msg.content }}</p>
|
||||
<p class="text-xs text-gray-500 mt-2">{{ msg.sendingDate|date('Y-m-d H:i:s') }}</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Bouton pour répondre -->
|
||||
<div class="mt-4 text-center">
|
||||
<a href="{{ path('app_message_new', {'receiverId': receiverId}) }}" class="bg-teal-500 text-white px-6 py-3 rounded-md hover:bg-teal-600">
|
||||
Répondre
|
||||
</a>
|
||||
</div>
|
||||
<a href="{{ path('app_message_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des Messages
|
||||
</a>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,37 +1,44 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Message index{% endblock %}
|
||||
{% block title %}Boîte de Réception{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Message index</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-6 text-center">Boîte de Réception</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Content</th>
|
||||
<th>SendingDate</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for message in messages %}
|
||||
<tr>
|
||||
<td>{{ message.id }}</td>
|
||||
<td>{{ message.content }}</td>
|
||||
<td>{{ message.sendingDate ? message.sendingDate|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_message_show', {'id': message.id}) }}">show</a>
|
||||
<a href="{{ path('app_message_edit', {'id': message.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="4">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- Bouton pour écrire un nouveau message -->
|
||||
<div class="mb-6 text-center">
|
||||
<a href="{{ path('app_message_new', {'receiverId': app.user.id}) }}" class="bg-teal-500 text-white px-6 py-3 rounded-md hover:bg-teal-600">
|
||||
Écrire un Nouveau Message
|
||||
</a>
|
||||
|
||||
<a href="{{ path('app_message_new') }}">Create new</a>
|
||||
</div>
|
||||
|
||||
<!-- Liste des messages reçus -->
|
||||
<div class="max-w-4xl mx-auto">
|
||||
{% for message in messages %}
|
||||
<div class="bg-white p-6 rounded-lg shadow mb-4">
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<h2 class="text-xl font-semibold">
|
||||
De :
|
||||
{% if message.sender == app.user %}
|
||||
{{ message.receiver.nickname }}
|
||||
{% else %}
|
||||
{{ message.sender.nickname }}
|
||||
{% endif %}
|
||||
</h2>
|
||||
<p class="text-gray-600">{{ message.sendingDate|date('d/m/Y H:i') }}</p>
|
||||
</div>
|
||||
<a href="{{ path('app_message_conversation', { id: message.id }) }}" class="bg-teal-500 text-white px-4 py-2 rounded hover:bg-teal-600">
|
||||
Voir la Conversation
|
||||
</a>
|
||||
</div>
|
||||
<p class="mt-4 text-gray-700">{{ message.content }}</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-center text-gray-500">Vous n'avez reçu aucun message.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,11 +1,27 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Message{% endblock %}
|
||||
{% block title %}Nouveau Message{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Message</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-6 text-center">Écrire un Nouveau Message</h1>
|
||||
|
||||
{{ include('message/_form.html.twig') }}
|
||||
<div class="max-w-lg mx-auto bg-white p-6 rounded-lg shadow">
|
||||
{{ form_start(form) }}
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700 font-medium mb-2">Destinataire</label>
|
||||
{{ form_widget(form.receiver, {'attr': {'class': 'w-full p-3 border rounded'}}) }}
|
||||
</div>
|
||||
|
||||
<a href="{{ path('app_message_index') }}">back to list</a>
|
||||
{% endblock %}
|
||||
<div class="mb-4">
|
||||
<label class="block text-gray-700 font-medium mb-2">Message</label>
|
||||
{{ form_widget(form.content, {'attr': {'class': 'w-full p-3 border rounded', 'rows': 6}}) }}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="w-full bg-teal-500 text-white px-4 py-2 rounded hover:bg-teal-600">
|
||||
Envoyer
|
||||
</button>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,30 +1,28 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Message{% endblock %}
|
||||
{% block title %}Voir le Message{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Message</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-6 text-center">Message de {{ message.sender.nickname }}</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ message.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Content</th>
|
||||
<td>{{ message.content }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>SendingDate</th>
|
||||
<td>{{ message.sendingDate ? message.sendingDate|date('Y-m-d H:i:s') : '' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="max-w-lg mx-auto bg-white p-6 rounded-lg shadow">
|
||||
<div class="mb-4">
|
||||
<p class="text-gray-700"><strong>De :</strong> {{ message.sender.nickname }}</p>
|
||||
<p class="text-gray-700"><strong>Reçu le :</strong> {{ message.sendingDate|date('d/m/Y H:i') }}</p>
|
||||
</div>
|
||||
|
||||
<a href="{{ path('app_message_index') }}">back to list</a>
|
||||
<div class="bg-gray-100 p-4 rounded mb-6">
|
||||
<p class="text-gray-800 whitespace-pre-line">{{ message.content }}</p>
|
||||
</div>
|
||||
|
||||
<a href="{{ path('app_message_edit', {'id': message.id}) }}">edit</a>
|
||||
|
||||
{{ include('message/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
||||
<!-- Bouton pour répondre -->
|
||||
<div class="text-center">
|
||||
<a href="{{ path('app_message_new', {'receiver': message.sender.id}) }}"
|
||||
class="bg-teal-500 text-white px-6 py-2 rounded hover:bg-teal-600">
|
||||
Répondre
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
32
templates/profile/edit.html.twig
Normal file
32
templates/profile/edit.html.twig
Normal file
@ -0,0 +1,32 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Modifier l'utilisateur{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-4xl font-semibold text-gray-800 mb-6">Modifier l'utilisateur</h1>
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
<div class="space-y-6">
|
||||
{{ form_row(form.nickname, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.firstName, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.lastName, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.tel, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.address, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.mail, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.password, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white px-6 py-3 rounded-lg mt-4">
|
||||
Mettre à jour
|
||||
</button>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
7
templates/profile/employee.html.twig
Normal file
7
templates/profile/employee.html.twig
Normal file
@ -0,0 +1,7 @@
|
||||
<div class="bg-white p-6 rounded-lg shadow-md">
|
||||
<h2 class="text-xl font-semibold mb-4">Bonjour {{ app.user.firstName }} {{ app.user.lastName }}</h2>
|
||||
<p class="text-gray-700">Vous êtes employé(e) chez {{ app.user.company }}.</p>
|
||||
<p class="text-gray-600">Adresse : {{ app.user.address }}</p>
|
||||
<p class="text-gray-600">Téléphone : {{ app.user.tel }}</p>
|
||||
<p class="text-gray-600">Email : {{ app.user.mail }}</p>
|
||||
</div>
|
49
templates/profile/index.html.twig
Normal file
49
templates/profile/index.html.twig
Normal file
@ -0,0 +1,49 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Profil{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container mx-auto px-4 py-6">
|
||||
<h1 class="text-2xl font-bold mb-4">Profil</h1>
|
||||
|
||||
<!-- Vue spécifique pour le stagiaire -->
|
||||
{% if 'ROLE_INTERN' in app.user.roles %}
|
||||
{% include 'profile/intern.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Vue spécifique pour l'employé -->
|
||||
{% if 'ROLE_EMPLOYEE' in app.user.roles %}
|
||||
{% include 'profile/employee.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
{% if 'ROLE_ADMIN' in app.user.roles%}
|
||||
<div>
|
||||
<h1 class="text-4xl font-bold ml-kdn "> Vous etes admin</h1>
|
||||
<br>
|
||||
<div>
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
||||
href="{{ path('app_degree_index') }}"> Gestion des diplômes
|
||||
</a>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
||||
href="{{ path('app_skill_index') }}"> Gestion des compétences
|
||||
</a>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
||||
href="{{ path('app_company_index') }}"> Gestion des entreprises
|
||||
</a>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
||||
href="{{ path('app_faq_index') }}"> Gestion des FAQ
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
53
templates/profile/intern.html.twig
Normal file
53
templates/profile/intern.html.twig
Normal file
@ -0,0 +1,53 @@
|
||||
<div class="bg-white p-6 rounded-lg shadow-md">
|
||||
<h2 class="text-xl font-semibold mb-4">Bonjour {{ app.user.nickname }}</h2>
|
||||
<p class="text-gray-700">Vous êtes à la recherche d'un stage.</p>
|
||||
<br>
|
||||
<p class="text-gray-600">Nom : {{ app.user.firstName }}</p>
|
||||
<p class="text-gray-600">Prénom : {{ app.user.lastName }}</p>
|
||||
<p class="text-gray-600">Adresse : {{ app.user.address }}</p>
|
||||
<p class="text-gray-600">Téléphone : {{ app.user.tel }}</p>
|
||||
<p class="text-gray-600">Email : {{ app.user.mail }}</p>
|
||||
|
||||
<h3 class="text-lg font-semibold mt-6">Vos diplômes :</h3>
|
||||
<ul class="list-disc list-inside text-gray-800">
|
||||
{% if app.user.degrees|length > 0 %}
|
||||
{% for deg in app.user.degrees %}
|
||||
<li>{{ deg.label }}</li>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<br>
|
||||
Aucun pour le moment
|
||||
{% endif %}
|
||||
</ul>
|
||||
<br>
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
||||
href="{{ path('app_user_edit',{id: app.user.id}) }}"> Selectionner vos diplômes
|
||||
</a>
|
||||
|
||||
<h3 class="text-lg font-semibold mt-6">Vos compétences :</h3>
|
||||
<ul class="list-disc list-inside text-gray-800">
|
||||
{% if app.user.skills|length > 0 %}
|
||||
{% for comp in app.user.skills %}
|
||||
<li>{{ comp.label }}</li>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<br>
|
||||
Aucune pour le moment
|
||||
{% endif %}
|
||||
</ul>
|
||||
<br>
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
||||
href="{{ path('app_user_edit',{id: app.user.id}) }}"> Selectionner vos compétences
|
||||
</a>
|
||||
|
||||
<div class="flex justify-center mt-6">
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
||||
href="{{ path('app_user_edit',{id: app.user.id}) }}"> Accéder aux favoris
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex justify-end mt-6">
|
||||
<a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
|
||||
href="{{ path('app_profile_edit',{id: app.user.id}) }}"> Modifier
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
@ -7,10 +7,10 @@
|
||||
<div class="bg-white p-8 rounded-lg shadow-md w-full max-w-md">
|
||||
<h2 class="text-2xl font-bold text-center mb-2">Connexion</h2>
|
||||
<p class="text-center text-gray-600 mb-6">
|
||||
Pas encore inscrit ? Inscrivez vous !! <br>
|
||||
<a href="{{ path('app_register_intern') }}" class="text-teal-600 hover:underline">En tant que stagiaire</a>
|
||||
<br>
|
||||
<a href="{{ path('app_register_employee') }}" class="text-teal-600 hover:underline">En tant qu'entreprise</a>
|
||||
Pas encore inscrit ? Inscrivez vous ! <br>
|
||||
<a href="{{ path('app_register_intern') }}" class="text-teal-600 hover:underline">En tant que Stagiaire</a>
|
||||
|
|
||||
<a href="{{ path('app_register_employee') }}" class="text-teal-600 hover:underline">En tant qu'Entreprise</a>
|
||||
</p>
|
||||
|
||||
<form method="post">
|
||||
|
@ -1,13 +1,48 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Skill{% endblock %}
|
||||
{% block title %}Modifier la compétence{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Skill</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-4xl font-semibold text-gray-800 mb-6">Modifier la compétence</h1>
|
||||
|
||||
{{ include('skill/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<h2 class="text-2xl font-medium text-gray-700 mb-6">Modifier les informations de la compétence</h2>
|
||||
|
||||
<a href="{{ path('app_skill_index') }}">back to list</a>
|
||||
{{ form_start(form) }}
|
||||
<div class="mb-4">
|
||||
<label for="skill_label" class="block text-lg font-medium text-gray-700 mb-2">Label de la compétence</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.label, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ include('skill/_delete_form.html.twig') }}
|
||||
<div class="mt-6">
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
|
||||
Mettre à jour
|
||||
</button>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-between items-center">
|
||||
<a href="{{ path('app_skill_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des compétences
|
||||
</a>
|
||||
|
||||
<div class="flex items-center space-x-4">
|
||||
<a href="{{ path('app_skill_show', {'id': skill.id}) }}" class="bg-yellow-500 hover:bg-yellow-600 text-white px-4 py-2 rounded-lg">
|
||||
Voir la compétence
|
||||
</a>
|
||||
|
||||
<form method="post" action="{{ path('app_skill_delete', {'id': skill.id}) }}" style="display:inline;">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ skill.id) }}">
|
||||
<button type="submit" class="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg">
|
||||
Supprimer
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,35 +1,52 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Skill index{% endblock %}
|
||||
{% block title %}Liste des Compétences{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Skill index</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Liste des Compétences</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Label</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for skill in skills %}
|
||||
<tr>
|
||||
<td>{{ skill.id }}</td>
|
||||
<td>{{ skill.label }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_skill_show', {'id': skill.id}) }}">show</a>
|
||||
<a href="{{ path('app_skill_edit', {'id': skill.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="overflow-x-auto bg-white shadow-lg rounded-lg">
|
||||
<table class="min-w-full table-auto">
|
||||
<thead>
|
||||
<tr class="bg-gray-800 text-white">
|
||||
<th class="px-4 py-2 text-left">ID</th>
|
||||
<th class="px-4 py-2 text-left">Label</th>
|
||||
<th class="px-4 py-2 text-left">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for skill in skills %}
|
||||
<tr class="border-b">
|
||||
<td class="px-4 py-2">{{ skill.id }}</td>
|
||||
<td class="px-4 py-2">{{ skill.label }}</td>
|
||||
<td class="px-4 py-2">
|
||||
<a href="{{ path('app_skill_show', {'id': skill.id}) }}" class="text-teal-500 hover:text-teal-700 mr-3">
|
||||
<i class="fas fa-eye"></i> Voir
|
||||
</a>
|
||||
|
||||
<a href="{{ path('app_skill_new') }}">Create new</a>
|
||||
<a href="{{ path('app_skill_edit', {'id': skill.id}) }}" class="text-yellow-500 hover:text-yellow-700 mr-3">
|
||||
<i class="fas fa-edit"></i> Modifier
|
||||
</a>
|
||||
|
||||
<form method="post" action="{{ path('app_skill_delete', {'id': skill.id}) }}" style="display:inline;">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ skill.id) }}">
|
||||
<button type="submit" class="text-red-500 hover:text-red-700">
|
||||
<i class="fas fa-trash-alt"></i> Supprimer
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<a href="{{ path('app_skill_new') }}" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full">
|
||||
<i class="fas fa-plus-circle"></i> Ajouter une nouvelle compétence
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,11 +1,34 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Skill{% endblock %}
|
||||
{% block title %}Créer une Nouvelle Compétence{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Skill</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-4xl font-semibold text-gray-800 mb-6">Créer une Nouvelle Compétence</h1>
|
||||
|
||||
{{ include('skill/_form.html.twig') }}
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
<a href="{{ path('app_skill_index') }}">back to list</a>
|
||||
<div class="mb-6">
|
||||
<label for="skill_label" class="block text-lg font-medium text-gray-700 mb-2">Label de la compétence</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.label, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
|
||||
Créer la Compétence
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="{{ path('app_skill_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des compétences
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,26 +1,34 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Skill{% endblock %}
|
||||
{% block title %}Créer une Nouvelle Compétence{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Skill</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-4xl font-semibold text-gray-800 mb-6">Créer une Nouvelle Compétence</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ skill.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Label</th>
|
||||
<td>{{ skill.label }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
<a href="{{ path('app_skill_index') }}">back to list</a>
|
||||
<div class="mb-6">
|
||||
<label for="skill_label" class="block text-lg font-medium text-gray-700 mb-2">Label de la compétence</label>
|
||||
<div class="mt-1">
|
||||
{{ form_widget(form.label, {'attr': {'class': 'block w-full p-2 border rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-teal-500'}}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="{{ path('app_skill_edit', {'id': skill.id}) }}">edit</a>
|
||||
<div class="mt-6">
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full w-full">
|
||||
Créer la Compétence
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ include('skill/_delete_form.html.twig') }}
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<a href="{{ path('app_skill_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des compétences
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,13 +1,49 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit UserApp{% endblock %}
|
||||
{% block title %}Modifier l'utilisateur{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit UserApp</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-4xl font-semibold text-gray-800 mb-6">Modifier l'utilisateur</h1>
|
||||
|
||||
{{ include('user_app/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
{{ form_start(form) }}
|
||||
|
||||
<a href="{{ path('app_user_app_index') }}">back to list</a>
|
||||
<div class="space-y-6">
|
||||
{{ form_row(form.nickname, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.firstName, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.lastName, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.tel, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.address, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.mail, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
{{ form_row(form.password, {'attr': {'class': 'w-full p-3 border rounded-md'}}) }}
|
||||
</div>
|
||||
|
||||
{{ include('user_app/_delete_form.html.twig') }}
|
||||
<div class="mt-6">
|
||||
{{ form_widget(form) }}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="bg-teal-500 hover:bg-teal-600 text-white px-6 py-3 rounded-lg mt-4">
|
||||
Mettre à jour
|
||||
</button>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-between items-center">
|
||||
<a href="{{ path('app_user_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des utilisateurs
|
||||
</a>
|
||||
|
||||
<div class="flex items-center space-x-4">
|
||||
<a href="{{ path('app_user_show', {'id': user_app.id}) }}" class="bg-yellow-500 hover:bg-yellow-600 text-white px-4 py-2 rounded-lg">
|
||||
Voir l'utilisateur
|
||||
</a>
|
||||
|
||||
<a href="{{ path('app_user_delete', {'id': user_app.id}) }}" class="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg">
|
||||
Supprimer
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,49 +1,56 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}UserApp index{% endblock %}
|
||||
{% block title %}Liste des utilisateurs{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>UserApp index</h1>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Liste des Utilisateurs</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nickname</th>
|
||||
<th>Roles</th>
|
||||
<th>Password</th>
|
||||
<th>FirstName</th>
|
||||
<th>LastName</th>
|
||||
<th>Tel</th>
|
||||
<th>Address</th>
|
||||
<th>Mail</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user_app in user_apps %}
|
||||
<tr>
|
||||
<td>{{ user_app.id }}</td>
|
||||
<td>{{ user_app.nickname }}</td>
|
||||
<td>{{ user_app.roles ? user_app.roles|json_encode : '' }}</td>
|
||||
<td>{{ user_app.password }}</td>
|
||||
<td>{{ user_app.firstName }}</td>
|
||||
<td>{{ user_app.lastName }}</td>
|
||||
<td>{{ user_app.tel }}</td>
|
||||
<td>{{ user_app.address }}</td>
|
||||
<td>{{ user_app.mail }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_user_app_show', {'id': user_app.id}) }}">show</a>
|
||||
<a href="{{ path('app_user_app_edit', {'id': user_app.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="10">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="overflow-x-auto bg-white shadow-lg rounded-lg">
|
||||
<table class="min-w-full table-auto">
|
||||
<thead>
|
||||
<tr class="bg-gray-800 text-white">
|
||||
<th class="px-4 py-2 text-left">ID</th>
|
||||
<th class="px-4 py-2 text-left">Nickname</th>
|
||||
<th class="px-4 py-2 text-left">FirstName</th>
|
||||
<th class="px-4 py-2 text-left">LastName</th>
|
||||
<th class="px-4 py-2 text-left">Mail</th>
|
||||
<th class="px-4 py-2 text-left">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user_app in user_apps %}
|
||||
<tr class="border-b">
|
||||
<td class="px-4 py-2">{{ user_app.id }}</td>
|
||||
<td class="px-4 py-2">{{ user_app.nickname }}</td>
|
||||
<td class="px-4 py-2">{{ user_app.firstName }}</td>
|
||||
<td class="px-4 py-2">{{ user_app.lastName }}</td>
|
||||
<td class="px-4 py-2">{{ user_app.mail }}</td>
|
||||
<td class="px-4 py-2">
|
||||
<a href="{{ path('app_user_show', {'id': user_app.id}) }}" class="text-teal-500 hover:text-teal-700 mr-3">
|
||||
<i class="fas fa-eye"></i> Voir
|
||||
</a>
|
||||
|
||||
<a href="{{ path('app_user_app_new') }}">Create new</a>
|
||||
{% endblock %}
|
||||
<a href="{{ path('app_user_edit', {'id': user_app.id}) }}" class="text-yellow-500 hover:text-yellow-700 mr-3">
|
||||
<i class="fas fa-edit"></i> Modifier
|
||||
</a>
|
||||
|
||||
<form method="post" action="{{ path('app_user_delete', {'id': user_app.id}) }}" style="display:inline;">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ user_app.id) }}">
|
||||
<button type="submit" class="text-red-500 hover:text-red-700">
|
||||
<i class="fas fa-trash-alt"></i> Supprimer
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="6" class="text-center py-4">Aucun utilisateur trouvé</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,42 +1,58 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}UserApp{% endblock %}
|
||||
{% block title %}Détail de l'utilisateur{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="gap-y-5">
|
||||
<div class="flex gap-x-5">
|
||||
<p class="font-bold">Nom d'utilisateur : </p>
|
||||
<p>{{ user_app.nickname }}</p>
|
||||
</div>
|
||||
<div class="flex gap-x-5">
|
||||
<p class="font-bold">Rôles : </p>
|
||||
<p>{{ user_app.roles ? user_app.roles|json_encode : '' }}</p>
|
||||
</div>
|
||||
<div class="flex gap-x-5">
|
||||
<p class="font-bold">Prénom : </p>
|
||||
<p>{{ user_app.firstName }}</p>
|
||||
</div>
|
||||
<div class="flex gap-x-5">
|
||||
<p class="font-bold">Nom : </p>
|
||||
<p>{{ user_app.lastName }}</p>
|
||||
</div>
|
||||
<div class="flex gap-x-5">
|
||||
<p class="font-bold">Téléphone : </p>
|
||||
<p>{{ user_app.tel }}</p>
|
||||
</div>
|
||||
<div class="flex gap-x-5">
|
||||
<p class="font-bold">Addresse : </p>
|
||||
<p>{{ user_app.address }}</p>
|
||||
</div>
|
||||
<div class="flex gap-x-5">
|
||||
<p class="font-bold">Mail : </p>
|
||||
<p>{{ user_app.mail }}</p>
|
||||
<div class="container mx-auto p-6">
|
||||
<h1 class="text-4xl font-semibold text-gray-800 mb-6">Détail de l'utilisateur</h1>
|
||||
|
||||
<div class="bg-white shadow-md rounded-lg p-6">
|
||||
<table class="min-w-full">
|
||||
<tbody>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">ID</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ user_app.id }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Nom</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ user_app.lastName }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Prénom</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ user_app.firstName }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Téléphone</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ user_app.tel }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">Adresse</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ user_app.address }}</td>
|
||||
</tr>
|
||||
<tr class="border-b">
|
||||
<th class="px-6 py-4 text-lg font-medium text-gray-700">E-mail</th>
|
||||
<td class="px-6 py-4 text-lg text-gray-900">{{ user_app.mail }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<a href="{{ path('app_user_app_edit', {'id': user_app.id}) }}">Modifier</a>
|
||||
<div class="mt-6 flex justify-between">
|
||||
<a href="{{ path('app_user_index') }}" class="text-teal-500 hover:text-teal-700 text-lg">
|
||||
<i class="fas fa-arrow-left"></i> Retour à la liste des utilisateurs
|
||||
</a>
|
||||
|
||||
{{ include('user_app/_delete_form.html.twig') }}
|
||||
<div class="flex items-center space-x-4">
|
||||
<a href="{{ path('app_user_edit', {'id': user_app.id}) }}"
|
||||
class="text-yellow-500 hover:text-yellow-700 text-lg">
|
||||
<i class="fas fa-edit"></i> Modifier cet utilisateur
|
||||
</a>
|
||||
|
||||
<a href="{{ path('app_user_delete', {'id': user_app.id}) }}"
|
||||
class="bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-lg">
|
||||
<i class="fas fa-trash-alt"></i> Supprimer
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user