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\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final class PersonResourceType extends AbstractType
|
||||
{
|
||||
private ResourceKindRender $resourceKindRender;
|
||||
private PersonRender $personRender;
|
||||
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->personRender = $personRender;
|
||||
$this->thirdPartyRender = $thirdPartyRender;
|
||||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
@ -54,6 +57,7 @@ final class PersonResourceType extends AbstractType
|
||||
$qb->where($qb->expr()->eq('pr.isActive', 'TRUE'));
|
||||
return $qb;
|
||||
},
|
||||
'placeholder' => $this->translator->trans('Select a type'),
|
||||
'choice_label' => function (PersonResourceKind $personResourceKind) {
|
||||
$options = [];
|
||||
return $this->resourceKindRender->renderString($personResourceKind, $options);
|
||||
@ -62,6 +66,7 @@ final class PersonResourceType extends AbstractType
|
||||
->add('person', EntityType::class, [
|
||||
'label' => 'Usager',
|
||||
'class' => Person::class,
|
||||
'placeholder' => $this->translator->trans('Select a person'),
|
||||
'required' => false,
|
||||
'choice_label' => function (Person $person) {
|
||||
$options = [];
|
||||
@ -72,6 +77,7 @@ final class PersonResourceType extends AbstractType
|
||||
'label' => 'Tiers',
|
||||
'class' => ThirdParty::class,
|
||||
'required' => false,
|
||||
'placeholder' => $this->translator->trans('Select a thirdparty'),
|
||||
'choice_label' => function (ThirdParty $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"
|
||||
There are no available resources: "Il y aucun ressource"
|
||||
no comment found: "Aucun commentaire"
|
||||
Select a type: "Choisissez un type"
|
||||
Select a person: "Choisissez un usager"
|
||||
Select a thirdparty: "Choisissez un tiers"
|
||||
|
||||
|
||||
# pickAPersonType
|
||||
Pick a person: Choisir une personne
|
||||
|
Loading…
x
Reference in New Issue
Block a user