From 62da326e7508dfdca601a3d70938b9534ad729e2 Mon Sep 17 00:00:00 2001 From: clfreville2 Date: Fri, 7 Jun 2024 09:10:06 +0200 Subject: [PATCH 01/20] Create an empty controllers directory --- assets/controllers/.gitignore | 0 templates/base.html.twig | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 assets/controllers/.gitignore diff --git a/assets/controllers/.gitignore b/assets/controllers/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/templates/base.html.twig b/templates/base.html.twig index bbf16f1..233148c 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -8,7 +8,7 @@ {% endblock %} {% block javascripts %} - {% block importmap %}{% endblock %} + {% block importmap %}{{ importmap('app') }}{% endblock %} {% endblock %} -- 2.43.0 From 82a3f69fa42598e2322fbc37f06f3ecf0c72e972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20LAPORTE?= Date: Fri, 7 Jun 2024 15:27:55 +0200 Subject: [PATCH 02/20] View (#8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Création de la page species et detail specie Co-authored-by: Clément Laporte Co-authored-by: clfreville2 Reviewed-on: https://codefirst.iut.uca.fr/git/clement.freville2/herbarium/pulls/8 Co-authored-by: Clément LAPORTE Co-committed-by: Clément LAPORTE --- src/Controller/SpeciesController.php | 29 +++++++++++++++++++ src/DataFixtures/AppFixtures.php | 3 +- templates/species/detail.html.twig | 43 ++++++++++++++++++++++++++++ templates/species/index.html.twig | 29 +++++++++++++++++++ 4 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 src/Controller/SpeciesController.php create mode 100644 templates/species/detail.html.twig create mode 100644 templates/species/index.html.twig diff --git a/src/Controller/SpeciesController.php b/src/Controller/SpeciesController.php new file mode 100644 index 0000000..e727c11 --- /dev/null +++ b/src/Controller/SpeciesController.php @@ -0,0 +1,29 @@ +findAll(); + return $this->render('species/index.html.twig', [ + 'species' => $species, + ]); + } + + #[Route('/species/{id}', name: 'app_species_detail')] + public function detail(Species $specie): Response + { + return $this->render('species/detail.html.twig', [ + 'specie' => $specie, + ]); + } +} diff --git a/src/DataFixtures/AppFixtures.php b/src/DataFixtures/AppFixtures.php index 12d5f40..2fbb47f 100644 --- a/src/DataFixtures/AppFixtures.php +++ b/src/DataFixtures/AppFixtures.php @@ -25,7 +25,8 @@ class AppFixtures extends Fixture ->setPublicationDate($date) ->setLatitude($faker->randomFloat()) ->setLongitude($faker->randomFloat()) - ->setCommentary($faker->text()); + ->setCommentary($faker->text()) + -> setSpecies($species); $manager->persist($species); $manager->persist($post); } diff --git a/templates/species/detail.html.twig b/templates/species/detail.html.twig new file mode 100644 index 0000000..d6a5ebf --- /dev/null +++ b/templates/species/detail.html.twig @@ -0,0 +1,43 @@ +{% extends 'base.html.twig' %} + +{% block title %}Herbarium - Détail de l'espèces{% endblock %} + +{% block body %} + + +
+

{{ specie.vernacularName }}

+

+ 🔬 Nom Scientifique : {{ specie.scientificName }}
+ 📍 Region : {{ specie.region }} +

+
+

Posts :

+ + {% for post in specie.posts %} +
+
+

+ + 📅 {{ post.publicationDate | date }} + +

+
+
+ 📍 géolocalisation :
+ - Longitude : {{ post.longitude }}
+ - Latitude : {{ post.latitude }}
+ - Altitude : {{ post.altitude }}

+ + 💬 Commentaire :
+ - {{ post.getCommentary }} +
+
+ {% endfor %} +
+ +
+{% endblock %} \ No newline at end of file diff --git a/templates/species/index.html.twig b/templates/species/index.html.twig new file mode 100644 index 0000000..666ad41 --- /dev/null +++ b/templates/species/index.html.twig @@ -0,0 +1,29 @@ +{% extends 'base.html.twig' %} + +{% block title %}Herbarium - Espèces{% endblock %} + +{% block body %} + + +
+

Liste des espèces

+ +
+ {% for specie in species %} +
+ + 🌿 {{ specie.getVernacularName }} + +
+
+ 🔬 Nom Scientifique : {{ specie.getScientificName }}
+ 📍 Region : {{ specie.getRegion }} +

+ {% endfor %} +
+ +
+{% endblock %} -- 2.43.0 From 49d60871c981b39dce1e7726b4691af63ab290bc Mon Sep 17 00:00:00 2001 From: clfreville2 Date: Fri, 7 Jun 2024 17:49:12 +0200 Subject: [PATCH 03/20] Add post and species forms Squashed commit of the following: Author: Hugo PRADIER Author: bastien ollier Author: clfreville2 Reviewed on #7 --- composer.json | 2 +- composer.lock | 29 ++--- phpstan.dist.neon | 1 - src/Controller/PostController.php | 68 ++++++++++- src/Controller/RegistrationController.php | 6 +- src/Controller/SpeciesController.php | 72 ++++++++++-- src/DataFixtures/AppFixtures.php | 14 ++- src/Entity/Post.php | 3 + src/Entity/Species.php | 4 + src/Form/PostType.php | 38 ++++++ src/Form/SpeciesType.php | 27 +++++ src/Repository/UserRepository.php | 10 ++ templates/post/_delete_form.html.twig | 4 + templates/post/_form.html.twig | 4 + templates/post/edit.html.twig | 13 +++ templates/post/index.html.twig | 11 -- templates/post/new.html.twig | 11 ++ templates/post/show.html.twig | 46 ++++++++ templates/post/table.html.twig | 45 +++++++ templates/species/_delete_form.html.twig | 4 + templates/species/_form.html.twig | 4 + templates/species/detail.html.twig | 43 ------- templates/species/edit.html.twig | 13 +++ templates/species/index.html.twig | 11 +- templates/species/new.html.twig | 11 ++ templates/species/show.html.twig | 36 ++++++ templates/species/table.html.twig | 39 +++++++ tests/Controller/PostControllerTest.php | 128 ++++++++++++++++++++ tests/Controller/SpeciesControllerTest.php | 129 +++++++++++++++++++++ 29 files changed, 740 insertions(+), 86 deletions(-) create mode 100644 src/Form/PostType.php create mode 100644 src/Form/SpeciesType.php create mode 100644 templates/post/_delete_form.html.twig create mode 100644 templates/post/_form.html.twig create mode 100644 templates/post/edit.html.twig delete mode 100644 templates/post/index.html.twig create mode 100644 templates/post/new.html.twig create mode 100644 templates/post/show.html.twig create mode 100644 templates/post/table.html.twig create mode 100644 templates/species/_delete_form.html.twig create mode 100644 templates/species/_form.html.twig delete mode 100644 templates/species/detail.html.twig create mode 100644 templates/species/edit.html.twig create mode 100644 templates/species/new.html.twig create mode 100644 templates/species/show.html.twig create mode 100644 templates/species/table.html.twig create mode 100644 tests/Controller/PostControllerTest.php create mode 100644 tests/Controller/SpeciesControllerTest.php diff --git a/composer.json b/composer.json index 0a5a255..c02ecbd 100644 --- a/composer.json +++ b/composer.json @@ -109,7 +109,7 @@ "symfony/browser-kit": "7.0.*", "symfony/css-selector": "7.0.*", "symfony/debug-bundle": "7.0.*", - "symfony/maker-bundle": "^1.0", + "symfony/maker-bundle": "^1.59", "symfony/phpunit-bridge": "^7.0", "symfony/stopwatch": "7.0.*", "symfony/web-profiler-bundle": "7.0.*" diff --git a/composer.lock b/composer.lock index a528b05..12a1306 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cce9cbfaf4a49449e6431a8515f9d9eb", + "content-hash": "9df70d112adfdfa4fbcde08b504d0bb9", "packages": [ { "name": "api-platform/core", @@ -3757,16 +3757,16 @@ }, { "name": "symfony/form", - "version": "v7.0.7", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "b4df6a399a2b03782a0163807239db342659f54f" + "reference": "1d0128e2f7e80c346ec51fa4d1ce4fec0d435eeb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/b4df6a399a2b03782a0163807239db342659f54f", - "reference": "b4df6a399a2b03782a0163807239db342659f54f", + "url": "https://api.github.com/repos/symfony/form/zipball/1d0128e2f7e80c346ec51fa4d1ce4fec0d435eeb", + "reference": "1d0128e2f7e80c346ec51fa4d1ce4fec0d435eeb", "shasum": "" }, "require": { @@ -3833,7 +3833,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v7.0.7" + "source": "https://github.com/symfony/form/tree/v7.0.8" }, "funding": [ { @@ -3849,7 +3849,7 @@ "type": "tidelift" } ], - "time": "2024-04-28T11:44:19+00:00" + "time": "2024-05-31T14:55:39+00:00" }, { "name": "symfony/framework-bundle", @@ -7137,16 +7137,16 @@ }, { "name": "symfony/validator", - "version": "v7.0.7", + "version": "v7.0.8", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "ab4e75b9d23ba70e78480aecbe4d8da15adf10eb" + "reference": "23af65dff1f4dfee9aab3a0123a243e40fa3d9cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/ab4e75b9d23ba70e78480aecbe4d8da15adf10eb", - "reference": "ab4e75b9d23ba70e78480aecbe4d8da15adf10eb", + "url": "https://api.github.com/repos/symfony/validator/zipball/23af65dff1f4dfee9aab3a0123a243e40fa3d9cf", + "reference": "23af65dff1f4dfee9aab3a0123a243e40fa3d9cf", "shasum": "" }, "require": { @@ -7191,7 +7191,8 @@ "Symfony\\Component\\Validator\\": "" }, "exclude-from-classmap": [ - "/Tests/" + "/Tests/", + "/Resources/bin/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -7211,7 +7212,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v7.0.7" + "source": "https://github.com/symfony/validator/tree/v7.0.8" }, "funding": [ { @@ -7227,7 +7228,7 @@ "type": "tidelift" } ], - "time": "2024-04-28T11:44:19+00:00" + "time": "2024-06-02T15:49:03+00:00" }, { "name": "symfony/var-dumper", diff --git a/phpstan.dist.neon b/phpstan.dist.neon index afb7a06..b7cb307 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -7,4 +7,3 @@ parameters: level: 8 paths: - src - - tests diff --git a/src/Controller/PostController.php b/src/Controller/PostController.php index 0df3016..8bbe909 100644 --- a/src/Controller/PostController.php +++ b/src/Controller/PostController.php @@ -2,19 +2,85 @@ namespace App\Controller; +use App\Entity\Post; +use App\Form\PostType; use App\Repository\PostRepository; +use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; +use Symfony\Component\Security\Http\Attribute\IsGranted; class PostController extends AbstractController { #[Route('/', name: 'app_posts')] + #[Route('/post', name: 'app_post_index', methods: ['GET'])] public function index(PostRepository $repository): Response { $posts = $repository->findAll(); - return $this->render('post/index.html.twig', [ + return $this->render('post/table.html.twig', [ 'posts' => $posts, ]); } + + #[Route('/post/new', name: 'app_post_new', methods: ['GET', 'POST'])] + #[IsGranted('ROLE_USER')] + public function new(Request $request, EntityManagerInterface $entityManager): Response + { + $post = new Post(); + $form = $this->createForm(PostType::class, $post); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->persist($post); + $entityManager->flush(); + + return $this->redirectToRoute('app_posts', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('post/new.html.twig', [ + 'post' => $post, + 'form' => $form, + ]); + } + + #[Route('/post/{id}', name: 'app_post_show', methods: ['GET'])] + public function show(Post $post): Response + { + return $this->render('post/show.html.twig', [ + 'post' => $post, + ]); + } + + #[Route('/post/{id}/edit', name: 'app_post_edit', methods: ['GET', 'POST'])] + #[IsGranted('ROLE_USER')] + public function edit(Request $request, Post $post, EntityManagerInterface $entityManager): Response + { + $form = $this->createForm(PostType::class, $post); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->flush(); + + return $this->redirectToRoute('app_posts', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('post/edit.html.twig', [ + 'post' => $post, + 'form' => $form, + ]); + } + + #[Route('/post/{id}', name: 'app_post_delete', methods: ['POST'])] + #[IsGranted('ROLE_USER')] + public function delete(Request $request, Post $post, EntityManagerInterface $entityManager): Response + { + if ($this->isCsrfTokenValid('delete'.$post->getId(), (string) $request->getPayload()->get('_token'))) { + $entityManager->remove($post); + $entityManager->flush(); + } + + return $this->redirectToRoute('app_posts', [], Response::HTTP_SEE_OTHER); + } } diff --git a/src/Controller/RegistrationController.php b/src/Controller/RegistrationController.php index 6bfc237..43043a9 100644 --- a/src/Controller/RegistrationController.php +++ b/src/Controller/RegistrationController.php @@ -34,7 +34,11 @@ class RegistrationController extends AbstractController // do anything else you need here, like send an email - return $this->redirectToRoute('_profiler_home'); + return $this->redirectToRoute('app_login'); + } + + if ($this->getUser()) { + return $this->redirectToRoute('app_posts'); } return $this->render('registration/register.html.twig', [ diff --git a/src/Controller/SpeciesController.php b/src/Controller/SpeciesController.php index e727c11..a495a0f 100644 --- a/src/Controller/SpeciesController.php +++ b/src/Controller/SpeciesController.php @@ -3,27 +3,83 @@ namespace App\Controller; use App\Entity\Species; +use App\Form\SpeciesType; use App\Repository\SpeciesRepository; +use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; +use Symfony\Component\Security\Http\Attribute\IsGranted; +#[Route('/species')] class SpeciesController extends AbstractController { - #[Route('/species', name: 'app_species')] - public function index(SpeciesRepository $repository): Response + #[Route('/', name: 'app_species_index', methods: ['GET'])] + public function table(SpeciesRepository $speciesRepository): Response { - $species = $repository->findAll(); - return $this->render('species/index.html.twig', [ + return $this->render('species/table.html.twig', [ + 'species' => $speciesRepository->findAll(), + ]); + } + + #[Route('/new', name: 'app_species_new', methods: ['GET', 'POST'])] + #[IsGranted('ROLE_USER')] + public function new(Request $request, EntityManagerInterface $entityManager): Response + { + $species = new Species(); + $form = $this->createForm(SpeciesType::class, $species); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->persist($species); + $entityManager->flush(); + + return $this->redirectToRoute('app_species_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('species/new.html.twig', [ + 'species' => $species, + 'form' => $form, + ]); + } + + #[Route('/{id}', name: 'app_species_show', methods: ['GET'])] + public function show(Species $species): Response + { + return $this->render('species/show.html.twig', [ 'species' => $species, ]); } - #[Route('/species/{id}', name: 'app_species_detail')] - public function detail(Species $specie): Response + #[Route('/{id}/edit', name: 'app_species_edit', methods: ['GET', 'POST'])] + #[IsGranted('ROLE_USER')] + public function edit(Request $request, Species $species, EntityManagerInterface $entityManager): Response { - return $this->render('species/detail.html.twig', [ - 'specie' => $specie, + $form = $this->createForm(SpeciesType::class, $species); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $entityManager->flush(); + + return $this->redirectToRoute('app_species_index', [], Response::HTTP_SEE_OTHER); + } + + return $this->render('species/edit.html.twig', [ + 'species' => $species, + 'form' => $form, ]); } + + #[Route('/{id}', name: 'app_species_delete', methods: ['POST'])] + #[IsGranted('ROLE_USER')] + public function delete(Request $request, Species $species, EntityManagerInterface $entityManager): Response + { + if ($this->isCsrfTokenValid('delete'.$species->getId(), (string) $request->getPayload()->get('_token'))) { + $entityManager->remove($species); + $entityManager->flush(); + } + + return $this->redirectToRoute('app_species_index', [], Response::HTTP_SEE_OTHER); + } } diff --git a/src/DataFixtures/AppFixtures.php b/src/DataFixtures/AppFixtures.php index 2fbb47f..6bff9e2 100644 --- a/src/DataFixtures/AppFixtures.php +++ b/src/DataFixtures/AppFixtures.php @@ -4,17 +4,29 @@ namespace App\DataFixtures; use App\Entity\Post; use App\Entity\Species; +use App\Entity\User; use DateTimeImmutable; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Persistence\ObjectManager; +use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; class AppFixtures extends Fixture { + public function __construct( + private readonly UserPasswordHasherInterface $passwordHasher + ) + { + } + public function load(ObjectManager $manager): void { + $user = (new User())->setEmail('test@test.fr'); + $user->setPassword($this->passwordHasher->hashPassword($user, 'password')); + $manager->persist($user); + $faker = \Faker\Factory::create(); for ($i = 0; $i < 20; ++$i) { - $name = $faker->text(); + $name = $faker->name(); $species = (new Species()) ->setScientificName($name) ->setVernacularName($name) diff --git a/src/Entity/Post.php b/src/Entity/Post.php index 0b54550..22e346a 100644 --- a/src/Entity/Post.php +++ b/src/Entity/Post.php @@ -11,6 +11,7 @@ use App\Repository\PostRepository; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Attribute\Groups; +use Symfony\Component\Validator\Constraints as Assert; #[ORM\Entity(repositoryClass: PostRepository::class)] #[ORM\HasLifecycleCallbacks] @@ -30,6 +31,7 @@ class Post #[ORM\Column] #[Groups(['post:collection:read'])] + #[Assert\NotBlank] private ?\DateTimeImmutable $foundDate = null; #[ORM\Column] @@ -51,6 +53,7 @@ class Post #[ORM\Column(type: Types::TEXT)] #[Groups(['post:read'])] + #[Assert\NotBlank] private ?string $commentary = null; #[ORM\ManyToOne(inversedBy: 'posts')] diff --git a/src/Entity/Species.php b/src/Entity/Species.php index e2e1b78..285fe6c 100644 --- a/src/Entity/Species.php +++ b/src/Entity/Species.php @@ -9,6 +9,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Attribute\Groups; +use Symfony\Component\Validator\Constraints as Assert; #[ORM\Entity(repositoryClass: SpeciesRepository::class)] #[ApiResource( @@ -26,14 +27,17 @@ class Species #[ORM\Column(length: 255)] #[Groups(['species:collection:read'])] + #[Assert\NotBlank] private ?string $scientific_name = null; #[ORM\Column(length: 255)] #[Groups(['species:collection:read'])] + #[Assert\NotBlank] private ?string $vernacular_name = null; #[ORM\Column(length: 255)] #[Groups(['species:collection:read'])] + #[Assert\NotBlank] private ?string $region = null; /** diff --git a/src/Form/PostType.php b/src/Form/PostType.php new file mode 100644 index 0000000..bea7e6f --- /dev/null +++ b/src/Form/PostType.php @@ -0,0 +1,38 @@ +add('foundDate', null, [ + 'widget' => 'single_text', + ]) + ->add('latitude') + ->add('longitude') + ->add('altitude') + ->add('commentary') + ->add('species', EntityType::class, [ + 'class' => Species::class, + 'choice_label' => 'scientific_name', + ]) + + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Post::class, + ]); + } +} diff --git a/src/Form/SpeciesType.php b/src/Form/SpeciesType.php new file mode 100644 index 0000000..ae3b919 --- /dev/null +++ b/src/Form/SpeciesType.php @@ -0,0 +1,27 @@ +add('scientific_name') + ->add('vernacular_name') + ->add('region') + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Species::class, + ]); + } +} diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php index 4f2804e..e861224 100644 --- a/src/Repository/UserRepository.php +++ b/src/Repository/UserRepository.php @@ -33,6 +33,16 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader $this->getEntityManager()->flush(); } + public function findOneByEmail(string $email): ?User + { + return $this->createQueryBuilder('u') + ->andWhere('u.email = :email') + ->setParameter('email', $email) + ->getQuery() + ->getOneOrNullResult() + ; + } + // /** // * @return User[] Returns an array of User objects // */ diff --git a/templates/post/_delete_form.html.twig b/templates/post/_delete_form.html.twig new file mode 100644 index 0000000..1223c9b --- /dev/null +++ b/templates/post/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/post/_form.html.twig b/templates/post/_form.html.twig new file mode 100644 index 0000000..bf20b98 --- /dev/null +++ b/templates/post/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/post/edit.html.twig b/templates/post/edit.html.twig new file mode 100644 index 0000000..16b6b5f --- /dev/null +++ b/templates/post/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Post{% endblock %} + +{% block body %} +

Edit Post

+ + {{ include('post/_form.html.twig', {'button_label': 'Update'}) }} + + back to list + + {{ include('post/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/post/index.html.twig b/templates/post/index.html.twig deleted file mode 100644 index 94f3756..0000000 --- a/templates/post/index.html.twig +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Posts!{% endblock %} - -{% block body %} -{% for post in posts %} -
- #{{ post.id }} trouvé le {{ post.foundDate | date("d/m/Y \\à H \\h") }} -
-{% endfor %} -{% endblock %} diff --git a/templates/post/new.html.twig b/templates/post/new.html.twig new file mode 100644 index 0000000..b8bc236 --- /dev/null +++ b/templates/post/new.html.twig @@ -0,0 +1,11 @@ +{% extends 'base.html.twig' %} + +{% block title %}New Post{% endblock %} + +{% block body %} +

Create new Post

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

Post

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Id{{ post.id }}
FoundDate{{ post.foundDate ? post.foundDate|date('Y-m-d H:i:s') : '' }}
PublicationDate{{ post.publicationDate ? post.publicationDate|date('Y-m-d H:i:s') : '' }}
Latitude{{ post.latitude }}
Longitude{{ post.longitude }}
Altitude{{ post.altitude }}
Commentary{{ post.commentary }}
+ + back to list + + edit + + {{ include('post/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/post/table.html.twig b/templates/post/table.html.twig new file mode 100644 index 0000000..3a5db93 --- /dev/null +++ b/templates/post/table.html.twig @@ -0,0 +1,45 @@ +{% extends 'base.html.twig' %} + +{% block title %}Post index{% endblock %} + +{% block body %} +

Post index

+ + + + + + + + + + + + + + + + {% for post in posts %} + + + + + + + + + + + {% else %} + + + + {% endfor %} + +
IdFoundDatePublicationDateLatitudeLongitudeAltitudeCommentaryactions
{{ post.id }}{{ post.foundDate ? post.foundDate|date('Y-m-d H:i:s') : '' }}{{ post.publicationDate ? post.publicationDate|date('Y-m-d H:i:s') : '' }}{{ post.latitude }}{{ post.longitude }}{{ post.altitude }}{{ post.commentary }} + show + edit +
no records found
+ + Create new +{% endblock %} diff --git a/templates/species/_delete_form.html.twig b/templates/species/_delete_form.html.twig new file mode 100644 index 0000000..9e7c05a --- /dev/null +++ b/templates/species/_delete_form.html.twig @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/species/_form.html.twig b/templates/species/_form.html.twig new file mode 100644 index 0000000..bf20b98 --- /dev/null +++ b/templates/species/_form.html.twig @@ -0,0 +1,4 @@ +{{ form_start(form) }} + {{ form_widget(form) }} + +{{ form_end(form) }} diff --git a/templates/species/detail.html.twig b/templates/species/detail.html.twig deleted file mode 100644 index d6a5ebf..0000000 --- a/templates/species/detail.html.twig +++ /dev/null @@ -1,43 +0,0 @@ -{% extends 'base.html.twig' %} - -{% block title %}Herbarium - Détail de l'espèces{% endblock %} - -{% block body %} - - -
-

{{ specie.vernacularName }}

-

- 🔬 Nom Scientifique : {{ specie.scientificName }}
- 📍 Region : {{ specie.region }} -

-
-

Posts :

- - {% for post in specie.posts %} -
-
-

- - 📅 {{ post.publicationDate | date }} - -

-
-
- 📍 géolocalisation :
- - Longitude : {{ post.longitude }}
- - Latitude : {{ post.latitude }}
- - Altitude : {{ post.altitude }}

- - 💬 Commentaire :
- - {{ post.getCommentary }} -
-
- {% endfor %} -
- -
-{% endblock %} \ No newline at end of file diff --git a/templates/species/edit.html.twig b/templates/species/edit.html.twig new file mode 100644 index 0000000..8e4401b --- /dev/null +++ b/templates/species/edit.html.twig @@ -0,0 +1,13 @@ +{% extends 'base.html.twig' %} + +{% block title %}Edit Species{% endblock %} + +{% block body %} +

Edit Species

+ + {{ include('species/_form.html.twig', {'button_label': 'Update'}) }} + + back to list + + {{ include('species/_delete_form.html.twig') }} +{% endblock %} diff --git a/templates/species/index.html.twig b/templates/species/index.html.twig index 666ad41..e855f6c 100644 --- a/templates/species/index.html.twig +++ b/templates/species/index.html.twig @@ -1,6 +1,6 @@ {% extends 'base.html.twig' %} -{% block title %}Herbarium - Espèces{% endblock %} +{% block title %}Species{% endblock %} {% block body %}
-

Liste des espèces

+

{{ 'list_of_species'|trans }}

{% for specie in species %} @@ -19,12 +19,12 @@
- 🔬 Nom Scientifique : {{ specie.scientificName }}
- 📍 Region : {{ specie.region }} + 🔬 {{ 'scientific_name'|trans }} : {{ specie.scientificName }}
+ 📍 {{ 'region'|trans }} : {{ specie.region }}

{% endfor %}
- Create new + {{ 'create_new'|trans }}
{% endblock %} diff --git a/templates/species/new.html.twig b/templates/species/new.html.twig index 8e58597..9b20266 100644 --- a/templates/species/new.html.twig +++ b/templates/species/new.html.twig @@ -3,9 +3,9 @@ {% block title %}New Species{% endblock %} {% block body %} -

Create new Species

+

{{ 'create_new_species'|trans }}

{{ include('species/_form.html.twig') }} - back to list + {{ 'back_to_list'|trans }} {% endblock %} diff --git a/templates/species/show.html.twig b/templates/species/show.html.twig index 152ea09..c3dd4e1 100644 --- a/templates/species/show.html.twig +++ b/templates/species/show.html.twig @@ -1,16 +1,16 @@ {% extends 'base.html.twig' %} -{% block title %}Species{% endblock %} +{% block title %}{{ 'species'|trans }}{% endblock %} {% block body %}

{{ species.vernacularName }}

- 🔬 Nom Scientifique : {{ species.scientificName }}
- 📍 Region : {{ species.region }} + 🔬 {{ 'scientific_name'|trans }} : {{ species.scientificName }}
+ 📍 {{ 'region'|trans }} : {{ species.region }}

-

Posts :

+

{{ 'posts'|trans }} :

{% for post in species.posts %}
@@ -18,18 +18,18 @@

{{ post.publicationDate | date }}

-
📍Géolocalisation
+
📍{{ 'geolocation'|trans }}
{{ post.longitude }} - {{ post.latitude }}
-
📍Commentaire
+
💬{{ 'commentary'|trans }}
{{ post.getCommentary }}
{% endfor %} - back to list + {{ 'back_to_list'|trans }} - edit + {{ 'edit'|trans }} {{ include('species/_delete_form.html.twig') }}
diff --git a/templates/species/table.html.twig b/templates/species/table.html.twig index 1303738..ba8c565 100644 --- a/templates/species/table.html.twig +++ b/templates/species/table.html.twig @@ -1,18 +1,18 @@ {% extends 'base.html.twig' %} -{% block title %}Species index{% endblock %} +{% block title %}{{ 'species_index'|trans }}{% endblock %} {% block body %} -

Species index

+

{{ 'species_index'|trans }}

- - - - + + + + @@ -23,17 +23,17 @@ {% else %} - + {% endfor %}
IdScientific_nameVernacular_nameRegionactions{{ 'scientific_name'|trans }}{{ 'vernacular_name'|trans }}{{ 'region'|trans }}Actions
{{ species.vernacularName }} {{ species.region }} - show - edit + {{ 'show'|trans }} + {{ 'edit'|trans }}
no records found{{ 'no_records_found'|trans }}
- Create new + {{ 'create_new'|trans }} {% endblock %} diff --git a/translations/.gitignore b/translations/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/translations/VerifyEmailBundle.en.xlf b/translations/VerifyEmailBundle.en.xlf new file mode 100644 index 0000000..0522bde --- /dev/null +++ b/translations/VerifyEmailBundle.en.xlf @@ -0,0 +1,42 @@ + + + +
+ +
+ + + %count% year|%count% years + %count% year|%count% years + + + %count% month|%count% months + %count% month|%count% months + + + %count% day|%count% days + %count% day|%count% days + + + %count% hour|%count% hours + %count% hour|%count% hours + + + %count% minute|%count% minutes + %count% minute|%count% minutes + + + The link to verify your email has expired. Please request a new link. + The link to verify your email has expired. Please request a new link. + + + The link to verify your email is invalid. Please request a new link. + The link to verify your email is invalid. Please request a new link. + + + The link to verify your email appears to be for a different account or email. Please request a new link. + The link to verify your email appears to be for a different account or email. Please request a new link. + + +
+
diff --git a/translations/VerifyEmailBundle.fr.xlf b/translations/VerifyEmailBundle.fr.xlf new file mode 100644 index 0000000..bfbb78c --- /dev/null +++ b/translations/VerifyEmailBundle.fr.xlf @@ -0,0 +1,42 @@ + + + +
+ +
+ + + %count% year|%count% years + %count% année|%count% années + + + %count% month|%count% months + %count% mois|%count% mois + + + %count% day|%count% days + %count% jour|%count% jours + + + %count% hour|%count% hours + %count% heure|%count% heures + + + %count% minute|%count% minutes + %count% minute|%count% minutes + + + The link to verify your email has expired. Please request a new link. + Le lien pour vérifier votre adresse e-mail a expiré. Veuillez refaire une demande de réinitialisation. + + + The link to verify your email is invalid. Please request a new link. + Le lien pour vérifier votre adresse e-mail est invalide. Veuillez refaire une demande de réinitialisation. + + + The link to verify your email appears to be for a different account or email. Please request a new link. + Le lien permettant de vérifier votre adresse e-mail semble correspondre à un autre compte ou e-mail. Veuillez refaire une demande de réinitialisation. + + +
+
diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf new file mode 100644 index 0000000..587e1f6 --- /dev/null +++ b/translations/messages.en.xlf @@ -0,0 +1,166 @@ + + + +
+ +
+ + + delete + Delete + + + delete_confirm + Are you sure you want to delete ? + + + log_out + Log out + + + sign_in + Sign in + + + welcome_to_herbarium + Welcome to Herbarium + + + new_post + New post + + + create_new_post + Create new post + + + back_to_list + Back to list + + + post + Post + + + found_date + Found date + + + publication_date + Publication date + + + commentary + Commentary + + + edit + Edit + + + post_index + Post index + + + show + Show + + + no_records_found + No records found + + + create_new + Create new + + + register + Register + + + log_in + Log in + + + logout + Log out + + + password + Password + + + sign_up + Sign up + + + species + Species + + + list_of_species + List of species + + + scientific_name + Scientific name + + + region + Region + + + create_new_species + Create new species + + + posts + Posts + + + geolocation + Geolocation + + + species_index + Species index + + + vernacular_name + Vernacular name + + + delete_item_confirmation + Are you sure you want to delete this item ? + + + previous + Previous + + + next + Next + + + post_undefined + Post undefined + + + edit_species + Edit species + + + edit_post + Edit post + + + update + Update + + + save + Save + + +
+
diff --git a/translations/messages.fr.xlf b/translations/messages.fr.xlf new file mode 100644 index 0000000..f518d69 --- /dev/null +++ b/translations/messages.fr.xlf @@ -0,0 +1,166 @@ + + + +
+ +
+ + + delete + Supprimer + + + delete_confirm + Êtes-vous sûr de vouloir supprimer ? + + + log_out + Se déconnecter + + + sign_in + Se connecter + + + welcome_to_herbarium + Bienvenue sur Herbarium + + + new_post + Nouvelle publication + + + create_new_post + Création d'une nouvelle publication + + + back_to_list + Retour à la liste + + + post + Publication + + + found_date + Date de découverte + + + publication_date + Date de publication + + + commentary + Commentaire + + + edit + Éditer + + + post_index + Index des publications + + + show + Montrer + + + no_records_found + Pas d'enregistrements trouvés + + + create_new + Création d'un nouvel enregistrement + + + register + Créer un compte + + + log_in + Se connecter + + + logout + Se déconnecter + + + password + Mot de passe + + + sign_up + S'inscrire + + + species + Espèces + + + list_of_species + Liste des espèces + + + scientific_name + Nom scientifique + + + region + Région + + + create_new_species + Créer une nouvelle espèce + + + posts + Publications + + + geolocation + Géolocalisation + + + species_index + Index des espèces + + + vernacular_name + Nom vernaculaire + + + delete_item_confirmation + Êtes-vous sûr de vouloir supprimer ? + + + previous + Retour + + + next + Suivant + + + post_undefined + Publication non définie + + + edit_species + Éditer l'espèce + + + edit_post + Éditer la publication + + + update + Mettre à jour + + + save + Sauvegarder + + +
+
diff --git a/translations/security.en.xlf b/translations/security.en.xlf new file mode 100644 index 0000000..cde7936 --- /dev/null +++ b/translations/security.en.xlf @@ -0,0 +1,82 @@ + + + +
+ +
+ + + An authentication exception occurred. + An authentication exception occurred. + + + Authentication credentials could not be found. + Authentication credentials could not be found. + + + Authentication request could not be processed due to a system problem. + Authentication request could not be processed due to a system problem. + + + Invalid credentials. + Invalid credentials. + + + Cookie has already been used by someone else. + Cookie has already been used by someone else. + + + Not privileged to request the resource. + Not privileged to request the resource. + + + Invalid CSRF token. + Invalid CSRF token. + + + No authentication provider found to support the authentication token. + No authentication provider found to support the authentication token. + + + No session available, it either timed out or cookies are not enabled. + No session available, it either timed out or cookies are not enabled. + + + No token could be found. + No token could be found. + + + Username could not be found. + Username could not be found. + + + Account has expired. + Account has expired. + + + Credentials have expired. + Credentials have expired. + + + Account is disabled. + Account is disabled. + + + Account is locked. + Account is locked. + + + Too many failed login attempts, please try again later. + Too many failed login attempts, please try again later. + + + Invalid or expired login link. + Invalid or expired login link. + + + Too many failed login attempts, please try again in %minutes% minute. + Too many failed login attempts, please try again in %minutes% minute. + + +
+
diff --git a/translations/security.fr.xlf b/translations/security.fr.xlf new file mode 100644 index 0000000..4735733 --- /dev/null +++ b/translations/security.fr.xlf @@ -0,0 +1,82 @@ + + + +
+ +
+ + + An authentication exception occurred. + Une exception d'authentification s'est produite. + + + Authentication credentials could not be found. + Les identifiants d'authentification n'ont pas pu être trouvés. + + + Authentication request could not be processed due to a system problem. + La requête d'authentification n'a pas pu être executée à cause d'un problème système. + + + Invalid credentials. + Identifiants invalides. + + + Cookie has already been used by someone else. + Le cookie a déjà été utilisé par quelqu'un d'autre. + + + Not privileged to request the resource. + Privilèges insuffisants pour accéder à la ressource. + + + Invalid CSRF token. + Jeton CSRF invalide. + + + No authentication provider found to support the authentication token. + Aucun fournisseur d'authentification n'a été trouvé pour supporter le jeton d'authentification. + + + No session available, it either timed out or cookies are not enabled. + Aucune session disponible, celle-ci a expiré ou les cookies ne sont pas activés. + + + No token could be found. + Aucun jeton n'a pu être trouvé. + + + Username could not be found. + Le nom d'utilisateur n'a pas pu être trouvé. + + + Account has expired. + Le compte a expiré. + + + Credentials have expired. + Les identifiants ont expiré. + + + Account is disabled. + Le compte est désactivé. + + + Account is locked. + Le compte est bloqué. + + + Too many failed login attempts, please try again later. + Plusieurs tentatives de connexion ont échoué, veuillez réessayer plus tard. + + + Invalid or expired login link. + Lien de connexion invalide ou expiré. + + + Too many failed login attempts, please try again in %minutes% minute. + Plusieurs tentatives de connexion ont échoué, veuillez réessayer dans %minutes% minute. + + +
+
diff --git a/translations/validators.en.xlf b/translations/validators.en.xlf new file mode 100644 index 0000000..71cbc03 --- /dev/null +++ b/translations/validators.en.xlf @@ -0,0 +1,598 @@ + + + +
+ +
+ + + This value should be false. + This value should be false. + + + This value should be true. + This value should be true. + + + This value should be of type {{ type }}. + This value should be of type {{ type }}. + + + This value should be blank. + This value should be blank. + + + The value you selected is not a valid choice. + The value you selected is not a valid choice. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + + + One or more of the given values is invalid. + One or more of the given values is invalid. + + + This field was not expected. + This field was not expected. + + + This field is missing. + This field is missing. + + + This value is not a valid date. + This value is not a valid date. + + + This value is not a valid datetime. + This value is not a valid datetime. + + + This value is not a valid email address. + This value is not a valid email address. + + + The file could not be found. + The file could not be found. + + + The file is not readable. + The file is not readable. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + + + This value should be {{ limit }} or less. + This value should be {{ limit }} or less. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + + + This value should be {{ limit }} or more. + This value should be {{ limit }} or more. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + + + This value should not be blank. + This value should not be blank. + + + This value should not be null. + This value should not be null. + + + This value should be null. + This value should be null. + + + This value is not valid. + This value is not valid. + + + This value is not a valid time. + This value is not a valid time. + + + This value is not a valid URL. + This value is not a valid URL. + + + The two values should be equal. + The two values should be equal. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + + + The file is too large. + The file is too large. + + + The file could not be uploaded. + The file could not be uploaded. + + + This value should be a valid number. + This value should be a valid number. + + + This file is not a valid image. + This file is not a valid image. + + + This is not a valid IP address. + This value is not a valid IP address. + + + This value is not a valid language. + This value is not a valid language. + + + This value is not a valid locale. + This value is not a valid locale. + + + This value is not a valid country. + This value is not a valid country. + + + This value is already used. + This value is already used. + + + The size of the image could not be detected. + The size of the image could not be detected. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + + + This value should be the user's current password. + This value should be the user's current password. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + + + The file was only partially uploaded. + The file was only partially uploaded. + + + No file was uploaded. + No file was uploaded. + + + No temporary folder was configured in php.ini. + No temporary folder was configured in php.ini, or the configured folder does not exist. + + + Cannot write temporary file to disk. + Cannot write temporary file to disk. + + + A PHP extension caused the upload to fail. + A PHP extension caused the upload to fail. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + + + Invalid card number. + Invalid card number. + + + Unsupported card type or invalid card number. + Unsupported card type or invalid card number. + + + This is not a valid International Bank Account Number (IBAN). + This value is not a valid International Bank Account Number (IBAN). + + + This value is not a valid ISBN-10. + This value is not a valid ISBN-10. + + + This value is not a valid ISBN-13. + This value is not a valid ISBN-13. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + This value is neither a valid ISBN-10 nor a valid ISBN-13. + + + This value is not a valid ISSN. + This value is not a valid ISSN. + + + This value is not a valid currency. + This value is not a valid currency. + + + This value should be equal to {{ compared_value }}. + This value should be equal to {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + This value should be greater than {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + This value should be greater than or equal to {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + This value should be less than {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + This value should be less than or equal to {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + This value should not be equal to {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + + + An empty file is not allowed. + An empty file is not allowed. + + + The host could not be resolved. + The host could not be resolved. + + + This value does not match the expected {{ charset }} charset. + This value does not match the expected {{ charset }} charset. + + + This is not a valid Business Identifier Code (BIC). + This value is not a valid Business Identifier Code (BIC). + + + Error + Error + + + This is not a valid UUID. + This value is not a valid UUID. + + + This value should be a multiple of {{ compared_value }}. + This value should be a multiple of {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + + + This value should be valid JSON. + This value should be valid JSON. + + + This collection should contain only unique elements. + This collection should contain only unique elements. + + + This value should be positive. + This value should be positive. + + + This value should be either positive or zero. + This value should be either positive or zero. + + + This value should be negative. + This value should be negative. + + + This value should be either negative or zero. + This value should be either negative or zero. + + + This value is not a valid timezone. + This value is not a valid timezone. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + This password has been leaked in a data breach, it must not be used. Please use another password. + + + This value should be between {{ min }} and {{ max }}. + This value should be between {{ min }} and {{ max }}. + + + This value is not a valid hostname. + This value is not a valid hostname. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + The number of elements in this collection should be a multiple of {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + This value should satisfy at least one of the following constraints: + + + Each element of this collection should satisfy its own set of constraints. + Each element of this collection should satisfy its own set of constraints. + + + This value is not a valid International Securities Identification Number (ISIN). + This value is not a valid International Securities Identification Number (ISIN). + + + This value should be a valid expression. + This value should be a valid expression. + + + This value is not a valid CSS color. + This value is not a valid CSS color. + + + This value is not a valid CIDR notation. + This value is not a valid CIDR notation. + + + The value of the netmask should be between {{ min }} and {{ max }}. + The value of the netmask should be between {{ min }} and {{ max }}. + + + The filename is too long. It should have {{ filename_max_length }} character or less.|The filename is too long. It should have {{ filename_max_length }} characters or less. + The filename is too long. It should have {{ filename_max_length }} character or less.|The filename is too long. It should have {{ filename_max_length }} characters or less. + + + The password strength is too low. Please use a stronger password. + The password strength is too low. Please use a stronger password. + + + This value contains characters that are not allowed by the current restriction-level. + This value contains characters that are not allowed by the current restriction-level. + + + Using invisible characters is not allowed. + Using invisible characters is not allowed. + + + Mixing numbers from different scripts is not allowed. + Mixing numbers from different scripts is not allowed. + + + Using hidden overlay characters is not allowed. + Using hidden overlay characters is not allowed. + + + The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. + The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. + + + The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. + The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. + + + This value is not a valid MAC address. + This value is not a valid MAC address. + + + This URL is missing a top-level domain. + This URL is missing a top-level domain. + + + This form should not contain extra fields. + This form should not contain extra fields. + + + The uploaded file was too large. Please try to upload a smaller file. + The uploaded file was too large. Please try to upload a smaller file. + + + The CSRF token is invalid. Please try to resubmit the form. + The CSRF token is invalid. Please try to resubmit the form. + + + This value is not a valid HTML5 color. + This value is not a valid HTML5 color. + + + Please enter a valid birthdate. + Please enter a valid birthdate. + + + The selected choice is invalid. + The selected choice is invalid. + + + The collection is invalid. + The collection is invalid. + + + Please select a valid color. + Please select a valid color. + + + Please select a valid country. + Please select a valid country. + + + Please select a valid currency. + Please select a valid currency. + + + Please choose a valid date interval. + Please choose a valid date interval. + + + Please enter a valid date and time. + Please enter a valid date and time. + + + Please enter a valid date. + Please enter a valid date. + + + Please select a valid file. + Please select a valid file. + + + The hidden field is invalid. + The hidden field is invalid. + + + Please enter an integer. + Please enter an integer. + + + Please select a valid language. + Please select a valid language. + + + Please select a valid locale. + Please select a valid locale. + + + Please enter a valid money amount. + Please enter a valid money amount. + + + Please enter a number. + Please enter a number. + + + The password is invalid. + The password is invalid. + + + Please enter a percentage value. + Please enter a percentage value. + + + The values do not match. + The values do not match. + + + Please enter a valid time. + Please enter a valid time. + + + Please select a valid timezone. + Please select a valid timezone. + + + Please enter a valid URL. + Please enter a valid URL. + + + Please enter a valid search term. + Please enter a valid search term. + + + Please provide a valid phone number. + Please provide a valid phone number. + + + The checkbox has an invalid value. + The checkbox has an invalid value. + + + Please enter a valid email address. + Please enter a valid email address. + + + Please select a valid option. + Please select a valid option. + + + Please select a valid range. + Please select a valid range. + + + Please enter a valid week. + Please enter a valid week. + + + There is already an account with this email + There is already an account with this email + + + You should agree to our terms. + You should agree to our terms. + + + Please enter a password + Please enter a password + + + Your password should be at least {{ limit }} characters + Your password should be at least {{ limit }} characters + + +
+
diff --git a/translations/validators.fr.xlf b/translations/validators.fr.xlf new file mode 100644 index 0000000..666570a --- /dev/null +++ b/translations/validators.fr.xlf @@ -0,0 +1,598 @@ + + + +
+ +
+ + + This value should be false. + Cette valeur doit être fausse. + + + This value should be true. + Cette valeur doit être vraie. + + + This value should be of type {{ type }}. + Cette valeur doit être de type {{ type }}. + + + This value should be blank. + Cette valeur doit être vide. + + + The value you selected is not a valid choice. + Cette valeur doit être l'un des choix proposés. + + + You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices. + Vous devez sélectionner au moins {{ limit }} choix.|Vous devez sélectionner au moins {{ limit }} choix. + + + You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices. + Vous devez sélectionner au maximum {{ limit }} choix.|Vous devez sélectionner au maximum {{ limit }} choix. + + + One or more of the given values is invalid. + Une ou plusieurs des valeurs soumises sont invalides. + + + This field was not expected. + Ce champ n'a pas été prévu. + + + This field is missing. + Ce champ est manquant. + + + This value is not a valid date. + Cette valeur n'est pas une date valide. + + + This value is not a valid datetime. + Cette valeur n'est pas une date valide. + + + This value is not a valid email address. + Cette valeur n'est pas une adresse email valide. + + + The file could not be found. + Le fichier n'a pas été trouvé. + + + The file is not readable. + Le fichier n'est pas lisible. + + + The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}. + Le fichier est trop volumineux ({{ size }} {{ suffix }}). Sa taille ne doit pas dépasser {{ limit }} {{ suffix }}. + + + The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}. + Le type du fichier est invalide ({{ type }}). Les types autorisés sont {{ types }}. + + + This value should be {{ limit }} or less. + Cette valeur doit être inférieure ou égale à {{ limit }}. + + + This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less. + Cette chaîne est trop longue. Elle doit avoir au maximum {{ limit }} caractère.|Cette chaîne est trop longue. Elle doit avoir au maximum {{ limit }} caractères. + + + This value should be {{ limit }} or more. + Cette valeur doit être supérieure ou égale à {{ limit }}. + + + This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more. + Cette chaîne est trop courte. Elle doit avoir au minimum {{ limit }} caractère.|Cette chaîne est trop courte. Elle doit avoir au minimum {{ limit }} caractères. + + + This value should not be blank. + Cette valeur ne doit pas être vide. + + + This value should not be null. + Cette valeur ne doit pas être nulle. + + + This value should be null. + Cette valeur doit être nulle. + + + This value is not valid. + Cette valeur n'est pas valide. + + + This value is not a valid time. + Cette valeur n'est pas une heure valide. + + + This value is not a valid URL. + Cette valeur n'est pas une URL valide. + + + The two values should be equal. + Les deux valeurs doivent être identiques. + + + The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}. + Le fichier est trop volumineux. Sa taille ne doit pas dépasser {{ limit }} {{ suffix }}. + + + The file is too large. + Le fichier est trop volumineux. + + + The file could not be uploaded. + Le téléchargement de ce fichier est impossible. + + + This value should be a valid number. + Cette valeur doit être un nombre. + + + This file is not a valid image. + Ce fichier n'est pas une image valide. + + + This is not a valid IP address. + Cette valeur n'est pas une adresse IP valide. + + + This value is not a valid language. + Cette langue n'est pas valide. + + + This value is not a valid locale. + Ce paramètre régional n'est pas valide. + + + This value is not a valid country. + Ce pays n'est pas valide. + + + This value is already used. + Cette valeur est déjà utilisée. + + + The size of the image could not be detected. + La taille de l'image n'a pas pu être détectée. + + + The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px. + La largeur de l'image est trop grande ({{ width }}px). La largeur maximale autorisée est de {{ max_width }}px. + + + The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px. + La largeur de l'image est trop petite ({{ width }}px). La largeur minimale attendue est de {{ min_width }}px. + + + The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px. + La hauteur de l'image est trop grande ({{ height }}px). La hauteur maximale autorisée est de {{ max_height }}px. + + + The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px. + La hauteur de l'image est trop petite ({{ height }}px). La hauteur minimale attendue est de {{ min_height }}px. + + + This value should be the user's current password. + Cette valeur doit être le mot de passe actuel de l'utilisateur. + + + This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters. + Cette chaîne doit avoir exactement {{ limit }} caractère.|Cette chaîne doit avoir exactement {{ limit }} caractères. + + + The file was only partially uploaded. + Le fichier a été partiellement transféré. + + + No file was uploaded. + Aucun fichier n'a été transféré. + + + No temporary folder was configured in php.ini. + Aucun répertoire temporaire n'a été configuré dans le php.ini, ou le répertoire configuré n'existe pas. + + + Cannot write temporary file to disk. + Impossible d'écrire le fichier temporaire sur le disque. + + + A PHP extension caused the upload to fail. + Une extension PHP a empêché le transfert du fichier. + + + This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more. + Cette collection doit contenir {{ limit }} élément ou plus.|Cette collection doit contenir {{ limit }} éléments ou plus. + + + This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less. + Cette collection doit contenir {{ limit }} élément ou moins.|Cette collection doit contenir {{ limit }} éléments ou moins. + + + This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements. + Cette collection doit contenir exactement {{ limit }} élément.|Cette collection doit contenir exactement {{ limit }} éléments. + + + Invalid card number. + Numéro de carte invalide. + + + Unsupported card type or invalid card number. + Type de carte non supporté ou numéro invalide. + + + This is not a valid International Bank Account Number (IBAN). + Cette valeur n'est pas un Numéro de Compte Bancaire International (IBAN) valide. + + + This value is not a valid ISBN-10. + Cette valeur n'est pas un code ISBN-10 valide. + + + This value is not a valid ISBN-13. + Cette valeur n'est pas un code ISBN-13 valide. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Cette valeur n'est ni un code ISBN-10, ni un code ISBN-13 valide. + + + This value is not a valid ISSN. + Cette valeur n'est pas un code ISSN valide. + + + This value is not a valid currency. + Cette valeur n'est pas une devise valide. + + + This value should be equal to {{ compared_value }}. + Cette valeur doit être égale à {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Cette valeur doit être supérieure à {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Cette valeur doit être supérieure ou égale à {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Cette valeur doit être identique à {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Cette valeur doit être inférieure à {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Cette valeur doit être inférieure ou égale à {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Cette valeur ne doit pas être égale à {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Cette valeur ne doit pas être identique à {{ compared_value_type }} {{ compared_value }}. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Le rapport largeur/hauteur de l'image est trop grand ({{ ratio }}). Le rapport maximal autorisé est {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Le rapport largeur/hauteur de l'image est trop petit ({{ ratio }}). Le rapport minimal attendu est {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + L'image est carrée ({{ width }}x{{ height }}px). Les images carrées ne sont pas autorisées. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + L'image est au format paysage ({{ width }}x{{ height }}px). Les images au format paysage ne sont pas autorisées. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + L'image est au format portrait ({{ width }}x{{ height }}px). Les images au format portrait ne sont pas autorisées. + + + An empty file is not allowed. + Un fichier vide n'est pas autorisé. + + + The host could not be resolved. + Le nom de domaine n'a pas pu être résolu. + + + This value does not match the expected {{ charset }} charset. + Cette valeur ne correspond pas au jeu de caractères {{ charset }} attendu. + + + This is not a valid Business Identifier Code (BIC). + Cette valeur n'est pas un Code Identifiant de Business (BIC) valide. + + + Error + Erreur + + + This is not a valid UUID. + Cette valeur n'est pas un UUID valide. + + + This value should be a multiple of {{ compared_value }}. + Cette valeur doit être un multiple de {{ compared_value }}. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Ce code d'identification d'entreprise (BIC) n'est pas associé à l'IBAN {{ iban }}. + + + This value should be valid JSON. + Cette valeur doit être un JSON valide. + + + This collection should contain only unique elements. + Cette collection ne doit pas comporter de doublons. + + + This value should be positive. + Cette valeur doit être strictement positive. + + + This value should be either positive or zero. + Cette valeur doit être supérieure ou égale à zéro. + + + This value should be negative. + Cette valeur doit être strictement négative. + + + This value should be either negative or zero. + Cette valeur doit être inférieure ou égale à zéro. + + + This value is not a valid timezone. + Cette valeur n'est pas un fuseau horaire valide. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Ce mot de passe a été divulgué lors d'une fuite de données, il ne doit plus être utilisé. Veuillez utiliser un autre mot de passe. + + + This value should be between {{ min }} and {{ max }}. + Cette valeur doit être comprise entre {{ min }} et {{ max }}. + + + This value is not a valid hostname. + Cette valeur n'est pas un nom d'hôte valide. + + + The number of elements in this collection should be a multiple of {{ compared_value }}. + Le nombre d'éléments de cette collection doit être un multiple de {{ compared_value }}. + + + This value should satisfy at least one of the following constraints: + Cette valeur doit satisfaire à au moins une des contraintes suivantes : + + + Each element of this collection should satisfy its own set of constraints. + Chaque élément de cette collection doit satisfaire à son propre jeu de contraintes. + + + This value is not a valid International Securities Identification Number (ISIN). + Cette valeur n'est pas un code international de sécurité valide (ISIN). + + + This value should be a valid expression. + Cette valeur doit être une expression valide. + + + This value is not a valid CSS color. + Cette valeur n'est pas une couleur CSS valide. + + + This value is not a valid CIDR notation. + Cette valeur n'est pas une notation CIDR valide. + + + The value of the netmask should be between {{ min }} and {{ max }}. + La valeur du masque de réseau doit être comprise entre {{ min }} et {{ max }}. + + + The filename is too long. It should have {{ filename_max_length }} character or less.|The filename is too long. It should have {{ filename_max_length }} characters or less. + Le nom du fichier est trop long. Il doit contenir au maximum {{ filename_max_length }} caractère.|Le nom de fichier est trop long. Il doit contenir au maximum {{ filename_max_length }} caractères. + + + The password strength is too low. Please use a stronger password. + La robustesse du mot de passe est trop faible. Veuillez utiliser un mot de passe plus fort. + + + This value contains characters that are not allowed by the current restriction-level. + Cette valeur contient des caractères qui ne sont pas autorisés par le niveau de restriction actuel. + + + Using invisible characters is not allowed. + Utiliser des caractères invisibles n'est pas autorisé. + + + Mixing numbers from different scripts is not allowed. + Mélanger des chiffres provenant de différents scripts n'est pas autorisé. + + + Using hidden overlay characters is not allowed. + Utiliser des caractères de superposition cachés n'est pas autorisé. + + + The extension of the file is invalid ({{ extension }}). Allowed extensions are {{ extensions }}. + L'extension du fichier est invalide ({{ extension }}). Les extensions autorisées sont {{ extensions }}. + + + The detected character encoding is invalid ({{ detected }}). Allowed encodings are {{ encodings }}. + L'encodage de caractères détecté est invalide ({{ detected }}). Les encodages autorisés sont {{ encodings }}. + + + This value is not a valid MAC address. + Cette valeur n'est pas une adresse MAC valide. + + + This URL is missing a top-level domain. + Cette URL doit contenir un domaine de premier niveau. + + + This form should not contain extra fields. + Ce formulaire ne doit pas contenir de champs supplémentaires. + + + The uploaded file was too large. Please try to upload a smaller file. + Le fichier téléchargé est trop volumineux. Merci d'essayer d'envoyer un fichier plus petit. + + + The CSRF token is invalid. Please try to resubmit the form. + Le jeton CSRF est invalide. Veuillez renvoyer le formulaire. + + + This value is not a valid HTML5 color. + Cette valeur n'est pas une couleur HTML5 valide. + + + Please enter a valid birthdate. + Veuillez entrer une date de naissance valide. + + + The selected choice is invalid. + Le choix sélectionné est invalide. + + + The collection is invalid. + La collection est invalide. + + + Please select a valid color. + Veuillez sélectionner une couleur valide. + + + Please select a valid country. + Veuillez sélectionner un pays valide. + + + Please select a valid currency. + Veuillez sélectionner une devise valide. + + + Please choose a valid date interval. + Veuillez choisir un intervalle de dates valide. + + + Please enter a valid date and time. + Veuillez saisir une date et une heure valides. + + + Please enter a valid date. + Veuillez entrer une date valide. + + + Please select a valid file. + Veuillez sélectionner un fichier valide. + + + The hidden field is invalid. + Le champ masqué n'est pas valide. + + + Please enter an integer. + Veuillez saisir un entier. + + + Please select a valid language. + Veuillez sélectionner une langue valide. + + + Please select a valid locale. + Veuillez sélectionner une langue valide. + + + Please enter a valid money amount. + Veuillez saisir un montant valide. + + + Please enter a number. + Veuillez saisir un nombre. + + + The password is invalid. + Le mot de passe est invalide. + + + Please enter a percentage value. + Veuillez saisir un pourcentage valide. + + + The values do not match. + Les valeurs ne correspondent pas. + + + Please enter a valid time. + Veuillez saisir une heure valide. + + + Please select a valid timezone. + Veuillez sélectionner un fuseau horaire valide. + + + Please enter a valid URL. + Veuillez saisir une URL valide. + + + Please enter a valid search term. + Veuillez saisir un terme de recherche valide. + + + Please provide a valid phone number. + Veuillez fournir un numéro de téléphone valide. + + + The checkbox has an invalid value. + La case à cocher a une valeur non valide. + + + Please enter a valid email address. + Veuillez saisir une adresse email valide. + + + Please select a valid option. + Veuillez sélectionner une option valide. + + + Please select a valid range. + Veuillez sélectionner une plage valide. + + + Please enter a valid week. + Veuillez entrer une semaine valide. + + + There is already an account with this email + Il existe déjà un compte avec cet email + + + You should agree to our terms. + Vous devez accepter nos conditions + + + Please enter a password + Veuillez entrer un mot de passe + + + Your password should be at least {{ limit }} characters + Votre mot de passe doit comporter au moins {{ limite }} caractères + + +
+
-- 2.43.0 From bc6951d0a59575931563e99b7fbb0a5b7e582431 Mon Sep 17 00:00:00 2001 From: clfreville2 Date: Thu, 13 Jun 2024 09:12:03 +0200 Subject: [PATCH 13/20] Remove hardcoded values --- templates/post/index.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/post/index.html.twig b/templates/post/index.html.twig index 5ea65a2..d14adbc 100644 --- a/templates/post/index.html.twig +++ b/templates/post/index.html.twig @@ -4,16 +4,16 @@ {% block body %} {% for post in posts.iterator %} -
+
-
{{ post.species ? post.species.vernacularName : 'post_undefined'|trans }}
+
{{ post.species ? post.species.vernacularName : 'post_undefined'|trans }}
{{ post.foundDate | date("d/m/Y \\à H \\h") }}

{{ post.latitude }}, {{ post.longitude }}, {{ post.altitude }}m

{{ post.commentary }}

{% endfor %} -- 2.43.0 From 0beb0cd95f6a6d41da53c79303dd160f9ac1d3b4 Mon Sep 17 00:00:00 2001 From: Bastien OLLIER Date: Thu, 13 Jun 2024 09:30:25 +0200 Subject: [PATCH 14/20] Update interface (#17) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: bastien ollier Reviewed-on: https://codefirst.iut.uca.fr/git/clement.freville2/herbarium/pulls/17 Reviewed-by: Clément FRÉVILLE Co-authored-by: Bastien OLLIER Co-committed-by: Bastien OLLIER --- src/Controller/PostController.php | 17 +++++++--------- src/Controller/SpeciesController.php | 2 +- templates/base.html.twig | 23 +++++++++++++++++++++- templates/post/edit.html.twig | 2 +- templates/post/new.html.twig | 2 +- templates/post/show.html.twig | 4 ++-- templates/post/table.html.twig | 2 +- templates/species/_form.html.twig | 2 +- templates/species/edit.html.twig | 2 +- templates/species/new.html.twig | 2 +- templates/species/show.html.twig | 4 ++-- tests/Controller/PostControllerTest.php | 6 +++--- tests/Controller/SpeciesControllerTest.php | 2 +- translations/messages.fr.xlf | 2 +- 14 files changed, 45 insertions(+), 27 deletions(-) diff --git a/src/Controller/PostController.php b/src/Controller/PostController.php index af3d395..7f4e77f 100644 --- a/src/Controller/PostController.php +++ b/src/Controller/PostController.php @@ -34,16 +34,13 @@ class PostController extends AbstractController ]); } - #[Route('/post', name: 'app_post_index', methods: ['GET'])] + #[Route('/posts', name: 'app_post_index', methods: ['GET'])] public function table(PostRepository $repository): Response { - $posts = $repository->findAll(); - return $this->render('post/table.html.twig', [ - 'posts' => $posts, - ]); + return $this->redirectToRoute('app_posts', [], Response::HTTP_SEE_OTHER); } - #[Route('/post/new', name: 'app_post_new', methods: ['GET', 'POST'])] + #[Route('/posts/new', name: 'app_post_new', methods: ['GET', 'POST'])] #[IsGranted('ROLE_USER')] public function new(Request $request, EntityManagerInterface $entityManager): Response { @@ -64,7 +61,7 @@ class PostController extends AbstractController ]); } - #[Route('/post/{id}', name: 'app_post_show', methods: ['GET'])] + #[Route('/posts/{id}', name: 'app_post_show', methods: ['GET'])] public function show(Post $post): Response { $form = $this->createForm(CommentType::class, new Comment(), [ @@ -76,7 +73,7 @@ class PostController extends AbstractController ]); } - #[Route('/post/{id}/edit', name: 'app_post_edit', methods: ['GET', 'POST'])] + #[Route('/posts/{id}/edit', name: 'app_post_edit', methods: ['GET', 'POST'])] #[IsGranted('ROLE_USER')] public function edit(Request $request, Post $post, EntityManagerInterface $entityManager): Response { @@ -95,7 +92,7 @@ class PostController extends AbstractController ]); } - #[Route('/post/{id}', name: 'app_post_delete', methods: ['POST'])] + #[Route('/posts/{id}', name: 'app_post_delete', methods: ['POST'])] #[IsGranted('ROLE_USER')] public function delete(Request $request, Post $post, EntityManagerInterface $entityManager): Response { @@ -107,7 +104,7 @@ class PostController extends AbstractController return $this->redirectToRoute('app_posts', [], Response::HTTP_SEE_OTHER); } - #[Route('/post/{id}/comment', name: 'app_post_comment', methods: ['POST'])] + #[Route('/posts/{id}/comment', name: 'app_post_comment', methods: ['POST'])] public function publishComment(Request $request, Post $post, EntityManagerInterface $entityManager, #[CurrentUser] User $user): Response { $comment = new Comment(); diff --git a/src/Controller/SpeciesController.php b/src/Controller/SpeciesController.php index a495a0f..4af751c 100644 --- a/src/Controller/SpeciesController.php +++ b/src/Controller/SpeciesController.php @@ -18,7 +18,7 @@ class SpeciesController extends AbstractController #[Route('/', name: 'app_species_index', methods: ['GET'])] public function table(SpeciesRepository $speciesRepository): Response { - return $this->render('species/table.html.twig', [ + return $this->render('species/index.html.twig', [ 'species' => $speciesRepository->findAll(), ]); } diff --git a/templates/base.html.twig b/templates/base.html.twig index 4f29e24..0ced7a9 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -15,7 +15,28 @@
{% endfor %} {% include '_pagination.html.twig' %} {% endblock %} + +{% block javascripts %} + {{ parent() }} + +{% endblock %} -- 2.43.0 From ba82630d8a42760c437c3d26024bcdc8479a0ea3 Mon Sep 17 00:00:00 2001 From: clfreville2 Date: Fri, 14 Jun 2024 09:42:09 +0200 Subject: [PATCH 17/20] Disable service implementation --- config/services.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/services.yaml b/config/services.yaml index f07d469..8919b4f 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -30,7 +30,3 @@ services: # add more service definitions when explicit configuration is needed # please note that last definitions always *replace* previous ones - -when@prod: - services: - App\Service\ImageSafetyServiceInterface: '@App\Service\SightEngineImageSafetyService' -- 2.43.0 From 4f19bac7078530d5535c0b1b66d714c3eba78be0 Mon Sep 17 00:00:00 2001 From: clfreville2 Date: Fri, 14 Jun 2024 12:18:58 +0200 Subject: [PATCH 18/20] Fix upload base URL behind a subdirectory --- templates/post/show.html.twig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/post/show.html.twig b/templates/post/show.html.twig index e990e12..c79e591 100644 --- a/templates/post/show.html.twig +++ b/templates/post/show.html.twig @@ -34,7 +34,8 @@ {% if post.image %} Image - + {# Vich doesn't prefix the path, as asset() would. #} + {% endif %} -- 2.43.0 From 71ddec420c7226323fc0879a4d0ffe5212eb4eff Mon Sep 17 00:00:00 2001 From: clfreville2 Date: Fri, 14 Jun 2024 12:51:03 +0200 Subject: [PATCH 19/20] Tweak style --- public/css/app.css | 12 ++++++++++++ templates/_pagination.html.twig | 2 +- templates/base.html.twig | 6 +++--- templates/post/index.html.twig | 12 +++++++++++- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/public/css/app.css b/public/css/app.css index 5da752c..c62a3cc 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -10,3 +10,15 @@ .no-style:focus { outline: none; } + +.grid-4 { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1rem; +} + +@media (max-width: 992px) { + .grid-4 { + grid-template-columns: 1fr; + } +} diff --git a/templates/_pagination.html.twig b/templates/_pagination.html.twig index 9c9fdae..c3f6baa 100644 --- a/templates/_pagination.html.twig +++ b/templates/_pagination.html.twig @@ -1,6 +1,6 @@ {% set route = app.request.attributes.get('_route') %}