From 0cbcd91c3f1d694dd07d697cd7c26555df33dab6 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 22 Apr 2022 17:49:57 +0200 Subject: [PATCH] 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 %}