From 467eb71975156f656347970a24c40d0f054bfdcb Mon Sep 17 00:00:00 2001
From: davy-beauzil <38990335+davy-beauzil@users.noreply.github.com>
Date: Mon, 18 Mar 2024 10:17:02 +0100
Subject: [PATCH] =?UTF-8?q?fix:=20change=20"A=20r=C3=A9cup=C3=A9rer"=20by?=
=?UTF-8?q?=20"Lieu=20de=20la=20prestation"=20for=20services=20(#698)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: change "A récupérer" by "Lieu de la prestation" for services
* fix: add product variable for template
---
src/Controller/User/Product/ObjectController.php | 2 +-
src/Controller/User/Product/ServiceController.php | 2 +-
templates/components/product/_address_form.html.twig | 2 +-
translations/product/messages.fr.xlf | 5 +++++
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/Controller/User/Product/ObjectController.php b/src/Controller/User/Product/ObjectController.php
index db8b52d..5da2808 100644
--- a/src/Controller/User/Product/ObjectController.php
+++ b/src/Controller/User/Product/ObjectController.php
@@ -61,7 +61,7 @@ final class ObjectController extends AbstractController
return $this->redirectToRoute('app_product_show', $product->getRoutingParameters());
}
- return $this->render('pages/product/new_object.html.twig', compact('form'));
+ return $this->render('pages/product/new_object.html.twig', compact('form', 'product'));
}
#[Route(path: [
diff --git a/src/Controller/User/Product/ServiceController.php b/src/Controller/User/Product/ServiceController.php
index f5fbe9b..dad5958 100644
--- a/src/Controller/User/Product/ServiceController.php
+++ b/src/Controller/User/Product/ServiceController.php
@@ -66,7 +66,7 @@ final class ServiceController extends AbstractController
return $this->redirectToRoute('app_product_show', $product->getRoutingParameters());
}
- return $this->render('pages/product/new_service.html.twig', compact('form'));
+ return $this->render('pages/product/new_service.html.twig', compact('form', 'product'));
} else {
throw new GoneHttpException();
}
diff --git a/templates/components/product/_address_form.html.twig b/templates/components/product/_address_form.html.twig
index 0d1e669..afa1c1e 100644
--- a/templates/components/product/_address_form.html.twig
+++ b/templates/components/product/_address_form.html.twig
@@ -1,7 +1,7 @@
{% if app.user.address is not null %}
{% include 'components/layout/_title_5.html.twig' with {
rowClass: 'border-top',
- title: 'product.form.recover'|trans,
+ title: product.type.value == "object" ? 'product.form.recover'|trans : 'product.form.service_location'|trans,
colClass: 'col-md-8 col-lg-6 col-xl-5 mt-4'
} %}
{% include 'components/product/_address.html.twig' with {
diff --git a/translations/product/messages.fr.xlf b/translations/product/messages.fr.xlf
index 78dcc31..a165e60 100644
--- a/translations/product/messages.fr.xlf
+++ b/translations/product/messages.fr.xlf
@@ -151,6 +151,11 @@
A récupérer
+
+ product.form.service_location
+ Lieu de la prestation
+
+
product.form.address
Adresse