message
This commit is contained in:
parent
0d43ba4f47
commit
88be0086ce
@ -30,6 +30,10 @@ final class MessageController extends AbstractController
|
|||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
|
||||||
|
$message->setSendingDate(new \DateTime());
|
||||||
|
$message->setSender($this->getUser());
|
||||||
|
|
||||||
$entityManager->persist($message);
|
$entityManager->persist($message);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
@ -57,6 +61,7 @@ final class MessageController extends AbstractController
|
|||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
$message->setSendingDate(new \DateTime());
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
return $this->redirectToRoute('app_message_index', [], Response::HTTP_SEE_OTHER);
|
return $this->redirectToRoute('app_message_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
@ -15,16 +15,10 @@ class MessageType extends AbstractType
|
|||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('content')
|
->add('content')
|
||||||
->add('sendingDate', null, [
|
|
||||||
'widget' => 'single_text',
|
|
||||||
])
|
|
||||||
->add('sender', EntityType::class, [
|
|
||||||
'class' => UserApp::class,
|
|
||||||
'choice_label' => 'id',
|
|
||||||
])
|
|
||||||
->add('receiver', EntityType::class, [
|
->add('receiver', EntityType::class, [
|
||||||
'class' => UserApp::class,
|
'class' => UserApp::class,
|
||||||
'choice_label' => 'id',
|
'choice_label' => 'nickname',
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<nav class="space-x-20">
|
<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') }}">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_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>
|
</nav>
|
||||||
<div class="flex space-x-4">
|
<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') }}">
|
<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>
|
<h3 class="text-white text-lg font-bold mb-4">Liens utiles</h3>
|
||||||
<ul class="space-y-2">
|
<ul class="space-y-2">
|
||||||
<li><a href="{{ path('app_index') }}" class="hover:text-teal-400">Accueil</a></li>
|
<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>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<section class="container mx-auto py-12">
|
<section class="container mx-auto py-12">
|
||||||
<div class="flex justify-between items-center mb-6">
|
<div class="flex justify-between items-center mb-6">
|
||||||
<h2 class="text-2xl font-bold">Propositions de stages </h2>
|
<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>
|
||||||
<div class="space-y-6">
|
<div class="space-y-6">
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user