diff --git a/.env b/.env index 3666c82..128d6e1 100644 --- a/.env +++ b/.env @@ -32,7 +32,7 @@ DEFAULT_URI=http://localhost # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db" # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" # DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" -DATABASE_URL="mysql://contrib_root:123abc@127.0.0.1:3306/contrib?serverVersion=8.0.32&charset=utf8mb4" +DATABASE_URL="mysql://contribA_root:123abc@127.0.0.1:3306/contribC?serverVersion=8.0.32&charset=utf8mb4" ###< doctrine/doctrine-bundle ### ###> symfony/messenger ### # Choose one of the transports below diff --git a/src/Controller/ContributionController.php b/src/Controller/ContributionController.php new file mode 100644 index 0000000..d8b9e8c --- /dev/null +++ b/src/Controller/ContributionController.php @@ -0,0 +1,81 @@ +render('contribution/index.html.twig', [ + 'contributions' => $contributionRepository->findAll(), + ]); + } + + #[Route('/new', name: 'app_contribution_new', methods: ['GET', 'POST'])] + public function new(Request $request, EntityManagerInterface $entityManager): Response + { + $contribution = new Contribution(); + $form = $this->createForm(ContributionType::class, $contribution); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->persist($contribution); + $entityManager->flush(); + + return $this->redirectToRoute('app_contribution_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('contribution/new.html.twig', [ + 'contribution' => $contribution, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_contribution_show', methods: ['GET'])] + public function show(Contribution $contribution): Response + { + return $this->render('contribution/show.html.twig', [ + 'contribution' => $contribution, + ]); + } + + #[Route('/{id}/edit', name: 'app_contribution_edit', methods: ['GET', 'POST'])] + public function edit(Request $request, Contribution $contribution, EntityManagerInterface $entityManager): Response + { + $form = $this->createForm(ContributionType::class, $contribution); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->flush(); + + return $this->redirectToRoute('app_contribution_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('contribution/edit.html.twig', [ + 'contribution' => $contribution, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_contribution_delete', methods: ['POST'])] + public function delete(Request $request, Contribution $contribution, EntityManagerInterface $entityManager): Response + { + if ($this->isCsrfTokenValid('delete'.$contribution->getId(), $request->getPayload()->getString('_token'))) { + $entityManager->remove($contribution); + $entityManager->flush(); + } + + return $this->redirectToRoute('app_contribution_index', [], Response::HTTP_SEE_OTHER); + } +} diff --git a/src/Controller/MembreController.php b/src/Controller/MembreController.php index c16957c..8eca2f2 100644 --- a/src/Controller/MembreController.php +++ b/src/Controller/MembreController.php @@ -3,7 +3,8 @@ namespace App\Controller; use App\Entity\Membre; -use App\Form\MembreType; +use App\Form\Membre2Type; +use App\Repository\MembreRepository; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; @@ -14,14 +15,10 @@ use Symfony\Component\Routing\Attribute\Route; final class MembreController extends AbstractController { #[Route(name: 'app_membre_index', methods: ['GET'])] - public function index(EntityManagerInterface $entityManager): Response + public function index(MembreRepository $membreRepository): Response { - $membres = $entityManager - ->getRepository(Membre::class) - ->findAll(); - return $this->render('membre/index.html.twig', [ - 'membres' => $membres, + 'membres' => $membreRepository->findAll(), ]); } @@ -29,7 +26,7 @@ final class MembreController extends AbstractController public function new(Request $request, EntityManagerInterface $entityManager): Response { $membre = new Membre(); - $form = $this->createForm(MembreType::class, $membre); + $form = $this->createForm(Membre2Type::class, $membre); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { @@ -56,7 +53,7 @@ final class MembreController extends AbstractController #[Route('/{id}/edit', name: 'app_membre_edit', methods: ['GET', 'POST'])] public function edit(Request $request, Membre $membre, EntityManagerInterface $entityManager): Response { - $form = $this->createForm(MembreType::class, $membre); + $form = $this->createForm(Membre2Type::class, $membre); $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { diff --git a/src/Controller/ProjetController.php b/src/Controller/ProjetController.php new file mode 100644 index 0000000..c7e01c3 --- /dev/null +++ b/src/Controller/ProjetController.php @@ -0,0 +1,84 @@ +getRepository(Projet::class) + ->findAll(); + + return $this->render('projet/index.html.twig', [ + 'projets' => $projets, + ]); + } + + #[Route('/new', name: 'app_projet_new', methods: ['GET', 'POST'])] + public function new(Request $request, EntityManagerInterface $entityManager): Response + { + $projet = new Projet(); + $form = $this->createForm(ProjetType::class, $projet); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->persist($projet); + $entityManager->flush(); + + return $this->redirectToRoute('app_projet_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('projet/new.html.twig', [ + 'projet' => $projet, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_projet_show', methods: ['GET'])] + public function show(Projet $projet): Response + { + return $this->render('projet/show.html.twig', [ + 'projet' => $projet, + ]); + } + + #[Route('/{id}/edit', name: 'app_projet_edit', methods: ['GET', 'POST'])] + public function edit(Request $request, Projet $projet, EntityManagerInterface $entityManager): Response + { + $form = $this->createForm(ProjetType::class, $projet); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->flush(); + + return $this->redirectToRoute('app_projet_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('projet/edit.html.twig', [ + 'projet' => $projet, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_projet_delete', methods: ['POST'])] + public function delete(Request $request, Projet $projet, EntityManagerInterface $entityManager): Response + { + if ($this->isCsrfTokenValid('delete'.$projet->getId(), $request->getPayload()->getString('_token'))) { + $entityManager->remove($projet); + $entityManager->flush(); + } + + return $this->redirectToRoute('app_projet_index', [], Response::HTTP_SEE_OTHER); + } +} diff --git a/src/Entity/Contribution.php b/src/Entity/Contribution.php new file mode 100644 index 0000000..56617e3 --- /dev/null +++ b/src/Entity/Contribution.php @@ -0,0 +1,65 @@ + 0])] + private ?int $duree = 0; + + // Getters et Setters... + public function getId(): ?int + { + return $this->id; + } + + public function getMembre(): ?Membre + { + return $this->membre; + } + + public function setMembre(?Membre $membre): static + { + $this->membre = $membre; + return $this; + } + + public function getProjet(): ?Projet + { + return $this->projet; + } + + public function setProjet(?Projet $projet): static + { + $this->projet = $projet; + return $this; + } + + public function getDuree(): ?int + { + return $this->duree; + } + + public function setDuree(int $duree): static + { + $this->duree = $duree; + return $this; + } +} diff --git a/src/Entity/Droit.php b/src/Entity/Droit.php deleted file mode 100644 index 5640667..0000000 --- a/src/Entity/Droit.php +++ /dev/null @@ -1,35 +0,0 @@ -idDroit; - } - - public function getLibDroit(): ?string - { - return $this->libDroit; - } - - public function setLibDroit(string $libDroit): self - { - $this->libDroit = $libDroit; - return $this; - } -} diff --git a/src/Entity/Membre.php b/src/Entity/Membre.php index f862d59..0303821 100644 --- a/src/Entity/Membre.php +++ b/src/Entity/Membre.php @@ -1,37 +1,71 @@ 'dev'])] + private ?string $droit = 'dev'; - // Getters et setters - public function getId(): ?string { return $this->id; } - public function setId(string $id): self { $this->id = $id; return $this; } + #[ORM\OneToMany(mappedBy: 'membre', targetEntity: Contribution::class)] + private Collection $contributions; - public function getNom(): ?string { return $this->nom; } - public function setNom(string $nom): self { $this->nom = $nom; return $this; } + public function __construct() + { + $this->contributions = new ArrayCollection(); + } - public function getPassword(): ?string { return $this->password; } - public function setPassword(?string $password): self { $this->password = $password; return $this; } + // Getters et Setters... + public function getId(): ?string + { + return $this->id; + } - public function getDroit(): ?Droit { return $this->droit; } - public function setDroit(?Droit $droit): self { $this->droit = $droit; return $this; } + public function getNom(): ?string + { + return $this->nom; + } + + public function setNom(string $nom): static + { + $this->nom = $nom; + return $this; + } + + public function getPassword(): ?string + { + return $this->password; + } + + public function setPassword(string $password): static + { + $this->password = $password; + return $this; + } + + public function getDroit(): ?string + { + return $this->droit; + } + + public function setDroit(string $droit): static + { + $this->droit = $droit; + return $this; + } } diff --git a/src/Entity/Projet.php b/src/Entity/Projet.php new file mode 100644 index 0000000..d27ef0a --- /dev/null +++ b/src/Entity/Projet.php @@ -0,0 +1,35 @@ +id; + } + + public function getNom(): ?string + { + return $this->nom; + } + + public function setNom(string $nom): static + { + $this->nom = $nom; + return $this; + } +} diff --git a/src/Form/Membre1Type.php b/src/Form/ContributionType.php similarity index 57% rename from src/Form/Membre1Type.php rename to src/Form/ContributionType.php index 0bd8d45..7143db3 100644 --- a/src/Form/Membre1Type.php +++ b/src/Form/ContributionType.php @@ -2,23 +2,26 @@ namespace App\Form; -use App\Entity\Droit; +use App\Entity\Contribution; use App\Entity\Membre; +use App\Entity\Projet; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; -class Membre1Type extends AbstractType +class ContributionType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { $builder - ->add('id') - ->add('nom') - ->add('password') - ->add('droit', EntityType::class, [ - 'class' => Droit::class, + ->add('duree') + ->add('membre', EntityType::class, [ + 'class' => Membre::class, + 'choice_label' => 'id', + ]) + ->add('projet', EntityType::class, [ + 'class' => Projet::class, 'choice_label' => 'id', ]) ; @@ -27,7 +30,7 @@ class Membre1Type extends AbstractType public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'data_class' => Membre::class, + 'data_class' => Contribution::class, ]); } } diff --git a/src/Form/Membre2Type.php b/src/Form/Membre2Type.php new file mode 100644 index 0000000..42df1e6 --- /dev/null +++ b/src/Form/Membre2Type.php @@ -0,0 +1,45 @@ +add('id') + ->add('nom') + ->add('plainPassword', PasswordType::class, [ + 'label' => 'Mot de passe', + 'mapped' => false, + 'required' => false, + 'attr' => [ + 'placeholder' => 'Saisir le mot de passe', + ], + ]) + ->add('droit', ChoiceType::class, [ + 'label' => 'Droit', + 'choices' => [ + 'dev' => 'dev', + 'admin' => 'admin', + ], + 'placeholder' => 'Sélectionnez un droit', + 'required' => true, + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Membre::class, + ]); + } +} diff --git a/src/Form/MembreType.php b/src/Form/MembreType.php deleted file mode 100644 index 650d9fd..0000000 --- a/src/Form/MembreType.php +++ /dev/null @@ -1,33 +0,0 @@ -add('id') - ->add('nom') - ->add('password') - ->add('droit', EntityType::class, [ - 'class' => Droit::class, - 'choice_label' => 'id', - ]) - ; - } - - public function configureOptions(OptionsResolver $resolver): void - { - $resolver->setDefaults([ - 'data_class' => Membre::class, - ]); - } -} diff --git a/src/Form/DroitType.php b/src/Form/ProjetType.php similarity index 73% rename from src/Form/DroitType.php rename to src/Form/ProjetType.php index b683c94..c7f27f0 100644 --- a/src/Form/DroitType.php +++ b/src/Form/ProjetType.php @@ -2,24 +2,25 @@ namespace App\Form; -use App\Entity\Droit; +use App\Entity\Projet; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; -class DroitType extends AbstractType +class ProjetType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { $builder - ->add('libDroit') + ->add('id') + ->add('nom') ; } public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'data_class' => Droit::class, + 'data_class' => Projet::class, ]); } } diff --git a/templates/_bootstrap.html.twig b/templates/_bootstrap.html.twig new file mode 100644 index 0000000..1eb3e62 --- /dev/null +++ b/templates/_bootstrap.html.twig @@ -0,0 +1,13 @@ +{# + Shared partial to include Bootstrap. Use with: + {{ include('_bootstrap.html.twig', { part: 'css' }) }} in the + {{ include('_bootstrap.html.twig', { part: 'js' }) }} before closing +#} + +{% if part == 'css' %} + +{% elseif part == 'js' %} + +{% endif %} + + diff --git a/templates/base.html.twig b/templates/base.html.twig index 3cda30f..be2ad1b 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -5,13 +5,17 @@ {% block title %}Welcome!{% endblock %} {% block stylesheets %} + {{ include('_bootstrap.html.twig', { part: 'css' }) }} {% endblock %} {% block javascripts %} + {{ include('_bootstrap.html.twig', { part: 'js' }) }} {% block importmap %}{{ importmap('app') }}{% endblock %} {% endblock %} - {% block body %}{% endblock %} +
+ {% block body %}{% endblock %} +
diff --git a/templates/contribution/_delete_form.html.twig b/templates/contribution/_delete_form.html.twig new file mode 100644 index 0000000..0a079b3 --- /dev/null +++ b/templates/contribution/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/droit/_form.html.twig b/templates/contribution/_form.html.twig similarity index 100% rename from templates/droit/_form.html.twig rename to templates/contribution/_form.html.twig diff --git a/templates/contribution/edit.html.twig b/templates/contribution/edit.html.twig new file mode 100644 index 0000000..9f48315 --- /dev/null +++ b/templates/contribution/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Contribution{% endblock %} + +{% block body %} +

Edit Contribution

+ + {{ include('contribution/_form.html.twig', {'button_label': 'Update'}) }} + + back to list + + {{ include('contribution/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/contribution/index.html.twig b/templates/contribution/index.html.twig new file mode 100644 index 0000000..c3f2f0e --- /dev/null +++ b/templates/contribution/index.html.twig @@ -0,0 +1,35 @@ +{% extends 'base.html.twig' %} + +{% block title %}Contribution index{% endblock %} + +{% block body %} +

Contribution index

+ + + + + + + + + + + {% for contribution in contributions %} + + + + + + {% else %} + + + + {% endfor %} + +
IdDureeactions
{{ contribution.id }}{{ contribution.duree }} + show + edit +
no records found
+ + Create new +{% endblock %} diff --git a/templates/contribution/new.html.twig b/templates/contribution/new.html.twig new file mode 100644 index 0000000..a707508 --- /dev/null +++ b/templates/contribution/new.html.twig @@ -0,0 +1,11 @@ +{% extends 'base.html.twig' %} + +{% block title %}New Contribution{% endblock %} + +{% block body %} +

Create new Contribution

+ + {{ include('contribution/_form.html.twig') }} + + back to list +{% endblock %} diff --git a/templates/contribution/show.html.twig b/templates/contribution/show.html.twig new file mode 100644 index 0000000..666f8fe --- /dev/null +++ b/templates/contribution/show.html.twig @@ -0,0 +1,26 @@ +{% extends 'base.html.twig' %} + +{% block title %}Contribution{% endblock %} + +{% block body %} +

Contribution

+ + + + + + + + + + + + +
Id{{ contribution.id }}
Duree{{ contribution.duree }}
+ + back to list + + edit + + {{ include('contribution/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/droit/_delete_form.html.twig b/templates/droit/_delete_form.html.twig deleted file mode 100644 index 72f8f60..0000000 --- a/templates/droit/_delete_form.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -
- - -
diff --git a/templates/droit/edit.html.twig b/templates/droit/edit.html.twig deleted file mode 100644 index 65b34b9..0000000 --- a/templates/droit/edit.html.twig +++ /dev/null @@ -1,13 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Edit Droit{% endblock %} - -{% block body %} -

Edit Droit

- - {{ include('droit/_form.html.twig', {'button_label': 'Update'}) }} - - back to list - - {{ include('droit/_delete_form.html.twig') }} -{% endblock %} diff --git a/templates/droit/index.html.twig b/templates/droit/index.html.twig deleted file mode 100644 index 97a79dd..0000000 --- a/templates/droit/index.html.twig +++ /dev/null @@ -1,35 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Droit index{% endblock %} - -{% block body %} -

Droit index

- - - - - - - - - - - {% for droit in droits %} - - - - - - {% else %} - - - - {% endfor %} - -
IdDroitLibDroitactions
{{ droit.idDroit }}{{ droit.libDroit }} - show - edit -
no records found
- - Create new -{% endblock %} diff --git a/templates/droit/new.html.twig b/templates/droit/new.html.twig deleted file mode 100644 index 2d8e46d..0000000 --- a/templates/droit/new.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}New Droit{% endblock %} - -{% block body %} -

Create new Droit

- - {{ include('droit/_form.html.twig') }} - - back to list -{% endblock %} diff --git a/templates/droit/show.html.twig b/templates/droit/show.html.twig deleted file mode 100644 index 79b5940..0000000 --- a/templates/droit/show.html.twig +++ /dev/null @@ -1,26 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Droit{% endblock %} - -{% block body %} -

Droit

- - - - - - - - - - - - -
IdDroit{{ droit.idDroit }}
LibDroit{{ droit.libDroit }}
- - back to list - - edit - - {{ include('droit/_delete_form.html.twig') }} -{% endblock %} diff --git a/templates/membre/_delete_form.html.twig b/templates/membre/_delete_form.html.twig index ca0dc03..9dee850 100644 --- a/templates/membre/_delete_form.html.twig +++ b/templates/membre/_delete_form.html.twig @@ -1,4 +1,4 @@
- +
diff --git a/templates/membre/_form.html.twig b/templates/membre/_form.html.twig index bf20b98..9328bd5 100644 --- a/templates/membre/_form.html.twig +++ b/templates/membre/_form.html.twig @@ -1,4 +1,4 @@ {{ form_start(form) }} {{ form_widget(form) }} - + {{ form_end(form) }} diff --git a/templates/membre/edit.html.twig b/templates/membre/edit.html.twig index b0853ab..5fb468d 100644 --- a/templates/membre/edit.html.twig +++ b/templates/membre/edit.html.twig @@ -3,11 +3,16 @@ {% block title %}Edit Membre{% endblock %} {% block body %} -

Edit Membre

- - {{ include('membre/_form.html.twig', {'button_label': 'Update'}) }} - - back to list - - {{ include('membre/_delete_form.html.twig') }} +
+
+

Edit Membre

+
+
+ {{ include('membre/_form.html.twig', {'button_label': 'Update'}) }} +
+ Back to list + {{ include('membre/_delete_form.html.twig') }} +
+
+
{% endblock %} diff --git a/templates/membre/index.html.twig b/templates/membre/index.html.twig index 42c2c1b..fce0bef 100644 --- a/templates/membre/index.html.twig +++ b/templates/membre/index.html.twig @@ -2,44 +2,37 @@ {% block title %}Membre index{% endblock %} -{% block stylesheets %} - {{ parent() }} - {# Ajouter Bootstrap depuis le CDN #} - -{% endblock %} - {% block body %} -
-

Membre index

- - - - - - - - - - - - {% for membre in membres %} - - - - - - - {% else %} - - - - {% endfor %} - -
IdNomPasswordActions
{{ membre.id }}{{ membre.nom }}{{ membre.password }} - Show - Edit -
No records found
- +
+

Membres

Create new
+ + + + + + + + + + + + {% for membre in membres %} + + + + + + + {% else %} + + + + {% endfor %} + +
IdNomDroitActions
{{ membre.id }}{{ membre.nom }}{{ membre.droit }} + Show + Edit +
No records found
{% endblock %} diff --git a/templates/membre/membre.html.twig b/templates/membre/membre.html.twig deleted file mode 100644 index 08bc696..0000000 --- a/templates/membre/membre.html.twig +++ /dev/null @@ -1,22 +0,0 @@ -{# templates/membre/index.html.twig #} - -

Liste des Membres

- - - - - - - - - - - {% for membre in membres %} - - - - - - {% endfor %} - -
IDNomDroit
{{ membre.id }}{{ membre.nom }}{{ membre.droit ? membre.droit.nom : 'Aucun' }}
\ No newline at end of file diff --git a/templates/membre/new.html.twig b/templates/membre/new.html.twig index fb021c6..5d8d86e 100644 --- a/templates/membre/new.html.twig +++ b/templates/membre/new.html.twig @@ -3,9 +3,13 @@ {% block title %}New Membre{% endblock %} {% block body %} -

Create new Membre

- - {{ include('membre/_form.html.twig') }} - - back to list +
+
+

Create new Membre

+
+
+ {{ include('membre/_form.html.twig') }} + Back to list +
+
{% endblock %} diff --git a/templates/membre/show.html.twig b/templates/membre/show.html.twig index c88e2b0..d7e8f9c 100644 --- a/templates/membre/show.html.twig +++ b/templates/membre/show.html.twig @@ -3,9 +3,15 @@ {% block title %}Membre{% endblock %} {% block body %} -

Membre

+
+

Membre #{{ membre.id }}

+
+ Edit + Back to list +
+
- +
@@ -17,14 +23,16 @@ - + + + + +
Id
Password{{ membre.password }}********
Droit{{ membre.droit }}
- back to list - - edit - - {{ include('membre/_delete_form.html.twig') }} +
+ {{ include('membre/_delete_form.html.twig') }} +
{% endblock %} diff --git a/templates/projet/_delete_form.html.twig b/templates/projet/_delete_form.html.twig new file mode 100644 index 0000000..1e7a1de --- /dev/null +++ b/templates/projet/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/projet/_form.html.twig b/templates/projet/_form.html.twig new file mode 100644 index 0000000..bf20b98 --- /dev/null +++ b/templates/projet/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/projet/edit.html.twig b/templates/projet/edit.html.twig new file mode 100644 index 0000000..8f8a7f9 --- /dev/null +++ b/templates/projet/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Projet{% endblock %} + +{% block body %} +

Edit Projet

+ + {{ include('projet/_form.html.twig', {'button_label': 'Update'}) }} + + back to list + + {{ include('projet/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/projet/index.html.twig b/templates/projet/index.html.twig new file mode 100644 index 0000000..1b04eff --- /dev/null +++ b/templates/projet/index.html.twig @@ -0,0 +1,35 @@ +{% extends 'base.html.twig' %} + +{% block title %}Projet index{% endblock %} + +{% block body %} +

Projet index

+ + + + + + + + + + + {% for projet in projets %} + + + + + + {% else %} + + + + {% endfor %} + +
IdNomactions
{{ projet.id }}{{ projet.nom }} + show + edit +
no records found
+ + Create new +{% endblock %} diff --git a/templates/projet/new.html.twig b/templates/projet/new.html.twig new file mode 100644 index 0000000..16d4f71 --- /dev/null +++ b/templates/projet/new.html.twig @@ -0,0 +1,11 @@ +{% extends 'base.html.twig' %} + +{% block title %}New Projet{% endblock %} + +{% block body %} +

Create new Projet

+ + {{ include('projet/_form.html.twig') }} + + back to list +{% endblock %} diff --git a/templates/projet/show.html.twig b/templates/projet/show.html.twig new file mode 100644 index 0000000..a4f7a6e --- /dev/null +++ b/templates/projet/show.html.twig @@ -0,0 +1,26 @@ +{% extends 'base.html.twig' %} + +{% block title %}Projet{% endblock %} + +{% block body %} +

Projet

+ + + + + + + + + + + + +
Id{{ projet.id }}
Nom{{ projet.nom }}
+ + back to list + + edit + + {{ include('projet/_delete_form.html.twig') }} +{% endblock %}