controller nickel et ke reste aussi
This commit is contained in:
parent
af50b4bd60
commit
b3e3f41003
@ -9,42 +9,73 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
class FaultController extends AbstractController
|
|
||||||
|
#[Route('/fault')]
|
||||||
|
final class FaultController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
#[Route(name: 'app_fault_index', methods: ['GET'])]
|
||||||
private readonly EntityManagerInterface $entityManager,
|
public function index(FaultRepository $faultRepository): Response
|
||||||
private readonly FaultRepository $faultRepository
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
return $this->render('fault/index.html.twig', [
|
||||||
|
'faults' => $faultRepository->findAll(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
#[Route('/fault/add', name: 'fault_add')]
|
|
||||||
public function add(Request $request): Response
|
#[Route('/new', name: 'app_fault_new', methods: ['GET', 'POST'])]
|
||||||
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$fault = new Fault();
|
$fault = new Fault();
|
||||||
$form = $this->createForm(FaultType::class, $fault);
|
$form = $this->createForm(FaultType::class, $fault);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if($form->isSubmitted() && $form->isValid())
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
{
|
$entityManager->persist($fault);
|
||||||
$this->entityManager->persist($fault);
|
$entityManager->flush();
|
||||||
$this->entityManager->flush();
|
|
||||||
|
|
||||||
return $this->redirectToRoute("fault_list");
|
return $this->redirectToRoute('app_fault_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('fault/add.html.twig', [
|
return $this->render('fault/new.html.twig', [
|
||||||
|
'fault' => $fault,
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/fault/list', name: 'fault_list')]
|
#[Route('/{id}', name: 'app_fault_show', methods: ['GET'])]
|
||||||
public function list(): Response
|
public function show(Fault $fault): Response
|
||||||
{
|
{
|
||||||
$faults = $this->faultRepository->findAll();
|
return $this->render('fault/show.html.twig', [
|
||||||
|
'fault' => $fault,
|
||||||
return $this->render('fault/list.html.twig', [
|
|
||||||
'faults' => $faults,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
#[Route('/{id}/edit', name: 'app_fault_edit', methods: ['GET', 'POST'])]
|
||||||
|
public function edit(Request $request, Fault $fault, EntityManagerInterface $entityManager): Response
|
||||||
|
{
|
||||||
|
$form = $this->createForm(FaultType::class, $fault);
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
$entityManager->flush();
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_fault_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->render('fault/edit.html.twig', [
|
||||||
|
'fault' => $fault,
|
||||||
|
'form' => $form,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/{id}', name: 'app_fault_delete', methods: ['POST'])]
|
||||||
|
public function delete(Request $request, Fault $fault, EntityManagerInterface $entityManager): Response
|
||||||
|
{
|
||||||
|
if ($this->isCsrfTokenValid('delete'.$fault->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
|
$entityManager->remove($fault);
|
||||||
|
$entityManager->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_fault_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -11,41 +11,71 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
class InterventionController extends AbstractController
|
#[Route('/intervention')]
|
||||||
|
final class InterventionController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
#[Route(name: 'app_intervention_index', methods: ['GET'])]
|
||||||
private readonly EntityManagerInterface $entityManager,
|
public function index(InterventionRepository $interventionRepository): Response
|
||||||
private readonly InterventionRepository $interventionRepository
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
return $this->render('intervention/index.html.twig', [
|
||||||
|
'interventions' => $interventionRepository->findAll(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
#[Route('/intervention/add', name: 'intervention_add')]
|
|
||||||
public function add(Request $request): Response
|
#[Route('/new', name: 'app_intervention_new', methods: ['GET', 'POST'])]
|
||||||
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$intervention = new Intervention();
|
$intervention = new Intervention();
|
||||||
$form = $this->createForm(InterventionType::class, $intervention);
|
$form = $this->createForm(InterventionType::class, $intervention);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if($form->isSubmitted() && $form->isValid())
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
{
|
$entityManager->persist($intervention);
|
||||||
$this->entityManager->persist($intervention);
|
$entityManager->flush();
|
||||||
$this->entityManager->flush();
|
|
||||||
|
|
||||||
return $this->redirectToRoute("intervention_list");
|
return $this->redirectToRoute('app_intervention_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('intervention/add.html.twig', [
|
return $this->render('intervention/new.html.twig', [
|
||||||
|
'intervention' => $intervention,
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/intervention/list', name: 'intervention_list')]
|
#[Route('/{id}', name: 'app_intervention_show', methods: ['GET'])]
|
||||||
public function list(): Response
|
public function show(Intervention $intervention): Response
|
||||||
{
|
{
|
||||||
$interventions = $this->interventionRepository->findAll();
|
return $this->render('intervention/show.html.twig', [
|
||||||
|
'intervention' => $intervention,
|
||||||
return $this->render('intervention/list.html.twig', [
|
|
||||||
'interventions' => $interventions,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
#[Route('/{id}/edit', name: 'app_intervention_edit', methods: ['GET', 'POST'])]
|
||||||
|
public function edit(Request $request, Intervention $intervention, EntityManagerInterface $entityManager): Response
|
||||||
|
{
|
||||||
|
$form = $this->createForm(InterventionType::class, $intervention);
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
$entityManager->flush();
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_intervention_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->render('intervention/edit.html.twig', [
|
||||||
|
'intervention' => $intervention,
|
||||||
|
'form' => $form,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/{id}', name: 'app_intervention_delete', methods: ['POST'])]
|
||||||
|
public function delete(Request $request, Intervention $intervention, EntityManagerInterface $entityManager): Response
|
||||||
|
{
|
||||||
|
if ($this->isCsrfTokenValid('delete'.$intervention->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
|
$entityManager->remove($intervention);
|
||||||
|
$entityManager->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_intervention_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -9,42 +9,73 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
class SkillController extends AbstractController
|
#[Route('/skill')]
|
||||||
|
final class SkillController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
#[Route(name: 'app_skill_index', methods: ['GET'])]
|
||||||
private readonly EntityManagerInterface $entityManager,
|
public function index(SkillRepository $skillRepository): Response
|
||||||
private readonly SkillRepository $skillRepository
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
return $this->render('skill/index.html.twig', [
|
||||||
|
'skills' => $skillRepository->findAll(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/skill/add', name: 'skill_add')]
|
#[Route('/new', name: 'app_skill_new', methods: ['GET', 'POST'])]
|
||||||
public function add(Request $request): Response
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$skill = new Skill();
|
$skill = new Skill();
|
||||||
$form = $this->createForm(SkillType::class, $skill);
|
$form = $this->createForm(SkillType::class, $skill);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->entityManager->persist($skill);
|
$entityManager->persist($skill);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('skill/add.html.twig', [
|
return $this->render('skill/new.html.twig', [
|
||||||
|
'skill' => $skill,
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/skill/list', name: 'skill_list')]
|
#[Route('/{id}', name: 'app_skill_show', methods: ['GET'])]
|
||||||
public function list(): Response
|
public function show(Skill $skill): Response
|
||||||
{
|
{
|
||||||
$skills = $this->skillRepository->findAll();
|
return $this->render('skill/show.html.twig', [
|
||||||
|
'skill' => $skill,
|
||||||
return $this->render('skill/list.html.twig', [
|
|
||||||
'skills' => $skills,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
#[Route('/{id}/edit', name: 'app_skill_edit', methods: ['GET', 'POST'])]
|
||||||
|
public function edit(Request $request, Skill $skill, EntityManagerInterface $entityManager): Response
|
||||||
|
{
|
||||||
|
$form = $this->createForm(SkillType::class, $skill);
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
$entityManager->flush();
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->render('skill/edit.html.twig', [
|
||||||
|
'skill' => $skill,
|
||||||
|
'form' => $form,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/{id}', name: 'app_skill_delete', methods: ['POST'])]
|
||||||
|
public function delete(Request $request, Skill $skill, EntityManagerInterface $entityManager): Response
|
||||||
|
{
|
||||||
|
if ($this->isCsrfTokenValid('delete'.$skill->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
|
$entityManager->remove($skill);
|
||||||
|
$entityManager->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_skill_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -9,62 +9,73 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
class StockController extends AbstractController
|
#[Route('/stock')]
|
||||||
|
final class StockController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
#[Route(name: 'app_stock_index', methods: ['GET'])]
|
||||||
private readonly EntityManagerInterface $entityManager,
|
public function index(StockRepository $stockRepository): Response
|
||||||
private readonly StockRepository $stockRepository
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
return $this->render('stock/index.html.twig', [
|
||||||
|
'stocks' => $stockRepository->findAll(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/stock/add', name: 'stock_add')]
|
#[Route('/new', name: 'app_stock_new', methods: ['GET', 'POST'])]
|
||||||
public function add(Request $request): Response
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$stock = new Stock();
|
$stock = new Stock();
|
||||||
$form = $this->createForm(StockType::class, $stock);
|
$form = $this->createForm(StockType::class, $stock);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if($form->isSubmitted() && $form->isValid())
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
{
|
$entityManager->persist($stock);
|
||||||
$this->entityManager->persist($stock);
|
$entityManager->flush();
|
||||||
$this->entityManager->flush();
|
|
||||||
|
return $this->redirectToRoute('app_stock_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('stock/add.html.twig', [
|
return $this->render('stock/new.html.twig', [
|
||||||
|
'stock' => $stock,
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/stock/list', name: 'stock_list')]
|
#[Route('/{id}', name: 'app_stock_show', methods: ['GET'])]
|
||||||
public function list(): Response
|
public function show(Stock $stock): Response
|
||||||
{
|
{
|
||||||
$stocks = $this->stockRepository->findAll();
|
return $this->render('stock/show.html.twig', [
|
||||||
|
'stock' => $stock,
|
||||||
return $this->render('stock/list.html.twig', [
|
|
||||||
'stocks' => $stocks,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/stock/update/{id}', name: 'stock_update')]
|
#[Route('/{id}/edit', name: 'app_stock_edit', methods: ['GET', 'POST'])]
|
||||||
public function update(int $id, Request $request): Response
|
public function edit(Request $request, Stock $stock, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$stock = $this->stockRepository->find($id);
|
|
||||||
$form = $this->createForm(StockType::class, $stock);
|
$form = $this->createForm(StockType::class, $stock);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if($form->isSubmitted() && $form->isValid())
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
{
|
$entityManager->flush();
|
||||||
$this->entityManager->persist($stock);
|
|
||||||
$this->entityManager->flush();
|
return $this->redirectToRoute('app_stock_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('stock/add.html.twig', [
|
return $this->render('stock/edit.html.twig', [
|
||||||
|
'stock' => $stock,
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/{id}', name: 'app_stock_delete', methods: ['POST'])]
|
||||||
|
public function delete(Request $request, Stock $stock, EntityManagerInterface $entityManager): Response
|
||||||
|
{
|
||||||
|
if ($this->isCsrfTokenValid('delete'.$stock->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
|
$entityManager->remove($stock);
|
||||||
|
$entityManager->flush();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
return $this->redirectToRoute('app_stock_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -9,70 +9,73 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
class UserController extends AbstractController
|
#[Route('/user')]
|
||||||
|
final class UserController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
#[Route(name: 'app_user_index', methods: ['GET'])]
|
||||||
private readonly EntityManagerInterface $entityManager,
|
public function index(UserRepository $userRepository): Response
|
||||||
private readonly UserRepository $userRepository
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
return $this->render('user/index.html.twig', [
|
||||||
|
'users' => $userRepository->findAll(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/user/add', name: 'user_add')]
|
#[Route('/new', name: 'app_user_new', methods: ['GET', 'POST'])]
|
||||||
public function add(Request $request): Response
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$user = new User();
|
$user = new User();
|
||||||
$form = $this->createForm(UserType::class, $user);
|
$form = $this->createForm(UserType::class, $user);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if($form->isSubmitted() && $form->isValid())
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
{
|
$entityManager->persist($user);
|
||||||
$this->entityManager->persist($user);
|
$entityManager->flush();
|
||||||
$this->entityManager->flush();
|
|
||||||
|
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('user/add.html.twig', [
|
return $this->render('user/new.html.twig', [
|
||||||
|
'user' => $user,
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/user/list', name: 'user_list')]
|
#[Route('/{id}', name: 'app_user_show', methods: ['GET'])]
|
||||||
public function list(): Response
|
public function show(User $user): Response
|
||||||
{
|
{
|
||||||
$users = $this->userRepository->findAll();
|
return $this->render('user/show.html.twig', [
|
||||||
|
'user' => $user,
|
||||||
return $this->render('user/list.html.twig', [
|
|
||||||
'users' => $users,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/user/update/{id}', name: 'user_update')]
|
#[Route('/{id}/edit', name: 'app_user_edit', methods: ['GET', 'POST'])]
|
||||||
public function update(int $id, Request $request): Response
|
public function edit(Request $request, User $user, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$user = $this->userRepository->find($id);
|
|
||||||
$form = $this->createForm(UserType::class, $user);
|
$form = $this->createForm(UserType::class, $user);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if($form->isSubmitted() && $form->isValid())
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
{
|
$entityManager->flush();
|
||||||
$this->entityManager->persist($user);
|
|
||||||
$this->entityManager->flush();
|
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('user/add.html.twig', [
|
return $this->render('user/edit.html.twig', [
|
||||||
|
'user' => $user,
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/user/delete/{id}', name: '_delete')]
|
#[Route('/{id}', name: 'app_user_delete', methods: ['POST'])]
|
||||||
public function delete(int $id): Response
|
public function delete(Request $request, User $user, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$user = $this->userRepository->find($id);
|
if ($this->isCsrfTokenValid('delete'.$user->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$this->entityManager->remove($user);
|
$entityManager->remove($user);
|
||||||
$this->entityManager->flush();
|
$entityManager->flush();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->redirectToRoute('app_user_list');
|
return $this->redirectToRoute('app_user_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,41 +11,71 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
class VehicleController extends AbstractController
|
#[Route('/vehicle')]
|
||||||
|
final class VehicleController extends AbstractController
|
||||||
{
|
{
|
||||||
public function __construct(
|
#[Route(name: 'app_vehicle_index', methods: ['GET'])]
|
||||||
private readonly EntityManagerInterface $entityManager,
|
public function index(VehicleRepository $vehicleRepository): Response
|
||||||
private readonly VehicleRepository $vehicleRepository
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
return $this->render('vehicle/index.html.twig', [
|
||||||
|
'vehicles' => $vehicleRepository->findAll(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
#[\Symfony\Component\Routing\Annotation\Route('/vehicle/add', name: 'vehicle_add')]
|
|
||||||
public function add(Request $request): Response
|
#[Route('/new', name: 'app_vehicle_new', methods: ['GET', 'POST'])]
|
||||||
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$vehicle = new Vehicle();
|
$vehicle = new Vehicle();
|
||||||
$form = $this->createForm(VehicleType::class, $vehicle);
|
$form = $this->createForm(VehicleType::class, $vehicle);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if($form->isSubmitted() && $form->isValid())
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
{
|
$entityManager->persist($vehicle);
|
||||||
$this->entityManager->persist($vehicle);
|
$entityManager->flush();
|
||||||
$this->entityManager->flush();
|
|
||||||
|
|
||||||
return $this->redirectToRoute("vehicle_list");
|
return $this->redirectToRoute('app_vehicle_index', [], Response::HTTP_SEE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('vehicle/add.html.twig', [
|
return $this->render('vehicle/new.html.twig', [
|
||||||
|
'vehicle' => $vehicle,
|
||||||
'form' => $form,
|
'form' => $form,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/vehicle/list', name: 'vehicle_list')]
|
#[Route('/{id}', name: 'app_vehicle_show', methods: ['GET'])]
|
||||||
public function list(): Response
|
public function show(Vehicle $vehicle): Response
|
||||||
{
|
{
|
||||||
$vehicles = $this->vehicleRepository->findAll();
|
return $this->render('vehicle/show.html.twig', [
|
||||||
|
'vehicle' => $vehicle,
|
||||||
return $this->render('vehicle/list.html.twig', [
|
|
||||||
'vehicles' => $vehicles,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
#[Route('/{id}/edit', name: 'app_vehicle_edit', methods: ['GET', 'POST'])]
|
||||||
|
public function edit(Request $request, Vehicle $vehicle, EntityManagerInterface $entityManager): Response
|
||||||
|
{
|
||||||
|
$form = $this->createForm(VehicleType::class, $vehicle);
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
|
$entityManager->flush();
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_vehicle_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->render('vehicle/edit.html.twig', [
|
||||||
|
'vehicle' => $vehicle,
|
||||||
|
'form' => $form,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/{id}', name: 'app_vehicle_delete', methods: ['POST'])]
|
||||||
|
public function delete(Request $request, Vehicle $vehicle, EntityManagerInterface $entityManager): Response
|
||||||
|
{
|
||||||
|
if ($this->isCsrfTokenValid('delete'.$vehicle->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
|
$entityManager->remove($vehicle);
|
||||||
|
$entityManager->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->redirectToRoute('app_vehicle_index', [], Response::HTTP_SEE_OTHER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Entity\Fault;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
@ -15,14 +14,13 @@ class FaultType extends AbstractType
|
|||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('Wording', TextType::class)
|
->add('Wording', TextType::class)
|
||||||
->add('save', SubmitType::class)
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
// Configure your form options here
|
'data_class' => Fault::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use DateTime;
|
use App\Entity\Intervention;
|
||||||
|
use Doctrine\DBAL\Types\TextType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
@ -17,18 +14,19 @@ class InterventionType extends AbstractType
|
|||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('Wording', TextType::class)
|
->add('Wording', TextType::class)
|
||||||
->add('Timestamp', DateType::class)
|
->add('Timestamp', \DateTime::class, [
|
||||||
->add('description', TextAreaType::class)
|
'widget' => 'single_text',
|
||||||
->add('address', TextType::class)
|
])
|
||||||
|
->add('Description', TextType::class)
|
||||||
|
->add('Address', TextType::class)
|
||||||
->add('Status', TextType::class)
|
->add('Status', TextType::class)
|
||||||
->add('save', SubmitType::class)
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
// Configure your form options here
|
'data_class' => Intervention::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Entity\Skill;
|
||||||
|
use Doctrine\DBAL\Types\TextType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
@ -14,17 +13,15 @@ class SkillType extends AbstractType
|
|||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('Wording', TextType::class)
|
->add('Wording',TextType::class)
|
||||||
->add('description', TextAreaType::class)
|
->add('Description', TextType::class)
|
||||||
->add('Save', SubmitType::class)
|
|
||||||
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
// Configure your form options here
|
'data_class' => Skill::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,9 @@
|
|||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity\Stock;
|
use App\Entity\Stock;
|
||||||
|
use Doctrine\DBAL\Types\IntegerType;
|
||||||
|
use Doctrine\DBAL\Types\TextType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
@ -19,9 +15,8 @@ class StockType extends AbstractType
|
|||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('Wording', TextType::class)
|
->add('Wording', TextType::class)
|
||||||
->add('description', TextAreaType::class)
|
->add('Description', TextType::class)
|
||||||
->add('Quantity', IntegerType::class)
|
->add('Quantity', IntegerType::class)
|
||||||
->add('save', SubmitType::class)
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,11 +3,8 @@
|
|||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\User;
|
||||||
|
use Doctrine\DBAL\Types\TextType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
@ -16,13 +13,15 @@ class UserType extends AbstractType
|
|||||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
|
->add('email', TextType::class)
|
||||||
->add('FirstName', TextType::class)
|
->add('FirstName', TextType::class)
|
||||||
->add('LastName', TextType::class)
|
->add('LastName', TextType::class)
|
||||||
->add('BirthDate', DateType::class)
|
->add('BirthDate', \DateTime::class, [
|
||||||
->add('Email', EmailType::class)
|
'widget' => 'single_text',
|
||||||
|
])
|
||||||
->add('Phone', TextType::class)
|
->add('Phone', TextType::class)
|
||||||
->add('Type', TextType::class)
|
->add('roles', TextType::class)
|
||||||
->add('Save', SubmitType::class)
|
->add('password', TextType::class)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
|
use App\Entity\Vehicle;
|
||||||
|
use Doctrine\DBAL\Types\TextType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
|
||||||
@ -15,16 +14,14 @@ class VehicleType extends AbstractType
|
|||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('LicensePlate', TextType::class)
|
->add('LicensePlate', TextType::class)
|
||||||
->add('Brand', IntegerType::class)
|
->add('Brand', TextType::class)
|
||||||
->add('Save', SubmitType::class)
|
|
||||||
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
// Configure your form options here
|
'data_class' => Vehicle::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
templates/fault/_delete_form.html.twig
Normal file
4
templates/fault/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<form method="post" action="{{ path('app_fault_delete', {'id': fault.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||||
|
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ fault.id) }}">
|
||||||
|
<button class="btn">Delete</button>
|
||||||
|
</form>
|
4
templates/fault/_form.html.twig
Normal file
4
templates/fault/_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,10 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Ajouter une panne{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<h1>Ajouter une panne</h1>
|
|
||||||
|
|
||||||
{{ form(form) }}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
13
templates/fault/edit.html.twig
Normal file
13
templates/fault/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Edit Fault{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Edit Fault</h1>
|
||||||
|
|
||||||
|
{{ include('fault/_form.html.twig', {'button_label': 'Update'}) }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_fault_index') }}">back to list</a>
|
||||||
|
|
||||||
|
{{ include('fault/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
35
templates/fault/index.html.twig
Normal file
35
templates/fault/index.html.twig
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Fault index{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Fault index</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>Wording</th>
|
||||||
|
<th>actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for fault in faults %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ fault.id }}</td>
|
||||||
|
<td>{{ fault.Wording }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ path('app_fault_show', {'id': fault.id}) }}">show</a>
|
||||||
|
<a href="{{ path('app_fault_edit', {'id': fault.id}) }}">edit</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% else %}
|
||||||
|
<tr>
|
||||||
|
<td colspan="3">no records found</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_fault_new') }}">Create new</a>
|
||||||
|
{% endblock %}
|
@ -1,9 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Hello UserController!{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
{% for fault in faults %}
|
|
||||||
{{ fault.Wording }}
|
|
||||||
{% endfor %}
|
|
||||||
{% endblock %}
|
|
11
templates/fault/new.html.twig
Normal file
11
templates/fault/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}New Fault{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Create new Fault</h1>
|
||||||
|
|
||||||
|
{{ include('fault/_form.html.twig') }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_fault_index') }}">back to list</a>
|
||||||
|
{% endblock %}
|
26
templates/fault/show.html.twig
Normal file
26
templates/fault/show.html.twig
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Fault{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Fault</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<td>{{ fault.id }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Wording</th>
|
||||||
|
<td>{{ fault.Wording }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_fault_index') }}">back to list</a>
|
||||||
|
|
||||||
|
<a href="{{ path('app_fault_edit', {'id': fault.id}) }}">edit</a>
|
||||||
|
|
||||||
|
{{ include('fault/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
4
templates/intervention/_delete_form.html.twig
Normal file
4
templates/intervention/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<form method="post" action="{{ path('app_intervention_delete', {'id': intervention.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||||
|
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ intervention.id) }}">
|
||||||
|
<button class="btn">Delete</button>
|
||||||
|
</form>
|
4
templates/intervention/_form.html.twig
Normal file
4
templates/intervention/_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,39 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="fr, en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Créer Une Intervention</title>
|
|
||||||
<link href="{{ asset('styles/css/intervention.css') }}" rel='stylesheet'>
|
|
||||||
<link rel="icon"
|
|
||||||
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
||||||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
{% block stylesheets %}
|
|
||||||
{% endblock %}
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="background"></div>
|
|
||||||
<img class="logoCalendar" src="{{ asset('styles/image/calendar.png') }}" alt="Logo Calendrier">
|
|
||||||
<h1 class="titre">Créer Une Intervention</h1>
|
|
||||||
|
|
||||||
<div class="background-intervention">
|
|
||||||
<input required id="nom" placeholder="Nom de l'intervention">
|
|
||||||
<input required id="echecs" placeholder="Liste des échecs">
|
|
||||||
<input required id="employesCompetences" placeholder="Liste des employés et de leurs compétences">
|
|
||||||
<input id="piece" placeholder="Pièce affecter">
|
|
||||||
<p id="vehicule">Véhicule nécessaire</p>
|
|
||||||
<input type="checkbox" name="vehicule1" id="vehicule1">
|
|
||||||
<label for=”vehicule1” id="oui"> Oui </label>
|
|
||||||
<input type="checkbox" name="vehicule2" id="vehicule2">
|
|
||||||
<label for=”vehicule2” id="non"> Non </label>
|
|
||||||
<p id="date">Jour de l'intervention</p>
|
|
||||||
<input type="date" id="calendar">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="from"> {{ form(form) }} </div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
13
templates/intervention/edit.html.twig
Normal file
13
templates/intervention/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Edit Intervention{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Edit Intervention</h1>
|
||||||
|
|
||||||
|
{{ include('intervention/_form.html.twig', {'button_label': 'Update'}) }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_intervention_index') }}">back to list</a>
|
||||||
|
|
||||||
|
{{ include('intervention/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
43
templates/intervention/index.html.twig
Normal file
43
templates/intervention/index.html.twig
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Intervention index{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Intervention index</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>Wording</th>
|
||||||
|
<th>Timestamp</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>Address</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for intervention in interventions %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ intervention.id }}</td>
|
||||||
|
<td>{{ intervention.Wording }}</td>
|
||||||
|
<td>{{ intervention.Timestamp ? intervention.Timestamp|date('Y-m-d H:i:s') : '' }}</td>
|
||||||
|
<td>{{ intervention.Description }}</td>
|
||||||
|
<td>{{ intervention.Address }}</td>
|
||||||
|
<td>{{ intervention.Status }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ path('app_intervention_show', {'id': intervention.id}) }}">show</a>
|
||||||
|
<a href="{{ path('app_intervention_edit', {'id': intervention.id}) }}">edit</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% else %}
|
||||||
|
<tr>
|
||||||
|
<td colspan="7">no records found</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_intervention_new') }}">Create new</a>
|
||||||
|
{% endblock %}
|
@ -1,13 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Hello InterventionController!{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
{% for intervention in interventions %}
|
|
||||||
{{ intervention.Wording }}
|
|
||||||
{{ intervention.Timestamp|date('Y-m-d H:i:s') }} {{ intervention.Description }}
|
|
||||||
{{ intervention.Address }}
|
|
||||||
{{ intervention.Status }}
|
|
||||||
{% endfor %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
11
templates/intervention/new.html.twig
Normal file
11
templates/intervention/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}New Intervention{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Create new Intervention</h1>
|
||||||
|
|
||||||
|
{{ include('intervention/_form.html.twig') }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_intervention_index') }}">back to list</a>
|
||||||
|
{% endblock %}
|
42
templates/intervention/show.html.twig
Normal file
42
templates/intervention/show.html.twig
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Intervention{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Intervention</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<td>{{ intervention.id }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Wording</th>
|
||||||
|
<td>{{ intervention.Wording }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Timestamp</th>
|
||||||
|
<td>{{ intervention.Timestamp ? intervention.Timestamp|date('Y-m-d H:i:s') : '' }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Description</th>
|
||||||
|
<td>{{ intervention.Description }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Address</th>
|
||||||
|
<td>{{ intervention.Address }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Status</th>
|
||||||
|
<td>{{ intervention.Status }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_intervention_index') }}">back to list</a>
|
||||||
|
|
||||||
|
<a href="{{ path('app_intervention_edit', {'id': intervention.id}) }}">edit</a>
|
||||||
|
|
||||||
|
{{ include('intervention/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
4
templates/skill/_delete_form.html.twig
Normal file
4
templates/skill/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<form method="post" action="{{ path('app_skill_delete', {'id': skill.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||||
|
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ skill.id) }}">
|
||||||
|
<button class="btn">Delete</button>
|
||||||
|
</form>
|
4
templates/skill/_form.html.twig
Normal file
4
templates/skill/_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,10 +0,0 @@
|
|||||||
{# templates/user/add.html.twig #}
|
|
||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Ajouter une intervention {% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<h1>Ajouter une compétence</h1>
|
|
||||||
|
|
||||||
{{ form(form) }}
|
|
||||||
{% endblock %}
|
|
13
templates/skill/edit.html.twig
Normal file
13
templates/skill/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Edit Skill{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Edit Skill</h1>
|
||||||
|
|
||||||
|
{{ include('skill/_form.html.twig', {'button_label': 'Update'}) }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_skill_index') }}">back to list</a>
|
||||||
|
|
||||||
|
{{ include('skill/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
37
templates/skill/index.html.twig
Normal file
37
templates/skill/index.html.twig
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Skill index{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Skill index</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>Wording</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for skill in skills %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ skill.id }}</td>
|
||||||
|
<td>{{ skill.Wording }}</td>
|
||||||
|
<td>{{ skill.Description }}</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="4">no records found</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_skill_new') }}">Create new</a>
|
||||||
|
{% endblock %}
|
@ -1,10 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Hello InterventionController!{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
{% for skill in skills %}
|
|
||||||
{{ skill.Wording }}
|
|
||||||
{{ skill.Description }}
|
|
||||||
{% endfor %}
|
|
||||||
{% endblock %}
|
|
11
templates/skill/new.html.twig
Normal file
11
templates/skill/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}New Skill{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Create new Skill</h1>
|
||||||
|
|
||||||
|
{{ include('skill/_form.html.twig') }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_skill_index') }}">back to list</a>
|
||||||
|
{% endblock %}
|
30
templates/skill/show.html.twig
Normal file
30
templates/skill/show.html.twig
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Skill{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Skill</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<td>{{ skill.id }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Wording</th>
|
||||||
|
<td>{{ skill.Wording }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Description</th>
|
||||||
|
<td>{{ skill.Description }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_skill_index') }}">back to list</a>
|
||||||
|
|
||||||
|
<a href="{{ path('app_skill_edit', {'id': skill.id}) }}">edit</a>
|
||||||
|
|
||||||
|
{{ include('skill/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
4
templates/stock/_delete_form.html.twig
Normal file
4
templates/stock/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<form method="post" action="{{ path('app_stock_delete', {'id': stock.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||||
|
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ stock.id) }}">
|
||||||
|
<button class="btn">Delete</button>
|
||||||
|
</form>
|
4
templates/stock/_form.html.twig
Normal file
4
templates/stock/_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,10 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Ajouter un utilisateur{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<h1>Ajouter du stock</h1>
|
|
||||||
|
|
||||||
{{ form(form) }}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
13
templates/stock/edit.html.twig
Normal file
13
templates/stock/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Edit Stock{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Edit Stock</h1>
|
||||||
|
|
||||||
|
{{ include('stock/_form.html.twig', {'button_label': 'Update'}) }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_stock_index') }}">back to list</a>
|
||||||
|
|
||||||
|
{{ include('stock/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
39
templates/stock/index.html.twig
Normal file
39
templates/stock/index.html.twig
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Stock index{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Stock index</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>Wording</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>Quantity</th>
|
||||||
|
<th>actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for stock in stocks %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ stock.id }}</td>
|
||||||
|
<td>{{ stock.Wording }}</td>
|
||||||
|
<td>{{ stock.Description }}</td>
|
||||||
|
<td>{{ stock.Quantity }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ path('app_stock_show', {'id': stock.id}) }}">show</a>
|
||||||
|
<a href="{{ path('app_stock_edit', {'id': stock.id}) }}">edit</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% else %}
|
||||||
|
<tr>
|
||||||
|
<td colspan="5">no records found</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_stock_new') }}">Create new</a>
|
||||||
|
{% endblock %}
|
@ -1,11 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Hello StockController!{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
{% for stock in stocks %}
|
|
||||||
{{ stock.Wording }}
|
|
||||||
{{ stock.Description }}
|
|
||||||
{{ stock.Quantity }}
|
|
||||||
{% endfor %}
|
|
||||||
{% endblock %}
|
|
11
templates/stock/new.html.twig
Normal file
11
templates/stock/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}New Stock{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Create new Stock</h1>
|
||||||
|
|
||||||
|
{{ include('stock/_form.html.twig') }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_stock_index') }}">back to list</a>
|
||||||
|
{% endblock %}
|
34
templates/stock/show.html.twig
Normal file
34
templates/stock/show.html.twig
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Stock{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Stock</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<td>{{ stock.id }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Wording</th>
|
||||||
|
<td>{{ stock.Wording }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Description</th>
|
||||||
|
<td>{{ stock.Description }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Quantity</th>
|
||||||
|
<td>{{ stock.Quantity }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_stock_index') }}">back to list</a>
|
||||||
|
|
||||||
|
<a href="{{ path('app_stock_edit', {'id': stock.id}) }}">edit</a>
|
||||||
|
|
||||||
|
{{ include('stock/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
4
templates/user/_delete_form.html.twig
Normal file
4
templates/user/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<form method="post" action="{{ path('app_user_delete', {'id': user.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||||
|
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ user.id) }}">
|
||||||
|
<button class="btn">Delete</button>
|
||||||
|
</form>
|
4
templates/user/_form.html.twig
Normal file
4
templates/user/_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,10 +0,0 @@
|
|||||||
{# templates/user/add.html.twig #}
|
|
||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Ajouter un utilisateur{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<h1>Ajouter un utilisateur</h1>
|
|
||||||
|
|
||||||
{{ form(form) }}
|
|
||||||
{% endblock %}
|
|
13
templates/user/edit.html.twig
Normal file
13
templates/user/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Edit User{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Edit User</h1>
|
||||||
|
|
||||||
|
{{ include('user/_form.html.twig', {'button_label': 'Update'}) }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_user_index') }}">back to list</a>
|
||||||
|
|
||||||
|
{{ include('user/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
47
templates/user/index.html.twig
Normal file
47
templates/user/index.html.twig
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}User index{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>User index</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>Email</th>
|
||||||
|
<th>FirstName</th>
|
||||||
|
<th>LastName</th>
|
||||||
|
<th>BirthDate</th>
|
||||||
|
<th>Phone</th>
|
||||||
|
<th>Roles</th>
|
||||||
|
<th>Password</th>
|
||||||
|
<th>actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for user in users %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ user.id }}</td>
|
||||||
|
<td>{{ user.email }}</td>
|
||||||
|
<td>{{ user.FirstName }}</td>
|
||||||
|
<td>{{ user.LastName }}</td>
|
||||||
|
<td>{{ user.BirthDate ? user.BirthDate|date('Y-m-d') : '' }}</td>
|
||||||
|
<td>{{ user.Phone }}</td>
|
||||||
|
<td>{{ user.roles ? user.roles|json_encode : '' }}</td>
|
||||||
|
<td>{{ user.password }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ path('app_user_show', {'id': user.id}) }}">show</a>
|
||||||
|
<a href="{{ path('app_user_edit', {'id': user.id}) }}">edit</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% else %}
|
||||||
|
<tr>
|
||||||
|
<td colspan="9">no records found</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_user_new') }}">Create new</a>
|
||||||
|
{% endblock %}
|
@ -1,14 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Hello UserController!{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
{% for user in users %}
|
|
||||||
{{ user.FirstName }}
|
|
||||||
{{ user.LastName }}
|
|
||||||
{{ user.BirthDate|date("Y-m-d") }}
|
|
||||||
{{ user.Email }}
|
|
||||||
{{ user.Phone }}
|
|
||||||
{{ user.Type }}
|
|
||||||
{% endfor %}
|
|
||||||
{% endblock %}
|
|
11
templates/user/new.html.twig
Normal file
11
templates/user/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}New User{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Create new User</h1>
|
||||||
|
|
||||||
|
{{ include('user/_form.html.twig') }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_user_index') }}">back to list</a>
|
||||||
|
{% endblock %}
|
50
templates/user/show.html.twig
Normal file
50
templates/user/show.html.twig
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}User{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>User</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<td>{{ user.id }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Email</th>
|
||||||
|
<td>{{ user.email }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>FirstName</th>
|
||||||
|
<td>{{ user.FirstName }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>LastName</th>
|
||||||
|
<td>{{ user.LastName }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>BirthDate</th>
|
||||||
|
<td>{{ user.BirthDate ? user.BirthDate|date('Y-m-d') : '' }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Phone</th>
|
||||||
|
<td>{{ user.Phone }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Roles</th>
|
||||||
|
<td>{{ user.roles ? user.roles|json_encode : '' }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Password</th>
|
||||||
|
<td>{{ user.password }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_user_index') }}">back to list</a>
|
||||||
|
|
||||||
|
<a href="{{ path('app_user_edit', {'id': user.id}) }}">edit</a>
|
||||||
|
|
||||||
|
{{ include('user/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
4
templates/vehicle/_delete_form.html.twig
Normal file
4
templates/vehicle/_delete_form.html.twig
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<form method="post" action="{{ path('app_vehicle_delete', {'id': vehicle.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||||
|
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ vehicle.id) }}">
|
||||||
|
<button class="btn">Delete</button>
|
||||||
|
</form>
|
4
templates/vehicle/_form.html.twig
Normal file
4
templates/vehicle/_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,10 +0,0 @@
|
|||||||
{# templates/user/add.html.twig #}
|
|
||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Ajouter un utilisateur{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
<h1>Ajouter un utilisateur</h1>
|
|
||||||
|
|
||||||
{{ form(form) }}
|
|
||||||
{% endblock %}
|
|
13
templates/vehicle/edit.html.twig
Normal file
13
templates/vehicle/edit.html.twig
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Edit Vehicle{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Edit Vehicle</h1>
|
||||||
|
|
||||||
|
{{ include('vehicle/_form.html.twig', {'button_label': 'Update'}) }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_vehicle_index') }}">back to list</a>
|
||||||
|
|
||||||
|
{{ include('vehicle/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
37
templates/vehicle/index.html.twig
Normal file
37
templates/vehicle/index.html.twig
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Vehicle index{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Vehicle index</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>LicensePlate</th>
|
||||||
|
<th>Brand</th>
|
||||||
|
<th>actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for vehicle in vehicles %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ vehicle.id }}</td>
|
||||||
|
<td>{{ vehicle.LicensePlate }}</td>
|
||||||
|
<td>{{ vehicle.Brand }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ path('app_vehicle_show', {'id': vehicle.id}) }}">show</a>
|
||||||
|
<a href="{{ path('app_vehicle_edit', {'id': vehicle.id}) }}">edit</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% else %}
|
||||||
|
<tr>
|
||||||
|
<td colspan="4">no records found</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_vehicle_new') }}">Create new</a>
|
||||||
|
{% endblock %}
|
@ -1,10 +0,0 @@
|
|||||||
{% extends 'base.html.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Hello UserController!{% endblock %}
|
|
||||||
|
|
||||||
{% block body %}
|
|
||||||
{% for vehicle in vehicles %}
|
|
||||||
{{ vehicle.LicensePlate }}
|
|
||||||
{{ vehicle.Brand }}
|
|
||||||
{% endfor %}
|
|
||||||
{% endblock %}
|
|
11
templates/vehicle/new.html.twig
Normal file
11
templates/vehicle/new.html.twig
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}New Vehicle{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Create new Vehicle</h1>
|
||||||
|
|
||||||
|
{{ include('vehicle/_form.html.twig') }}
|
||||||
|
|
||||||
|
<a href="{{ path('app_vehicle_index') }}">back to list</a>
|
||||||
|
{% endblock %}
|
30
templates/vehicle/show.html.twig
Normal file
30
templates/vehicle/show.html.twig
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}Vehicle{% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<h1>Vehicle</h1>
|
||||||
|
|
||||||
|
<table class="table">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<td>{{ vehicle.id }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>LicensePlate</th>
|
||||||
|
<td>{{ vehicle.LicensePlate }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Brand</th>
|
||||||
|
<td>{{ vehicle.Brand }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="{{ path('app_vehicle_index') }}">back to list</a>
|
||||||
|
|
||||||
|
<a href="{{ path('app_vehicle_edit', {'id': vehicle.id}) }}">edit</a>
|
||||||
|
|
||||||
|
{{ include('vehicle/_delete_form.html.twig') }}
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user