This commit is contained in:
allavenavr 2024-12-12 14:41:59 +01:00
parent 0d43ba4f47
commit 88be0086ce
4 changed files with 11 additions and 12 deletions

View File

@ -30,6 +30,10 @@ final class MessageController extends AbstractController
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$message->setSendingDate(new \DateTime());
$message->setSender($this->getUser());
$entityManager->persist($message);
$entityManager->flush();
@ -57,6 +61,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);

View File

@ -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',
])
;
}

View File

@ -27,9 +27,9 @@
</div>
<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_announcement_list') }}">Stages</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_index') }}">Messagerie</a>
<a class="hover:text-teal-400" href="{{ path('app_message_index') }}">Messagerie</a>
</nav>
<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') }}">
@ -60,7 +60,7 @@
<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_list') }}" class="hover:text-teal-400">Liste des stages</a></li>
<li><a href="{{ path('app_announcement_index') }}" class="hover:text-teal-400">Liste des stages</a></li>
</ul>
</div>

View File

@ -41,7 +41,7 @@
<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>
<a class="text-teal-500 hover:underline" href="{{ path('app_announcement_index') }}">Voir tout</a>
</div>
<div class="space-y-6">