diff --git a/src/Bundle/ChillMainBundle/Entity/Gender.php b/src/Bundle/ChillMainBundle/Entity/Gender.php index a14f433c8..bd8b26b68 100644 --- a/src/Bundle/ChillMainBundle/Entity/Gender.php +++ b/src/Bundle/ChillMainBundle/Entity/Gender.php @@ -30,8 +30,8 @@ class Gender private GenderEnum $genderTranslation; #[Serializer\Groups(['read'])] - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] - private string $icon = ''; + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, enumType: GenderIconEnum::class)] + private GenderIconEnum $icon; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, name: 'ordering', nullable: true, options: ['default' => '0.0'])] private float $order = 0; @@ -71,12 +71,12 @@ class Gender $this->$genderTranslation = $genderTranslation; } - public function getIcon(): string + public function getIcon(): GenderIconEnum { return $this->icon; } - public function setIcon(string $icon): void + public function setIcon(GenderIconEnum $icon): void { $this->icon = $icon; } diff --git a/src/Bundle/ChillMainBundle/Entity/GenderIconEnum.php b/src/Bundle/ChillMainBundle/Entity/GenderIconEnum.php new file mode 100644 index 000000000..da8c2221e --- /dev/null +++ b/src/Bundle/ChillMainBundle/Entity/GenderIconEnum.php @@ -0,0 +1,12 @@ +add('label', TranslatableStringFormType::class, [ 'required' => true, ]) - ->add('icon', TextType::class) + ->add('icon', ChoiceType::class, [ + 'choices' => GenderIconEnum::cases(), + 'expanded' => true, + 'multiple' => false, + 'mapped' => true, + 'label' => 'Select Gender Icon', + ]) ->add('genderTranslation', ChoiceType::class, [ 'choices' => GenderEnum::cases(), 'choice_label' => fn(GenderEnum $enum) => ucfirst(strtolower($enum->name)), diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/bootstrap/index.js b/src/Bundle/ChillMainBundle/Resources/public/module/bootstrap/index.js index a9d34e01d..91d66416a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/bootstrap/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/module/bootstrap/index.js @@ -10,6 +10,7 @@ import Modal from 'bootstrap/js/dist/modal'; import Collapse from 'bootstrap/js/src/collapse'; import Carousel from 'bootstrap/js/src/carousel'; import Popover from 'bootstrap/js/src/popover'; +import 'bootstrap-icons/font/bootstrap-icons.css'; // // Carousel: ACHeaderSlider is a small slider used in banner of AccompanyingCourse Section @@ -59,4 +60,4 @@ const popoverList = triggerList.map(function (el) { return new Popover(el, { html: true, }); -}); \ No newline at end of file +}); diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig index bd3ff0ff1..7c3c02abe 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Entity/person.html.twig @@ -85,12 +85,8 @@ {%- endif -%} {%- if options['addInfo'] -%} - {% set gender = (person.gender == 'woman') ? 'fa-venus' : - (person.gender == 'man') ? 'fa-mars' : (person.gender == 'both') ? 'fa-neuter' : 'fa-genderless' %} - {% set genderTitle = (person.gender == 'woman') ? 'woman' : - (person.gender == 'man') ? 'man' : (person.gender == 'both') ? 'both' : 'Not given'|trans %}
- + {%- if person.deathdate is not null -%} {%- if person.birthdate is not null -%} diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml index c65e8ccdd..eaeaf137d 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -3,13 +3,14 @@ Born the date: >- man {Né le {birthdate}} woman {Née le {birthdate}} neutral {Né·e le {birthdate}} + other {Né·e le {birthdate}} } Requestor: >- {gender, select, man {Demandeur} woman {Demandeuse} - other {Demandeur·euse} + neutral {Demandeur·euse} } person: @@ -17,7 +18,7 @@ person: {gender, select, man {et lui-même} woman {et elle-même} - other {et lui·elle-même} + neutral {et lui·elle-même} } from_the: depuis le