From 7933aaed1c02fc4ea7687bb12593d72e1c7f6751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 7 Jun 2021 14:25:15 +0200 Subject: [PATCH 1/7] use MessageFormatter for formatting message with gender --- .../views/Person/list_with_period.html.twig | 178 ------------------ .../translations/messages+intl-icu.fr.yaml | 6 + 2 files changed, 6 insertions(+), 178 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig index 10c0e0bc7..e69de29bb 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig @@ -1,178 +0,0 @@ -

{{ title|default('Person search results')|trans }}

- -

- {{ '%total% persons matching the search pattern:'|transchoice( total, { '%total%' : total}) }} - - {{ pattern }} - -

- -

{{ 'Results %start%-%end% of %total%'|trans({ '%start%' : start, '%end%': start + persons|length, '%total%' : total } ) }}

- - - - -{% if persons|length > 0 %} - -
- {% for person in persons %} - -
-
- -
-
{{ person|chill_entity_render_box({'addLink': true}) }}
-
{{ 'Born the %date%'|transchoice(person.genderNumeric, { '%date%': person.birthdate|format_date("medium") }) }}
-
- -
-
    -
  • - {{ person.center }} -
  • - -
  • - {% if person.mobilenumber is not empty %} - {{ person.mobilenumber|chill_format_phonenumber }} - {% else %} - - {% if person.phonenumber is not empty %} - {{ person.phonenumber|chill_format_phonenumber }} - {% else %} - {{ 'No data given'|trans }} - {% endif %} - {% endif %} -
  • - -
  • - - {% if person.getLastAddress is not null %} - {{ person.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }} - {% else %} - {{ 'No address'|trans }} - {% endif %} -
  • - -
- -
- -
- - {#- 'apps' is for AccompanyingPeriodParticipationS #} - {#- filter using acl -#} - {%- set apps = [] %} - {%- for app in person.openedParticipations %} - {%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', app.accompanyingPeriod) %} - {%- set apps = apps|merge([app]) %} - {%- endif %} - {%- endfor %} - - {% if apps|length > 0 %} - {% for app in apps %} -
- -
- - - - {{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }} - {% if app.accompanyingPeriod.user is not null %} - - ref: - {{ app.accompanyingPeriod.user|chill_entity_render_box }} - - {% endif %} -
- -
- {% for issue in app.accompanyingPeriod.socialIssues|slice(0,2) %} - {{ issue|chill_entity_render_box }} - {% endfor %} - - {% if app.accompanyingPeriod.socialIssues|length > 2 %} - {{ 'and %number% other'|transchoice(app.accompanyingPeriod.socialIssues|length-2) }} - {% endif %} -
- -
- {% endfor %} - - {% endif %} - -
- - {% endfor %} -
- - - -{% else %} - -{% endif %} - -{% if preview == false %} - {{ chill_pagination(paginator) }} -{% endif %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml new file mode 100644 index 000000000..f08371677 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -0,0 +1,6 @@ +Born the date: >- + {gender, select, + man {Né le {birthdate}} + woman {Née le {birthdate}} + other {Né·e le {birthdate}} + } From 84d5fb936e5ff4d5aecfb8d9142b8036e37f2898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 7 Jun 2021 14:48:36 +0200 Subject: [PATCH 2/7] use encore entry tags to load css and js in layout --- .../Resources/views/layout.html.twig | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig index 7c8231d4b..2bdb6c715 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig @@ -28,16 +28,16 @@ {{ installation.name }} - {% block title %}{% endblock %} - - + {{ encore_entry_link_tags('scratch') }} + {{ encore_entry_link_tags('chill') }} {% if active_bootstrap == 1 %} - + {{ encore_entry_link_tags('bootstrap') }} {% endif %} {% if active_forkawesome == 1 %} - + {{ encore_entry_link_tags('forkawesome') }} {% endif %} {% if active_ckeditor == 1 %} - + {{ encore_entry_link_tags('ckeditor5') }} {% endif %} {% block css%}{% endblock %} @@ -152,17 +152,16 @@ {{ include('@ChillMain/Layout/_footer.html.twig') }} - - - + {{ encore_entry_script_tags('scratch') }} + {{ encore_entry_script_tags('chill') }} {% if active_bootstrap == 1 %} - + {{ encore_entry_script_tags('bootstrap') }} {% endif %} {% if active_forkawesome == 1 %} - + {{ encore_entry_script_tags('forkawesome') }} {% endif %} {% if active_ckeditor == 1 %} - + {{ encore_entry_script_tags('ckeditor5') }} {% endif %}