ff
This commit is contained in:
parent
2ed64a3027
commit
0d43ba4f47
@ -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;
|
||||
@ -12,112 +11,95 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[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', methods: ['GET'])]
|
||||
public function index(Request $request, AnnouncementRepository $announcementRepository): Response
|
||||
{
|
||||
$showNonValidated = $request->query->get('show_non_validated') === '1';
|
||||
|
||||
$announcements = $showNonValidated
|
||||
? $announcementRepository->findBy(['status' => 'notVerified'])
|
||||
: $announcementRepository->findAll();
|
||||
|
||||
|
||||
return $this->render('announcement/index.html.twig', [
|
||||
'announcements' => $announcements,
|
||||
'showNonValidated' => $showNonValidated,
|
||||
]);
|
||||
}
|
||||
#[Route('/add', name: '_add')]
|
||||
public function addAnnouncement(Request $request): Response
|
||||
|
||||
|
||||
#[Route('/new', name: 'app_announcement_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$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')]
|
||||
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')]
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
@ -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)
|
||||
;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
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,78 @@
|
||||
{% 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>
|
||||
<!-- 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>
|
||||
|
||||
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>
|
||||
<!-- 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>
|
||||
|
||||
<!-- 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|date("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 %}
|
77
templates/announcement/show.html.twig
Normal file
77
templates/announcement/show.html.twig
Normal file
@ -0,0 +1,77 @@
|
||||
{% 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>
|
||||
|
||||
<!-- 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>
|
||||
</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 %}
|
@ -28,7 +28,7 @@
|
||||
<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_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>
|
||||
</nav>
|
||||
<div class="flex space-x-4">
|
||||
@ -61,12 +61,9 @@
|
||||
<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_index') }}" class="hover:text-teal-400">Contact</a></li>
|
||||
<li><a href="{{ path('app_index') }}" class="hover:text-teal-400">Mentions légales</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Logout and Contact Info -->
|
||||
<div>
|
||||
<h3 class="text-white text-lg font-bold mb-4">Contactez-nous</h3>
|
||||
<p>Email: support@hegresphere.com</p>
|
||||
|
@ -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,25 +24,25 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-between">
|
||||
<a href="{{ path('app_faq_index') }}" class="text-teal-500 hover:text-teal-700">
|
||||
<!-- 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_edit', {'id': faq.id}) }}" class="text-yellow-500 hover:text-yellow-700">
|
||||
<i class="fas fa-edit"></i> Modifier cette FAQ
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<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 cette question
|
||||
</button>
|
||||
</form>
|
||||
<!-- 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 %}
|
@ -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 %}
|
||||
|
@ -19,6 +19,10 @@
|
||||
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">
|
||||
@ -31,6 +35,10 @@
|
||||
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"
|
||||
|
Loading…
Reference in New Issue
Block a user