From 1119e20a4958c38f49f7c05bc5dbfb6f7dcdfbef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 29 Jun 2021 16:03:59 +0200 Subject: [PATCH 1/4] Add minor fixes to summary page: * add messages when no resources * add address to person * replace household link label with household number --- .../views/AccompanyingCourse/index.html.twig | 191 +++++++++--------- .../translations/messages.fr.yml | 1 + 2 files changed, 99 insertions(+), 93 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index 364f8c7fd..cdb71c99b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -91,7 +91,7 @@
  • {%- if p.person.lastAddress is not empty -%} - {{ p.person.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }} + {{ p.person.currentHouseholdAddress|chill_entity_render_box({'with_valid_from': false}) }} {%- else -%} {{ 'No address given'|trans }} {%- endif -%} @@ -110,7 +110,7 @@ ) }}" class="sc-button"> - {{ 'household.Household file'|trans }} + n° {{ p.person.getCurrentHousehold.id }}
  • {% endif %} @@ -124,101 +124,106 @@

    {{ 'Resources'|trans }}

    -
    - {% for r in accompanyingCourse.resources %} -
    - {% if r.person %} -
    -
    -

    - {{ r.person.firstname ~ ' ' ~ r.person.lastname }} - {{ 'Usager' }} -

    -

    - {% set born = (r.person.gender == 'woman') ? 'née': 'né' %} - {% set gender = (r.person.gender == 'woman') ? 'fa-venus' : - (r.person.gender == 'man') ? 'fa-mars' : 'fa-neuter' %} - {% set genderTitle = (r.person.gender == 'woman') ? 'femme' : - (r.person.gender == 'homme') ? 'fa-mars' : 'neutre' %} - {{ born ~ ' le ' ~ r.person.birthdate|format_date('short') }} -

    -
    -
    -
      -
    • - {% if r.person.mobilenumber %} - {{ r.person.mobilenumber }} - {% else %} - - {% if r.person.phonenumber %} - {{ r.person.phonenumber }} - {% else %} - {{ 'No data given'|trans }} - {% endif %} - {% endif %} -
    • -
    • - - {%- if r.person.lastAddress is not empty -%} - {{ r.person.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }} - {%- else -%} - {{ 'No address given'|trans }} - {%- endif -%} -
    • -
    -
      -
    • - -
    • -
    -
    -
    + {% if accompanyingCourse.resources|length == 0 %} +

    {{ 'Any resource for this accompanying course'|trans }}

    + {% else %} +
    + {% for r in accompanyingCourse.resources %} +
    + {% if r.person %} - {% endif %} - {% if r.thirdParty %} +
    +
    +

    + {{ r.person.firstname ~ ' ' ~ r.person.lastname }} + {{ 'Usager' }} +

    +

    + {% set born = (r.person.gender == 'woman') ? 'née': 'né' %} + {% set gender = (r.person.gender == 'woman') ? 'fa-venus' : + (r.person.gender == 'man') ? 'fa-mars' : 'fa-neuter' %} + {% set genderTitle = (r.person.gender == 'woman') ? 'femme' : + (r.person.gender == 'homme') ? 'fa-mars' : 'neutre' %} + {{ born ~ ' le ' ~ r.person.birthdate|format_date('short') }} +

    +
    +
    +
      +
    • + {% if r.person.mobilenumber %} + {{ r.person.mobilenumber }} + {% else %} + + {% if r.person.phonenumber %} + {{ r.person.phonenumber }} + {% else %} + {{ 'No data given'|trans }} + {% endif %} + {% endif %} +
    • +
    • + + {%- if r.person.lastAddress is not empty -%} + {{ r.person.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }} + {%- else -%} + {{ 'No address given'|trans }} + {%- endif -%} +
    • +
    +
      +
    • + +
    • +
    +
    +
    -
    -
    -

    - {{ r.thirdParty.name }} - {{ 'Tiers' }} -

    -
    -
    - -
      -
    • - -
    • -
    -
    -
    + {% endif %} + {% if r.thirdParty %} - {% endif %} -
    - {% endfor %} -
    +
    +
    +

    + {{ r.thirdParty.name }} + {{ 'Tiers' }} +

    +
    +
    + +
      +
    • + +
    • +
    +
    +
    + + {% endif %} +
    + {% endfor %} +
    + {% endif %}

    {{ 'Social actions'|trans }}

    diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index f7deaf9eb..0ad70a15b 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -189,6 +189,7 @@ See accompanying period: Voir cette période d'accompagnement Referrer: Référent Some peoples does not belong to any household currently. Add them to an household soon: Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur appartenance à un ménage dès que possible. Add to household now: Ajouter à un ménage +Any resource for this accompanying course: Aucun interlocuteur privilégié pour ce parcours # pickAPersonType Pick a person: Choisir une personne From 0388428c6f325fc3b79e70998c68cf1fcab74250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 28 Jun 2021 23:48:06 +0200 Subject: [PATCH 2/4] fix missing div in accompanying course work list --- .../views/AccompanyingCourse/index.html.twig | 154 +++++++++--------- .../list_by_accompanying_period.html.twig | 2 +- .../translations/messages.fr.yml | 1 + 3 files changed, 81 insertions(+), 76 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index 608767d74..650bb1733 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -227,90 +227,94 @@

    {{ 'Social actions'|trans }}

    - {% for w in works %} -
    -
    -

    - {{ w.socialAction|chill_entity_render_box({ 'no-badge': false }) }} -

    -
    - -
    -
      -
    • -
      - {{ w.createdAt|format_date('long') }} -
      -
      - {{ 'accompanying_course_work.create_date'|trans }} -
      -
    • -
    • -
      - {{ w.startDate|format_date('long') }} -
      -
      - {{ 'accompanying_course_work.start_date'|trans }} -
      -
    • -
    • -
      - {{ w.endDate|format_date('long') }} -
      -
      - {{ 'accompanying_course_work.end_date'|trans }} -
      -
    • -
    -
    - - {% if w.results|length > 0 %} -
    -
    -

    {{ 'accompanying_course_work.goal'|trans }}

    -

    {{ 'accompanying_course_work.results without objective'|trans }}

    -
    -
    -

    {{ 'accompanying_course_work.results'|trans }}

    -
      - {% for r in w.results %} -
    • {{ r.title|localize_translatable_string }}
    • - {% endfor %} -
    -
    +
    + {% for w in works %} +
    +
    +

    + {{ w.socialAction|chill_entity_render_box({ 'no-badge': false }) }} +

    - {% endif %} - {% if w.goals|length > 0 %} - {% for g in w.goals %} -
    -
    +
    +
      +
    • +
      + {{ w.createdAt|format_date('long') }} +
      +
      + {{ 'accompanying_course_work.create_date'|trans }} +
      +
    • +
    • +
      + {{ w.startDate|format_date('long') }} +
      +
      + {{ 'accompanying_course_work.start_date'|trans }} +
      +
    • +
    • +
      + {{ w.endDate|format_date('long') }} +
      +
      + {{ 'accompanying_course_work.end_date'|trans }} +
      +
    • +
    +
    + + {% if w.results|length > 0 %} +
    +

    {{ 'accompanying_course_work.goal'|trans }}

    -

    {{ g.goal.title|localize_translatable_string }}

    +

    {{ 'accompanying_course_work.results without objective'|trans }}

    -
    - {% if g.results|length == 0 %} -

    {{ 'accompanying_course_work.results'|trans }}

    -

    {{ 'accompanying_course_work.no_results'|trans }}

    - {% else %} -

    {{ 'accompanying_course_work.results'|trans }}

    -
      - {% for r in g.results %} -
    • {{ r.title|localize_translatable_string }}
    • - {% endfor %} -
    - {% endif %} +
    +

    {{ 'accompanying_course_work.results'|trans }}

    +
      + {% for r in w.results %} +
    • {{ r.title|localize_translatable_string }}
    • + {% endfor %} +
    - {% endfor %} - {% endif %} + {% endif %} -
    - {{ 'Last updated by'|trans}}: {{ w.updatedBy|chill_entity_render_box }}, {{ w.updatedAt|format_datetime('long', 'short') }} -
    + {% if w.goals|length > 0 %} + {% for g in w.goals %} +
    +
    +

    {{ 'accompanying_course_work.goal'|trans }}

    +

    {{ g.goal.title|localize_translatable_string }}

    +
    +
    + {% if g.results|length == 0 %} +

    {{ 'accompanying_course_work.results'|trans }}

    +

    {{ 'accompanying_course_work.no_results'|trans }}

    + {% else %} +

    {{ 'accompanying_course_work.results'|trans }}

    +
      + {% for r in g.results %} +
    • {{ r.title|localize_translatable_string }}
    • + {% endfor %} +
    + {% endif %} +
    +
    + {% endfor %} + {% endif %} +
    + {{ 'Last updated by'|trans}}: {{ w.updatedBy|chill_entity_render_box }}, {{ w.updatedAt|format_datetime('long', 'short') }} +
    + +
    + {% else %} +

    {{ 'accompanying_course_work.Any work'|trans }}

    + {% endfor %}
    - {% endfor %} {% block contentActivity %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig index 28626f7c2..8dfe1bfd5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig @@ -102,7 +102,7 @@
    {% else %} -

    {{ 'accompanying_course_work.No work'|trans }}

    +

    {{ 'accompanying_course_work.Any work'|trans }}

    {% endfor %}
    diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index d0f976445..0442166c2 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -355,4 +355,5 @@ accompanying_course_work: no_results: Aucun résultat - orientation results: Résultats - orientations goal: Objectif - motif - dispositif + Any work: Aucune action d'accompagnement From 6154e0912b1f24821ba3ea1be85a46cc3368d128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 29 Jun 2021 00:03:24 +0200 Subject: [PATCH 3/4] fix in accompanying period list: thirdparty as requestor + link --- .../views/AccompanyingPeriod/list.html.twig | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig index bf3392f6d..c003aa518 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/list.html.twig @@ -69,7 +69,7 @@

    {{ accompanying_period.requestorPerson.firstname ~ ' ' ~ accompanying_period.requestorPerson.lastname }}

    {% endif %} {% if accompanying_period.requestorThirdParty is not null %} -

    {{ accompanying_period.requestorThirdParty.firstname ~ ' ' ~ accompanying_period.requestorThirdParty.lastname }}

    +

    {{ accompanying_period.requestorThirdParty.name }}

    {% endif %} {% else %} {{ 'No data given'|trans }} @@ -82,7 +82,7 @@
  • - + {#
  • @@ -100,6 +100,7 @@ {% endif %} + #}
    @@ -116,6 +117,12 @@ {{ 'Person details'|trans }} +
  • + + {{ 'Create an accompanying period'|trans }} + +
  • + {#
  • {{ 'Add an accompanying period in the past'|trans }} @@ -129,6 +136,7 @@
  • {% endif %} + #}
    From 55dc0d3f9f9b1ff846168d38f733d8b80f4a6d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 29 Jun 2021 16:57:28 +0200 Subject: [PATCH 4/4] Ajout informations manquantes dans la page "summary" des AccompanyingCourse --- .../Resources/public/index.js | 1 + .../accompanying_course_work_list/index.scss | 10 + .../public/sass/accompanying_period_work.scss | 6 + .../views/AccompanyingCourse/index.html.twig | 176 ++++++++++-------- .../list_by_accompanying_period.html.twig | 6 +- .../translations/messages.fr.yml | 2 + 6 files changed, 124 insertions(+), 77 deletions(-) create mode 100644 src/Bundle/ChillPersonBundle/Resources/public/sass/accompanying_period_work.scss diff --git a/src/Bundle/ChillPersonBundle/Resources/public/index.js b/src/Bundle/ChillPersonBundle/Resources/public/index.js index acdc04579..4a51d51d2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/index.js @@ -1,3 +1,4 @@ require('./sass/person.scss'); require('./sass/person_with_period.scss'); require('./sass/household_banner.scss'); +require('./sass/accompanying_period_work.scss'); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/modules/accompanying_course_work_list/index.scss b/src/Bundle/ChillPersonBundle/Resources/public/modules/accompanying_course_work_list/index.scss index 433f291b5..9b5da134d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/modules/accompanying_course_work_list/index.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/modules/accompanying_course_work_list/index.scss @@ -46,6 +46,15 @@ } } + &.short { + .item { + padding-bottom: 0; + ul.record_actions { + margin-bottom: 0; + } + } + } + .updatedBy { margin-top: 1rem; text-align: right; @@ -94,3 +103,4 @@ ul.timeline { } } } + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/sass/accompanying_period_work.scss b/src/Bundle/ChillPersonBundle/Resources/public/sass/accompanying_period_work.scss new file mode 100644 index 000000000..dfb885e7b --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/public/sass/accompanying_period_work.scss @@ -0,0 +1,6 @@ + +.chill-entity__social-action { + .badge-primary { + background-color: var(--chill-green); + } +} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index 650bb1733..99e5ed4f6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -122,6 +122,97 @@ {% endfor %} +

    {{ 'Requestor'|trans }}

    + + {% if accompanyingCourse.requestor == null %} +

    {{ 'Any requestor to this accompanying course'|trans }}

    + {% elseif accompanyingCourse.requestorPerson is not empty %} + {% set r = accompanyingCourse.requestorPerson %} +
    +
    +

    + {{ r.firstname ~ ' ' ~ r.lastname }} + {{ 'Usager' }} +

    +

    + {% set born = (r.gender == 'woman') ? 'née': 'né' %} + {% set gender = (r.gender == 'woman') ? 'fa-venus' : + (r.gender == 'man') ? 'fa-mars' : 'fa-neuter' %} + {% set genderTitle = (r.gender == 'woman') ? 'femme' : + (r.gender == 'homme') ? 'fa-mars' : 'neutre' %} + {{ born ~ ' le ' ~ r.birthdate|format_date('short') }} +

    +
    +
    +
      +
    • + {% if r.mobilenumber %} + {{ r.mobilenumber }} + {% else %} + + {% if r.phonenumber %} + {{ r.phonenumber }} + {% else %} + {{ 'No data given'|trans }} + {% endif %} + {% endif %} +
    • +
    • + + {%- if r.lastAddress is not empty -%} + {{ r.getLastAddress|chill_entity_render_box({'with_valid_from': false}) }} + {%- else -%} + {{ 'No address given'|trans }} + {%- endif -%} +
    • +
    +
      +
    • + +
    • +
    +
    +
    + + {% elseif accompanyingCourse.requestorThirdParty is not empty %} + {% set r = accompanyingCourse.requestorThirdParty %} +
    +
    +

    + {{ r.name }} + {{ 'Tiers' }} +

    +
    +
    + +
      +
    • + +
    • +
    +
    +
    + {% endif %}

    {{ 'Resources'|trans }}

    @@ -227,88 +318,25 @@

    {{ 'Social actions'|trans }}

    -
    +
    {% for w in works %}
    +

    {{ 'accompanying_course_work.action'|trans }}

    {{ w.socialAction|chill_entity_render_box({ 'no-badge': false }) }}

    -
    -
      -
    • -
      - {{ w.createdAt|format_date('long') }} -
      -
      - {{ 'accompanying_course_work.create_date'|trans }} -
      -
    • -
    • -
      - {{ w.startDate|format_date('long') }} -
      -
      - {{ 'accompanying_course_work.start_date'|trans }} -
      -
    • -
    • -
      - {{ w.endDate|format_date('long') }} -
      -
      - {{ 'accompanying_course_work.end_date'|trans }} -
      -
    • -
    -
    - - {% if w.results|length > 0 %} -
    -
    -

    {{ 'accompanying_course_work.goal'|trans }}

    -

    {{ 'accompanying_course_work.results without objective'|trans }}

    -
    -
    -

    {{ 'accompanying_course_work.results'|trans }}

    -
      - {% for r in w.results %} -
    • {{ r.title|localize_translatable_string }}
    • - {% endfor %} -
    -
    -
    - {% endif %} - - {% if w.goals|length > 0 %} - {% for g in w.goals %} -
    -
    -

    {{ 'accompanying_course_work.goal'|trans }}

    -

    {{ g.goal.title|localize_translatable_string }}

    -
    -
    - {% if g.results|length == 0 %} -

    {{ 'accompanying_course_work.results'|trans }}

    -

    {{ 'accompanying_course_work.no_results'|trans }}

    - {% else %} -

    {{ 'accompanying_course_work.results'|trans }}

    -
      - {% for r in g.results %} -
    • {{ r.title|localize_translatable_string }}
    • - {% endfor %} -
    - {% endif %} -
    -
    - {% endfor %} - {% endif %} - -
    - {{ 'Last updated by'|trans}}: {{ w.updatedBy|chill_entity_render_box }}, {{ w.updatedAt|format_datetime('long', 'short') }} -
    +
    + +
    {% else %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig index 8dfe1bfd5..b12f3c932 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_by_accompanying_period.html.twig @@ -12,7 +12,7 @@

    {{ 'accompanying_course_work.action'|trans }}

    - {{ w.socialAction|chill_entity_render_box({ 'no-badge': true }) }} + {{ w.socialAction|chill_entity_render_box }}

    @@ -67,7 +67,7 @@

    {{ 'accompanying_course_work.goal'|trans }}

    -

    {{ g.goal.title|localize_translatable_string }}

    +

    {{ g.goal.title|localize_translatable_string }}

    {% if g.results|length == 0 %} @@ -96,7 +96,7 @@
  • {{ 'Update'|trans }} + href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) }}">{{ 'Edit'|trans }}
  • diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 0442166c2..3f5180ad5 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -181,6 +181,8 @@ Create an accompanying course: Créer un parcours This accompanying course is still a draft: Ce parcours est à l'état brouillon Associated peoples: Usagers concernés Resources: Interlocuteurs privilégiés +Requestor: Demandeur +Any requestor to this accompanying course: Aucun demandeur pour ce parcours Social actions: Actions d'accompagnement Social issues: Problématiques sociales Last events on accompanying course: Dernières actions de suivi