Improve admin templates for event admin entities + activity reason (category)...

This commit is contained in:
2025-06-30 08:44:24 +00:00
committed by Julien Fastré
parent bdf1cf71ba
commit 298044bc82
24 changed files with 54 additions and 345 deletions

View File

@@ -16,10 +16,8 @@ use Chill\MainBundle\Form\Type\CommentType;
use Chill\PersonBundle\Entity\Person\PersonResource;
use Chill\PersonBundle\Entity\Person\PersonResourceKind;
use Chill\PersonBundle\Form\Type\PickPersonDynamicType;
use Chill\PersonBundle\Templating\Entity\PersonRenderInterface;
use Chill\PersonBundle\Templating\Entity\ResourceKindRender;
use Chill\ThirdPartyBundle\Form\Type\PickThirdpartyDynamicType;
use Chill\ThirdPartyBundle\Templating\Entity\ThirdPartyRender;
use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
@@ -29,7 +27,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
final class PersonResourceType extends AbstractType
{
public function __construct(private readonly ResourceKindRender $resourceKindRender, private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatorInterface $translator) {}
public function __construct(private readonly ResourceKindRender $resourceKindRender, private readonly TranslatorInterface $translator) {}
public function buildForm(FormBuilderInterface $builder, array $options)
{
@@ -52,13 +50,13 @@ final class PersonResourceType extends AbstractType
},
])
->add('person', PickPersonDynamicType::class, [
'label' => 'Usager',
'label' => $this->translator->trans('person_resource.person_non_prof'),
])
->add('thirdparty', PickThirdpartyDynamicType::class, [
'label' => 'Tiers',
'label' => $this->translator->trans('person_resource.thirdparty_prof'),
])
->add('freetext', ChillTextareaType::class, [
'label' => 'Description libre',
'label' => $this->translator->trans('person_resource.freetext'),
'required' => false,
])
->add('comment', CommentType::class, [