From 8470604b8f615eb0389f7a718638e8fefd77c317 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 21 Apr 2022 22:06:22 +0200 Subject: [PATCH 1/9] macro added + closed parcours displayed in accordeon --- .../Resources/public/chill/chillperson.scss | 12 + .../views/Person/list_with_period.html.twig | 319 ++++++++++-------- 2 files changed, 187 insertions(+), 144 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss index fba0516a7..048a5c7f0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss @@ -288,3 +288,15 @@ div#dashboards { } } } + + +// accordeon person search result - closed parcours + +.accordion-item { + margin-bottom: 1rem; +} + +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; } 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..b9928bfe1 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,158 @@ {% 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 }}

@@ -75,155 +227,34 @@ {% 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 %} + {% if acp.step == 'CLOSED' %} +
+
+

+ +

- {% 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 %} -
+ {{ _self.accompanying_period(acp, person) }}
- - {% 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 %} - - -
-
+ {% else %} + {{ _self.accompanying_period(acp, person) }} + {% endif %} {% endfor %} {% endif %} From d757e07dfc0d577d54757c7670a7b34a0f348355 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 21 Apr 2022 22:06:22 +0200 Subject: [PATCH 2/9] macro added + closed parcours displayed in accordeon --- .../Resources/public/chill/chillperson.scss | 12 + .../views/Person/list_with_period.html.twig | 319 ++++++++++-------- 2 files changed, 187 insertions(+), 144 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss index fba0516a7..048a5c7f0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss @@ -288,3 +288,15 @@ div#dashboards { } } } + + +// accordeon person search result - closed parcours + +.accordion-item { + margin-bottom: 1rem; +} + +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; } 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..b9928bfe1 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,158 @@ {% 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 }}

@@ -75,155 +227,34 @@ {% 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 %} + {% if acp.step == 'CLOSED' %} +
+
+

+ +

- {% 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 %} -
+ {{ _self.accompanying_period(acp, person) }}
- - {% 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 %} - - -
-
+ {% else %} + {{ _self.accompanying_period(acp, person) }} + {% endif %} {% endfor %} {% endif %} From 0cbcd91c3f1d694dd07d697cd7c26555df33dab6 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 22 Apr 2022 17:49:57 +0200 Subject: [PATCH 3/9] closed periods in accordeon + styling --- .../public/chill/scss/flex_table.scss | 2 + .../views/Person/list_with_period.html.twig | 319 +++++++++--------- 2 files changed, 165 insertions(+), 156 deletions(-) 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/Person/list_with_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Person/list_with_period.html.twig index b9928bfe1..e2c06accb 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 @@ -12,154 +12,153 @@ {% 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 }} +

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

- {% 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 %} +
+ {% if app != null %} +
+ {{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }} +
{% endif %} - {% endfor %} - {% if participating %} - {{ 'person.and_himself'|trans({'gender': person.gender}) }} - {% 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 %} +
- {% 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.user is not null %}
-

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

{{ '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 }}

- {% 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 - } %} + {% 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 %} - {% 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 %}
@@ -218,46 +217,54 @@ {#- '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 %} - {% if acp.step == 'CLOSED' %} -
-
-

- -

- -
- - {{ _self.accompanying_period(acp, person) }} -
-
-
- {% else %} - {{ _self.accompanying_period(acp, person) }} - {% endif %} + {{ _self.accompanying_period(acp, person) }} {% endfor %} {% endif %} + {% if acpsClosed|length > 0 %} +
+
+

+ +

+ +
+ {% for acp in acpsClosed %} + + {{ _self.accompanying_period(acp, person) }} + {% endfor %} +
+
+
+ {% endif %} + +
{% endfor %}
From 6747cad210ac19cf5bd7681ac5618bf976b56538 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 22 Apr 2022 18:02:59 +0200 Subject: [PATCH 4/9] add amount of closed periods in accordeon message --- .../Resources/views/Person/list_with_period.html.twig | 4 ++-- .../translations/messages+intl-icu.fr.yaml | 9 +++++++++ .../ChillPersonBundle/translations/messages.fr.yml | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) 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 e2c06accb..77cedd0b3 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 @@ -246,8 +246,8 @@ data-bs-target="#collapse_{{ person.id }}" aria-expanded="false" aria-controls="collapse_{{ person.id }}"> - {{ 'Show closed parcours of %name%'|trans({'%name%': person.firstName ~ " " ~ person.lastName }) }} ({{ 'budget.number of elements'|trans({ 'nb_items': 1 }) }}) - {{ 'Hide closed parcours of %name%'|trans({'%name%': person.firstName ~ " " ~ person.lastName }) }} + {{ 'show'|trans }} {{ 'periods.number of periods'|trans({ 'nb_items': acpsClosed|length }) }}{{ 'closed periods'|trans }} + {{ 'hide'|trans }} {{ 'closed periods'|trans }} diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml index 44f69b4c2..ac861c0e5 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -114,3 +114,12 @@ household_composition: few {# enfants dans le ménage} other {# enfants dans le ménage} } + +periods: + number of periods: >- + {nb_items, plural, + =0 {Aucun } + one {un } + many {# } + other {# } + } diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 2a4077e1c..9c44ae471 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 From ca166655da842f81bbb88ed88fa5605d79fd5feb Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 22 Apr 2022 18:05:47 +0200 Subject: [PATCH 5/9] changelog updated --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7c1c3d1f..9d7d3e17d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,8 @@ and this project adheres to * [Accompanying period work evaluations] list documents associated to a work by creation date, and then by id, from the most recent to older * [Course comment] add validationConstraint NotNull and NotBlank on comment content, to avoid sql error * [Notifications] delay the sending of notificaiton to kernel.terminate -* [Notifications / Period user change] fix the sending of notification when user changes +* [Notifications / Period user change] fix the sending of notification when user changes +* [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 From 916560c5227c0446acec9ac8a23b1a77cac41945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 25 Apr 2022 20:56:24 +0200 Subject: [PATCH 6/9] list with period: full sentences in translation component --- .../views/Person/list_with_period.html.twig | 4 ++-- .../translations/messages+intl-icu.fr.yaml | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) 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 77cedd0b3..d3c053372 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 @@ -246,8 +246,8 @@ data-bs-target="#collapse_{{ person.id }}" aria-expanded="false" aria-controls="collapse_{{ person.id }}"> - {{ 'show'|trans }} {{ 'periods.number of periods'|trans({ 'nb_items': acpsClosed|length }) }}{{ 'closed periods'|trans }} - {{ 'hide'|trans }} {{ 'closed periods'|trans }} + {{ 'periods.show closed periods'|trans({ 'nb_items': acpsClosed|length }) }} + {{ 'periods.hide closed periods'|trans({ 'nb_items': acpsClosed|length }) }} diff --git a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml index ac861c0e5..0e825aa72 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillPersonBundle/translations/messages+intl-icu.fr.yaml @@ -116,10 +116,17 @@ household_composition: } periods: - number of periods: >- + show closed periods: >- {nb_items, plural, - =0 {Aucun } - one {un } - many {# } - other {# } + =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} } From 72012a70d94481f105c48783ecef9cfd887da7be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 25 Apr 2022 21:23:12 +0200 Subject: [PATCH 7/9] button "closed" with same layout than in course header --- .../Resources/views/Person/list_with_period.html.twig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 d3c053372..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 @@ -54,7 +54,7 @@ {% endif %} {% if acp.step == 'CLOSED' %} - {{ 'course.closed'|trans }} + {{ 'course.closed'|trans }} {% endif %}
@@ -256,7 +256,6 @@ aria-labelledby="heading_{{ person.id }}" data-bs-parent="#nonCurrent"> {% for acp in acpsClosed %} - {{ _self.accompanying_period(acp, person) }} {% endfor %}
From 81c8d0ec77f971398a6d623a7d46a2b70e16118f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 25 Apr 2022 21:23:41 +0200 Subject: [PATCH 8/9] move extension of accordion bootstrap to dedicated file --- .../Resources/public/chill/chillmain.scss | 3 +++ .../Resources/public/chill/scss/accordion.scss | 11 +++++++++++ .../Resources/public/chill/chillperson.scss | 12 ------------ 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 src/Bundle/ChillMainBundle/Resources/public/chill/scss/accordion.scss 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/chillperson.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss index 048a5c7f0..fba0516a7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss @@ -288,15 +288,3 @@ div#dashboards { } } } - - -// accordeon person search result - closed parcours - -.accordion-item { - margin-bottom: 1rem; -} - -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; } From c39fa1c49b8c7dca3fe6b02a5489cae3bc15e869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 25 Apr 2022 21:27:56 +0200 Subject: [PATCH 9/9] remove legacy folded/unfolded style requirements for showing label on accordion --- .../Resources/views/AccompanyingPeriod/_list_item.html.twig | 2 +- .../Resources/views/Household/accompanying_period.html.twig | 6 ------ .../Resources/views/Household/summary.html.twig | 6 ------ 3 files changed, 1 insertion(+), 13 deletions(-) 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 %} -