From 3a07fa4faf8f04868df5cde8c29d1f97e601d1c8 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 4 Oct 2021 17:22:08 +0200 Subject: [PATCH] resume short list style abstraction for accourse-work and activities (wip) --- .../Resources/public/chill/chillactivity.scss | 32 ++++++- .../Resources/views/Activity/list.html.twig | 12 +-- .../views/Activity/recent_list.html.twig | 46 +++++++++ .../Resources/views/Activity/show.html.twig | 2 +- .../Resources/public/chill/chillperson.scss | 2 + .../chill/scss/accompanying_period_work.scss | 56 +++++++---- .../Resources/public/chill/scss/mixins.scss | 4 +- .../views/AccompanyingCourse/index.html.twig | 96 +------------------ .../AccompanyingCourseWork/index.html.twig | 2 +- .../list_by_accompanying_period.html.twig | 4 +- ...cent_list_by_accompanying_period.html.twig | 32 +++++++ 11 files changed, 160 insertions(+), 128 deletions(-) create mode 100644 src/Bundle/ChillActivityBundle/Resources/views/Activity/recent_list.html.twig create mode 100644 src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/recent_list_by_accompanying_period.html.twig diff --git a/src/Bundle/ChillActivityBundle/Resources/public/chill/chillactivity.scss b/src/Bundle/ChillActivityBundle/Resources/public/chill/chillactivity.scss index 528d75ded..b2e36b2bf 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/chill/chillactivity.scss +++ b/src/Bundle/ChillActivityBundle/Resources/public/chill/chillactivity.scss @@ -21,9 +21,9 @@ div.new-activity-select-type { } } -// exceptions for flex-table in list-records +// exceptions for flex-table div.activity-list { - div.flex-table { + &.flex-table { div.item-bloc { div.item-row.main { div.item-col { @@ -86,7 +86,6 @@ div.activity-list { } } } - } ul.list-content { list-style-type: none; @@ -103,6 +102,32 @@ div.activity-list { margin-top: 1em; } } + + /// Activities on resume page + h2.badge-title { + span.title_label { + background-color: #668821; + div.duration { + font-size: 70%; + font-weight: 500; + p { + margin-bottom: 0; + text-align: right; + } + } + } + span.title_action { + //text-transform: capitalize !important; + font-weight: 500 !important; + border-left: 20px groove yellowgreen; + &:before { + content: '\f04b'; + font-family: ForkAwesome; + color: yellowgreen; + margin: 0 0 0 -1.05em; + } + } + } } // exceptions for flex-bloc in concerned-groups @@ -130,7 +155,6 @@ div.flex-bloc.concerned-groups { } } - /// CHILL ENTITY RENDER BOX .chill-entity { diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig index c227f5539..0e661c224 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list.html.twig @@ -1,4 +1,4 @@ -
+
{% if activities|length == 0 %}

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

{% else %} -
+
{% for activity in activities %} {% set t = activity.type %}
@@ -102,12 +102,8 @@
  • - {{ 'location'|trans ~ ': ' }} - Domicile de l'usager - - {# TODO {% if activity.location %}{{ activity.location }}{% endif %} - #} - + {{ 'location'|trans ~ ': ' }} Domicile de l'usager + {# TODO {% if activity.location %}{{ activity.location }}{% endif %} #}
  • {%- if t.reasonsVisible -%} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/recent_list.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/recent_list.html.twig new file mode 100644 index 000000000..f62271bb5 --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/recent_list.html.twig @@ -0,0 +1,46 @@ +
    + {% for activity in activities | slice(0,5) %} + {% set t = activity.type %} + + + +

    + + {% if activity.date %} +

    {{ activity.date|format_date('short') }}

    + {% endif %} +
    + {% if activity.durationTime and t.durationTimeVisible %} +

    + + {{ activity.durationTime|date('H:i') }} +

    + {% endif %} + {% if activity.travelTime and t.travelTimeVisible %} +

    + + {{ activity.travelTime|date('H:i') }} +

    + {% endif %} +
    +
    + + {{ activity.type.name | localize_translatable_string }} +
      +
    • + {{ 'location'|trans ~ ': ' }} + {# TODO {% if activity.location %}{{ activity.location }}{% endif %} #} + Domicile de l'usager +
    • + {% if activity.user and t.userVisible %} +
    • + {{ 'Referrer'|trans ~ ': ' }} + {{ activity.user.usernameCanonical }} +
    • + {% endif %} +
    +
    +

    + + {% endfor %} +
    diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index 1f54692d9..eba074e07 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -73,7 +73,7 @@ {% endif %} {% if t.travelTimeVisible %} -
    {{ 'Travel Time'|trans }}
    +
    {{ 'Travel time'|trans }}
    {% if entity.travelTime is not null %} {{ entity.travelTime|date('H:i') }} {% else %} diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss index 094a2eb0a..2b389239e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss @@ -248,8 +248,10 @@ span.fa-holder { } } +/// div.accompanyingcourse-resume { div.associated-persons { + font-size: 110%; span.household { display: inline-block; border-radius: 8px; diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/accompanying_period_work.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/accompanying_period_work.scss index e4d84a7a4..95138bb0b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/accompanying_period_work.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/accompanying_period_work.scss @@ -1,28 +1,49 @@ +/// Display Title like a badge (with background-colored label) +h2.badge-title { + display: flex; + flex-direction: row; + width: 100%; + color: $dark; + + a & { + text-decoration: none; + } + + span.title_label { + border-radius: 0.35rem 0 0 0.35rem; + color: $white; + font-size: 80%; + padding: 0.5em; + padding-right: 0; + } + span.title_action { + flex-grow: 1; + margin: 0 0 0 auto; + border-radius: 0 0.35rem 0.35rem 0; + background-color: $light; + padding: 0.2em 1em; + + ul.small_in_title { + margin-top: 0.5em; + font-size: 70%; + padding-left: 1rem; + } + } +} + + /// AccompanyingCourse Work list Page div.accompanying_course_work-list { - h2.title { - display: flex; - flex-direction: row; - width: 100%; - color: $dark; - //height: 40px; - + h2.badge-title { span.title_label { - border-radius: 0.35rem 0 0 0.35rem; background-color: $social-action-label-color; - color: $white; - font-size: 80%; - padding: 0.5em; - padding-right: 0; } span.title_action { - flex-grow: 1; - margin: 0 0 0 auto; - border-radius: 0 0.35rem 0.35rem 0; - background-color: $light; - padding: 0.2em 0.7em; @include badge_social_action; + &:before { + margin: 0 0.3em 0 -1.05em !important; + } } } @@ -140,4 +161,3 @@ div.accompanying_course_work-list { } } - diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/mixins.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/mixins.scss index 4ff1d72bc..517530197 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/mixins.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/scss/mixins.scss @@ -15,7 +15,7 @@ $social-action-label-color: shade-color($orange, 34%); /// @mixin badge_social_issue { - text-transform: capitalize !important; + //text-transform: capitalize !important; font-weight: 500 !important; border-left: 20px groove $social-issue-color; &:before { @@ -32,7 +32,7 @@ $social-action-label-color: shade-color($orange, 34%); /// @mixin badge_social_action { - text-transform: capitalize !important; + //text-transform: capitalize !important; font-weight: 500 !important; border-left: 20px groove $social-action-color; &:before { diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index 55a9505f9..52d648091 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -71,7 +71,7 @@
    {% if accompanyingCourse.locationStatus == 'person' %} -
    {{ 'This course is located by'|trans }}
    +

    {{ 'This course is located by'|trans }}

    {{ accompanyingCourse.personLocation|chill_entity_render_string }}

    {% elseif accompanyingCourse.locationStatus == 'address' %}

    {{ 'This course has a temporarily location'|trans }}

    @@ -82,97 +82,9 @@ {% endif %}
    - - {# DISABLED -

    {{ 'Resume Accompanying Course'|trans }}

    - -
    -

    {{ 'Associated peoples'|trans }}

    -
    - {% for participation in accompanyingCourse.participations %} - {% if participation.enddate is null %} -
    - {{ participation.person|chill_entity_render_box({ - 'render': 'bloc', 'addLink': false, 'addInfo': true, 'addAltNames': false, - 'customButtons': { 'before': _self.button_person(participation.person) } - }) }} -
    - {% endif %} - {% endfor %} -
    -
    - -
    -

    {{ 'Accompanying course location'|trans }}

    - - {% if accompanyingCourse.locationStatus == 'person' %} -

    {{ 'This course is located by'|trans }} - {{ accompanyingCourse.personLocation|chill_entity_render_string }} -

    - {% elseif accompanyingCourse.locationStatus == 'address' %} -

    {{ 'This course has a temporarily location'|trans }}

    - {% endif %} - - {% if accompanyingCourse.locationStatus != 'none' %} -
    -
    - {{ accompanyingCourse.location|chill_entity_render_box }} -
    -
    - {% endif %} -
    - -
    -

    {{ 'Requestor'|trans }}

    - {% if accompanyingCourse.requestorPerson is not empty %} - {% set requestor = accompanyingCourse.requestorPerson %} - {% set info = true %} - {% elseif accompanyingCourse.requestor is not empty %} - {% set requestor = accompanyingCourse.requestorThirdParty %} - {% set info = false %} - {% endif %} - {% if accompanyingCourse.requestor == null %} -

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

    - {% else %} -
    -
    - {{ requestor|chill_entity_render_box({ - 'render': 'bloc', 'addLink': false, 'addEntity': true, 'addInfo': info, 'addAltNames': false - }) }} -
    -
    - {% endif %} -
    - -
    -

    {{ 'Resources'|trans }}

    - {% if accompanyingCourse.resources|length == 0 %} -

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

    - {% else %} -
    - {% for r in accompanyingCourse.resources %} -
    - {% if r.person %} - {{ r.person|chill_entity_render_box({ - 'render': 'bloc', 'addLink': false, 'addEntity': true, 'addInfo': true, 'addAltNames': false - }) }} - {% endif %} - {% if r.thirdParty %} - {{ r.thirdParty|chill_entity_render_box({ - 'render': 'bloc', 'addLink': false, 'addEntity': true, 'addInfo': false - }) }} - {% endif %} -
    - {% endfor %} -
    - {% endif %} -
    - #} -
    - {% block contentActivity %} @@ -189,9 +101,9 @@ {% set accompanying_course_id = accompanyingCourse.id %} {% endif %} -

    {{ 'Activity list' |trans }}

    +

    {{ 'Activity list' |trans }}

    - {% include 'ChillActivityBundle:Activity:list.html.twig' with { 'context': 'accompanyingCourse', 'no_action': true } %} + {% include 'ChillActivityBundle:Activity:recent_list.html.twig' with { 'context': 'accompanyingCourse', 'no_action': true } %}
    {% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig index ddeea92e9..92b1919af 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig @@ -7,7 +7,7 @@

    {{ block('title') }}

    - {% include 'ChillPersonBundle:AccompanyingCourseWork:list_by_accompanying_period.html.twig' with {'render': 'list'} %} + {% include 'ChillPersonBundle:AccompanyingCourseWork:list_by_accompanying_period.html.twig' %}
    • 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 01b7c9b2b..f0f0a051e 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 @@ -5,12 +5,12 @@

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

      +

      {{ 'accompanying_course_work.action'|trans }} {{ w.socialAction|chill_entity_render_string }}

      diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/recent_list_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/recent_list_by_accompanying_period.html.twig new file mode 100644 index 000000000..61f48aa76 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/recent_list_by_accompanying_period.html.twig @@ -0,0 +1,32 @@ + {% if works|length == 0 %} +

      {{ 'accompanying_course_work.Any work'|trans }} + {# TODO link #} +

      + {% endif %} + +
      + {% for w in works | slice(0,5) %} + + +

      + {{ 'accompanying_course_work.action'|trans }} + {{ w.socialAction|chill_entity_render_string }} + +
        +
      • + {{ 'accompanying_course_work.start_date'|trans ~ ' : ' }} + {{ w.startDate|format_date('short') }} +
      • +
      • + {{ 'Last updated by'|trans ~ ' : ' }} + {{ w.updatedBy|chill_entity_render_box }}, {{ w.updatedAt|format_datetime('short', 'short') }} +
      • +
      + +
      +

      + {% endfor %} +
      + +