diff --git a/CHANGELOG.md b/CHANGELOG.md index f5d835f17..57ecdf5a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to * [Datepickers] datepickers fixed when using keyboard to enter date (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/545) * [social_action] Display 'agents traitants' in parcours resumé and social action list (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/568) +* [Person_search] Closed parcours shown within an accordeon that can be opened/closed (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/574) ## Test releases diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index 1750533f8..e4cdcb10c 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -16,6 +16,9 @@ // Chill forms @import './scss/forms'; +// Extend bootstrap accordion +@import './scss/accordion'; + // Chill record_actions @import './scss/record_actions'; diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/accordion.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/accordion.scss new file mode 100644 index 000000000..88d4b5e08 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/accordion.scss @@ -0,0 +1,11 @@ +.accordion { + // show a folded / label on accordion + button[aria-expanded="true"] > span.folded, + button[aria-expanded="false"] > span.unfolded { display: none; } + button[aria-expanded="false"] > span.folded, + button[aria-expanded="true"] > span.unfolded { display: inline; } + + .accordion-item { + margin-bottom: 1rem; + } +} diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/flex_table.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/flex_table.scss index 2383e43b1..30cac9c85 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/flex_table.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/flex_table.scss @@ -30,6 +30,7 @@ div.list-with-period { // override wrap-list div.wrap-list.periods-list { + padding-right: 1rem; div.wl-row { flex-wrap: nowrap; div.wl-col { @@ -63,6 +64,7 @@ div.list-with-period { } div.periods-list { + padding-right: 1rem; div.title { text-align: right; div.date {} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig index 62d0682df..cfa616988 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/_list_item.html.twig @@ -20,7 +20,7 @@ {% elseif period.step == 'CONFIRMED' %} {{- 'Confirmed'|trans|upper -}} {% else %} - {{- 'Closed'|trans|upper -}} + {{- 'Closed'|trans|upper -}} {% endif %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/accompanying_period.html.twig index a793ac37a..acd251735 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/accompanying_period.html.twig @@ -10,12 +10,6 @@ {% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' %} {% if accompanying_periods_old|length > 0 %} -

diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig index a00c8df36..7ba2235a6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/summary.html.twig @@ -191,12 +191,6 @@ {% endif %} {% if old_members|length > 0 %} -

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 c43806a71..9c7486fc2 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 @@ -10,6 +10,157 @@ {% endmacro %} +{% macro accompanying_period(acp, person) %} + {% set app = person.findParticipationForPeriod(acp) %} +
+
+
+
+

+ + {{ 'Course number'|trans }} {{ acp.id }} +

+
+
+
+ {% if app != null %} +
+ {{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }} +
+ {% endif %} + + {% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) %} + {% if notif_counter.total > 0 %} + {{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) }} + {% endif %} +
+
+ {% if acp.requestoranonymous == false and acp.requestorPerson is same as(person) %} + + {{ 'Requestor'|trans({'gender': person.gender}) }} + + {% endif %} + + {% if acp.emergency %} + {{- 'Emergency'|trans|upper -}} + {% endif %} + + {% if acp.confidential %} + {{- 'Confidential'|trans|upper -}} + {% endif %} + + {% if acp.step == 'DRAFT' %} + {{ 'course.draft'|trans }} + {% endif %} + + {% if acp.step == 'CLOSED' %} + {{ 'course.closed'|trans }} + {% endif %} +
+
+
+ + {% if acp.user is not null %} +
+
+

{{ 'Referrer'|trans }}

+
+
+
+ {{ acp.user|chill_entity_render_box }} +
+
+
+ {% endif %} + + {% if acp.socialIssues|length > 0 %} +
+
+

{{ 'Social issues'|trans }}

+
+
+ {% for issue in acp.socialIssues %} + {{ issue|chill_entity_render_box }} + {% endfor %} +
+
+ {% endif %} + + {% if acp.currentParticipations|length > 1 %} +
+
+

+ {{ 'Participants'|trans }} +

+
+
+ {% set participating = false %} + {% for part in acp.currentParticipations %} + {% if part.person.id != person.id %} + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + targetEntity: { name: 'person', id: part.person.id }, + action: 'show', + displayBadge: true, + buttonText: part.person|chill_entity_render_string, + isDead: part.person.deathdate is not null + } %} + {% else %} + {% set participating = true %} + {% endif %} + {% endfor %} + {% if participating %} + {{ 'person.and_himself'|trans({'gender': person.gender}) }} + {% endif %} +
+
+ {% endif %} + + {% if acp.requestoranonymous == false %} + {% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %} +
+
+

+ {% if acp.requestorPerson is not null %} + {{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }} + {% else %} + {{ 'Requestor'|trans({'gender': 'other'})}} + {% endif %} +

+
+
+ {% if acp.requestorThirdParty is not null %} + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + targetEntity: { name: 'thirdparty', id: acp.requestorThirdParty.id }, + action: 'show', + displayBadge: true, + buttonText: acp.requestorThirdParty|chill_entity_render_string + } %} + {% else %} + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + targetEntity: { name: 'person', id: acp.requestorPerson.id }, + action: 'show', + displayBadge: true, + buttonText: acp.requestorPerson|chill_entity_render_string, + isDead: acp.requestorPerson.deathdate is not null + } %} + {% endif %} +
+
+ {% endif %} + {% endif %} + + +
+
+{% endmacro %} +

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

@@ -66,167 +217,53 @@ {#- 'acps' is for AcCompanyingPeriodS #} {%- set acps = [] %} + {%- set acpsClosed = [] %} {%- for acp in person.accompanyingPeriodInvolved %} {%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', acp) %} - {%- set acps = acps|merge([acp]) %} + {% if acp.step == 'CLOSED' %} + {%- set acpsClosed = acpsClosed|merge([acp]) %} + {% else %} + {%- set acps = acps|merge([acp]) %} + {% endif %} {%- endif %} {%- endfor %} {# add as requestor #} {% if acps|length > 0 %} {% for acp in acps %} - {% set app = person.findParticipationForPeriod(acp) %} -
-
-
-
-

- - {{ 'Course number'|trans }} {{ acp.id }} -

-
-
-
- {% if app != null %} -
- {{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }} -
- {% endif %} - - {% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) %} - {% if notif_counter.total > 0 %} - {{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) }} - {% endif %} -
-
- {% if acp.requestoranonymous == false and acp.requestorPerson is same as(person) %} - - {{ 'Requestor'|trans({'gender': person.gender}) }} - - {% endif %} - - {% if acp.emergency %} - {{- 'Emergency'|trans|upper -}} - {% endif %} - - {% if acp.confidential %} - {{- 'Confidential'|trans|upper -}} - {% endif %} - - {% if acp.step == 'DRAFT' %} - {{ 'course.draft'|trans }} - {% endif %} - - {% if acp.step == 'CLOSED' %} - {{ 'course.closed'|trans }} - {% endif %} -
-
-
- - {% if acp.user is not null %} -
-
-

{{ 'Referrer'|trans }}

-
-
-
- {{ acp.user|chill_entity_render_box }} -
-
-
- {% endif %} - - {% if acp.socialIssues|length > 0 %} -
-
-

{{ 'Social issues'|trans }}

-
-
- {% for issue in acp.socialIssues %} - {{ issue|chill_entity_render_box }} - {% endfor %} -
-
- {% endif %} - - {% if acp.currentParticipations|length > 1 %} -
-
-

- {{ 'Participants'|trans }} -

-
-
- {% set participating = false %} - {% for part in acp.currentParticipations %} - {% if part.person.id != person.id %} - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - targetEntity: { name: 'person', id: part.person.id }, - action: 'show', - displayBadge: true, - buttonText: part.person|chill_entity_render_string, - isDead: part.person.deathdate is not null - } %} - {% else %} - {% set participating = true %} - {% endif %} - {% endfor %} - {% if participating %} - {{ 'person.and_himself'|trans({'gender': person.gender}) }} - {% endif %} -
-
- {% endif %} - - {% if acp.requestoranonymous == false %} - {% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %} -
-
-

- {% if acp.requestorPerson is not null %} - {{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }} - {% else %} - {{ 'Requestor'|trans({'gender': 'other'})}} - {% endif %} -

-
-
- {% if acp.requestorThirdParty is not null %} - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - targetEntity: { name: 'thirdparty', id: acp.requestorThirdParty.id }, - action: 'show', - displayBadge: true, - buttonText: acp.requestorThirdParty|chill_entity_render_string - } %} - {% else %} - {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { - targetEntity: { name: 'person', id: acp.requestorPerson.id }, - action: 'show', - displayBadge: true, - buttonText: acp.requestorPerson|chill_entity_render_string, - isDead: acp.requestorPerson.deathdate is not null - } %} - {% endif %} -
-
- {% endif %} - {% endif %} - - - -
-
+ {{ _self.accompanying_period(acp, person) }} {% endfor %} {% endif %} + {% if acpsClosed|length > 0 %} +
+
+

+ +

+ +
+ {% for acp in acpsClosed %} + {{ _self.accompanying_period(acp, person) }} + {% endfor %} +
+
+
+ {% endif %} + +
{% endfor %}

diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml index 44f69b4c2..0e825aa72 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -114,3 +114,19 @@ household_composition: few {# enfants dans le ménage} other {# enfants dans le ménage} } + +periods: + show closed periods: >- + {nb_items, plural, + =0 {Aucun parcours clôturé} + one {Montrer un parcours clôturé} + many {Montrer # parcours clôturés} + other {Montrer # parcours clôturés} + } + hide closed periods: >- + {nb_items, plural, + =0 {Aucun parcours clôturé} + one {Masquer un parcours clôturé} + many {Masquer # parcours clôturés} + other {Masquer # parcours clôturés} + } diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 8679f6e95..77ff2bdb2 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -465,6 +465,9 @@ fix it: Compléter accompanying_course: administrative_location: Localisation administrative comment is pinned: Le commentaire est épinglé +show: Montrer +hide: Masquer +closed periods: parcours clôturer # Accompanying Course comments Accompanying Course Comment: Commentaire