Compare commits
22 Commits
579a56c53f
...
9074447216
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9074447216 | ||
![]() |
c1a79f7621 | ||
![]() |
d6d0a9bbad | ||
![]() |
549d0c5bfc | ||
![]() |
ebb799bcb8 | ||
a52c5adb83 | |||
c5cec0fa04 | |||
cb867ba8bb | |||
1567570d12 | |||
0e2a2f25f6 | |||
65f5c8cce4 | |||
f244e51aa7 | |||
![]() |
12ac37c97e | ||
80f18f7fc8 | |||
9a75d46972 | |||
f3a44047c4 | |||
c1ea94eb95 | |||
e96b410627 | |||
1bc9610b75 | |||
f5c0954435 | |||
e9f74aa3bf | |||
e297480fae |
1
.gitignore
vendored
1
.gitignore
vendored
@ -21,4 +21,5 @@
|
||||
/assets/vendor/
|
||||
###< symfony/asset-mapper ###
|
||||
.idea
|
||||
|
||||
/migrations/
|
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
38
migrations/Version20241121141451.php
Normal file
38
migrations/Version20241121141451.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
40
migrations/Version20241121141722.php
Normal file
40
migrations/Version20241121141722.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
31
migrations/Version20241121141818.php
Normal file
31
migrations/Version20241121141818.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
32
migrations/Version20241121141912.php
Normal file
32
migrations/Version20241121141912.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
34
migrations/Version20241121142119.php
Normal file
34
migrations/Version20241121142119.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
31
migrations/Version20241121142432.php
Normal file
31
migrations/Version20241121142432.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
32
migrations/Version20241121145353.php
Normal file
32
migrations/Version20241121145353.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
@ -30,6 +30,7 @@ final class FAQController extends AbstractController
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$fAQ->setUpdateDate(new \DateTime());
|
||||
$entityManager->persist($fAQ);
|
||||
$entityManager->flush();
|
||||
|
||||
@ -57,6 +58,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);
|
||||
|
@ -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,58 @@ final class MessageController extends AbstractController
|
||||
#[Route(name: 'app_message_index', methods: ['GET'])]
|
||||
public function index(MessageRepository $messageRepository): Response
|
||||
{
|
||||
$user = $this->getUser();
|
||||
$messages = $messageRepository->findByUser($user); // Recherche de tous les messages reçus ou envoyés par l'utilisateur
|
||||
|
||||
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();
|
||||
|
||||
// Récupérer tous les messages échangés entre l'utilisateur actuel et l'autre participant
|
||||
$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();
|
||||
|
||||
// Pré-remplir le destinataire si disponible
|
||||
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 +90,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 +112,6 @@ final class MessageController extends AbstractController
|
||||
|
||||
return $this->redirectToRoute('app_message_index', [], Response::HTTP_SEE_OTHER);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,11 @@
|
||||
|
||||
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;
|
||||
|
||||
@ -23,6 +27,24 @@ class ProfileController extends AbstractController
|
||||
'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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -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,7 +22,7 @@ final class UserAppController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
#[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', [
|
||||
@ -30,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);
|
||||
@ -39,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', [
|
||||
@ -48,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'))) {
|
||||
@ -56,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);
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ class UserApp implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
* @var list<string> The user roles
|
||||
*/
|
||||
#[ORM\Column]
|
||||
private array $roles = [];
|
||||
private array $roles = ["ROLE_USER"];
|
||||
|
||||
/**
|
||||
* @var string The hashed password
|
||||
|
@ -35,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',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
@ -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,6 +17,30 @@ class MessageRepository extends ServiceEntityRepository
|
||||
parent::__construct($registry, Message::class);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// /**
|
||||
// * @return Message[] Returns an array of Message objects
|
||||
// */
|
||||
|
@ -31,10 +31,13 @@
|
||||
<a class="hover:text-teal-400" href="{{ path('app_faq_index') }}">FAQ</a>
|
||||
<a class="hover:text-teal-400" href="{{ path('app_index') }}">Messagerie</a>
|
||||
</nav>
|
||||
<div>
|
||||
<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>
|
||||
</div>
|
||||
</header>
|
||||
@ -68,14 +71,9 @@
|
||||
<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>
|
||||
<a href="{{ path('app_logout') }}" class="block mt-4 bg-red-500 hover:bg-red-600 text-white text-center py-2 px-4 rounded-full">
|
||||
Déconnexion
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center py-4 border-t border-gray-700">
|
||||
<p class="text-sm">© 2024 HegreSphere. Tous droits réservés.</p>
|
||||
</div>
|
||||
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -10,18 +10,18 @@
|
||||
<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">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.id }}</td>
|
||||
<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
|
||||
|
@ -24,7 +24,6 @@
|
||||
</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">
|
||||
@ -46,4 +45,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
26
templates/message/conversation.html.twig
Normal file
26
templates/message/conversation.html.twig
Normal file
@ -0,0 +1,26 @@
|
||||
{% 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>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,37 +1,39 @@
|
||||
{% 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 %}
|
||||
{% if message.receiver == app.user or message.sender == app.user %}
|
||||
<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 : {{ message.sender.nickname }}</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>
|
||||
{% endif %}
|
||||
{% 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>
|
||||
<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') }}
|
||||
<!-- 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 %}
|
@ -15,5 +15,11 @@
|
||||
{% if 'ROLE_EMPLOYEE' in app.user.roles %}
|
||||
{% include 'profile/employee.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
{% if 'ROLE_ADMIN' in app.user.roles%}
|
||||
<div>
|
||||
<h1 class="text-9xl font-bold ml-kdn "> Vous etes admin</h1>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -1,14 +1,53 @@
|
||||
<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>
|
||||
<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">
|
||||
{% for comp in app.user.skills %}
|
||||
<li>comp.label</li>
|
||||
{% endfor %}
|
||||
{% 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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user