mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add placeholders for inputs
This commit is contained in:
parent
126bd1a4eb
commit
ecae7dab44
@ -28,18 +28,21 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\RadioType;
|
use Symfony\Component\Form\Extension\Core\Type\RadioType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
final class PersonResourceType extends AbstractType
|
final class PersonResourceType extends AbstractType
|
||||||
{
|
{
|
||||||
private ResourceKindRender $resourceKindRender;
|
private ResourceKindRender $resourceKindRender;
|
||||||
private PersonRender $personRender;
|
private PersonRender $personRender;
|
||||||
private ThirdPartyRender $thirdPartyRender;
|
private ThirdPartyRender $thirdPartyRender;
|
||||||
|
private TranslatorInterface $translator;
|
||||||
|
|
||||||
public function __construct(ResourceKindRender $resourceKindRender, PersonRender $personRender, ThirdPartyRender $thirdPartyRender)
|
public function __construct(ResourceKindRender $resourceKindRender, PersonRender $personRender, ThirdPartyRender $thirdPartyRender, TranslatorInterface $translator)
|
||||||
{
|
{
|
||||||
$this->resourceKindRender = $resourceKindRender;
|
$this->resourceKindRender = $resourceKindRender;
|
||||||
$this->personRender = $personRender;
|
$this->personRender = $personRender;
|
||||||
$this->thirdPartyRender = $thirdPartyRender;
|
$this->thirdPartyRender = $thirdPartyRender;
|
||||||
|
$this->translator = $translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
@ -54,6 +57,7 @@ final class PersonResourceType extends AbstractType
|
|||||||
$qb->where($qb->expr()->eq('pr.isActive', 'TRUE'));
|
$qb->where($qb->expr()->eq('pr.isActive', 'TRUE'));
|
||||||
return $qb;
|
return $qb;
|
||||||
},
|
},
|
||||||
|
'placeholder' => $this->translator->trans('Select a type'),
|
||||||
'choice_label' => function (PersonResourceKind $personResourceKind) {
|
'choice_label' => function (PersonResourceKind $personResourceKind) {
|
||||||
$options = [];
|
$options = [];
|
||||||
return $this->resourceKindRender->renderString($personResourceKind, $options);
|
return $this->resourceKindRender->renderString($personResourceKind, $options);
|
||||||
@ -62,6 +66,7 @@ final class PersonResourceType extends AbstractType
|
|||||||
->add('person', EntityType::class, [
|
->add('person', EntityType::class, [
|
||||||
'label' => 'Usager',
|
'label' => 'Usager',
|
||||||
'class' => Person::class,
|
'class' => Person::class,
|
||||||
|
'placeholder' => $this->translator->trans('Select a person'),
|
||||||
'required' => false,
|
'required' => false,
|
||||||
'choice_label' => function (Person $person) {
|
'choice_label' => function (Person $person) {
|
||||||
$options = [];
|
$options = [];
|
||||||
@ -72,6 +77,7 @@ final class PersonResourceType extends AbstractType
|
|||||||
'label' => 'Tiers',
|
'label' => 'Tiers',
|
||||||
'class' => ThirdParty::class,
|
'class' => ThirdParty::class,
|
||||||
'required' => false,
|
'required' => false,
|
||||||
|
'placeholder' => $this->translator->trans('Select a thirdparty'),
|
||||||
'choice_label' => function (ThirdParty $thirdParty) {
|
'choice_label' => function (ThirdParty $thirdParty) {
|
||||||
$options = [];
|
$options = [];
|
||||||
return $this->thirdPartyRender->renderString($thirdParty, $options);
|
return $this->thirdPartyRender->renderString($thirdParty, $options);
|
||||||
|
@ -235,6 +235,10 @@ The resource has been successfully removed.: "La ressource a été supprimée."
|
|||||||
List of resources: "Liste des ressources"
|
List of resources: "Liste des ressources"
|
||||||
There are no available resources: "Il y aucun ressource"
|
There are no available resources: "Il y aucun ressource"
|
||||||
no comment found: "Aucun commentaire"
|
no comment found: "Aucun commentaire"
|
||||||
|
Select a type: "Choisissez un type"
|
||||||
|
Select a person: "Choisissez un usager"
|
||||||
|
Select a thirdparty: "Choisissez un tiers"
|
||||||
|
|
||||||
|
|
||||||
# pickAPersonType
|
# pickAPersonType
|
||||||
Pick a person: Choisir une personne
|
Pick a person: Choisir une personne
|
||||||
|
Loading…
x
Reference in New Issue
Block a user