From ad72904aa9af471d6608e895367e9f87932c1722 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 27 Sep 2021 15:12:50 +0200 Subject: [PATCH] resume accourse: simplify alerts with simple link to edit page --- .../_join_household.html.twig | 49 ++++--------- .../AccompanyingCourse/_still_draft.html.twig | 16 +++++ .../_warning_address.html.twig | 70 +++++-------------- .../views/AccompanyingCourse/index.html.twig | 38 ++++------ .../translations/messages.fr.yml | 2 +- 5 files changed, 59 insertions(+), 116 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_still_draft.html.twig diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_join_household.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_join_household.html.twig index c57d12f1e..7ef2de466 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_join_household.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_join_household.html.twig @@ -1,41 +1,16 @@ -
-
-
- {{ 'Some peoples does not belong to any household currently. Add them to an household soon'|trans }} -
-
    -
  • - -
  • -
-
- -
-
- -

{{ 'household.Select people to move'|trans }}

-
    - {% for p in withoutHousehold %} -
  • - - {{ p|chill_entity_render_box }} -
  • - {% endfor %} -
- - - - -
    +
    +
    +
    + - -
    +
    + {{ 'Some peoples does not belong to any household currently. Add them to an household soon'|trans }} +
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_still_draft.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_still_draft.html.twig new file mode 100644 index 000000000..8e843e284 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_still_draft.html.twig @@ -0,0 +1,16 @@ +
+
+ +

{{ 'This accompanying course is still a draft'|trans }}

+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_warning_address.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_warning_address.html.twig index 490a91b59..f04a8a376 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_warning_address.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/_warning_address.html.twig @@ -1,61 +1,23 @@ {%- set countPersonLocation = accompanyingCourse.availablePersonLocation|length -%} -{%- set hasPersonLocation = countPersonLocation|length > 0 -%} -{% macro quickLocationForm(accompanyingCourse, person, whichButton) %} -
- - - {% if whichButton == 'string' %} - - {% elseif whichButton == 'icon' %} - - {% endif %} -
-{% endmacro %} -
-
-
- {{ 'This course is located at a temporarily address. You should locate this course to an user'|trans }} - {% if not hasPersonLocation %} - {{ 'Associate at least one member with an household, and set an address to this household'|trans }} - {% endif %} -
- - {% if 1 == countPersonLocation %} +{%- set hasPersonLocation = countPersonLocation > 0 -%} +
+
+
  • - {{ _self.quickLocationForm(accompanyingCourse, accompanyingCourse.availablePersonLocation.first, 'string') }} + + + Corriger +
- {% elseif 1 < countPersonLocation %} -
    -
  • - -
  • -
- {% endif %} -
- - {% if 1 < countPersonLocation %} -
-

{{ 'Locate by'|trans }}:

- -
- {% for p in accompanyingCourse.availablePersonLocation %} -
- {{ p|chill_entity_render_box({ - 'render': 'bloc', 'addLink': false, 'addInfo': true, 'addAltNames': false, 'customButtons': { - 'replace': _self.quickLocationForm(accompanyingCourse, p, 'icon') - } - }) }} -
- {% endfor %} -
- {% endif %} +

+ {{ 'This course is located at a temporarily address. You should locate this course to an user'|trans }}

+ {% if not hasPersonLocation %} +

+ {{ 'Associate at least one member with an household, and set an address to this household'|trans }}

+ {% endif %} +
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index be66abe73..a063fbb34 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -23,20 +23,22 @@ {% block content %}
- {% if 'DRAFT' == accompanyingCourse.step %} -
- - {{ 'This accompanying course is still a draft'|trans }} - - {{ 'Edit & activate accompanying course'|trans }} - - -
- {% endif %} -
WIP .. AccompanyingCourse Resume dashboard
- {# + {% if 'DRAFT' == accompanyingCourse.step %} + {% include '@ChillPerson/AccompanyingCourse/_still_draft.html.twig' %} + {% endif %} + {% if 'DRAFT' != accompanyingCourse.step %} + {% if withoutHousehold|length > 0 %} + {% include '@ChillPerson/AccompanyingCourse/_join_household.html.twig' %} + {% endif %} + {% endif %} + {% if accompanyingCourse.locationStatus == 'address' or accompanyingCourse.locationStatus == 'none' %} + {% include '@ChillPerson/AccompanyingCourse/_warning_address.html.twig' %} + {% endif %} + + + {# DISABLED

{{ 'Resume Accompanying Course'|trans }}

@@ -53,13 +55,6 @@ {% endif %} {% endfor %}
- #} - {% if 'DRAFT' != accompanyingCourse.step %} - {% if withoutHousehold|length > 0 %} - {% include '@ChillPerson/AccompanyingCourse/_join_household.html.twig' with {} %} - {% endif %} - {% endif %} - {#
@@ -80,11 +75,6 @@
{% endif %} - #} - {% if accompanyingCourse.locationStatus == 'address' or accompanyingCourse.locationStatus == 'none' %} - {% include '@ChillPerson/AccompanyingCourse/_warning_address.html.twig' with {} %} - {% endif %} - {#
diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 8b6b6db58..f8c1207ee 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -186,7 +186,7 @@ No accompanying user: Aucun accompagnant No data given: Pas d'information Participants: Personnes impliquées Create an accompanying course: Créer un parcours -This accompanying course is still a draft: Ce parcours est à l'état brouillon +This accompanying course is still a draft: Ce parcours est encore à l'état brouillon. Associated peoples: Usagers concernés Resources: Interlocuteurs privilégiés Requestor: Demandeur