diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index a3203d806..53bd3e8a7 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -172,7 +172,7 @@ {% endfor %} {% else %} - {{ 'Any document found'|trans }} + {{ 'No document found'|trans }} {% endif %} {% endif %} diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro.html.twig index 886544b1e..0e739d94b 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro.html.twig @@ -13,3 +13,19 @@ {{ 'Download'|trans }} {% endif %} {% endmacro %} + +{% macro download_button_small(storedObject, filename = null) %} + {% if storedObject is null %} + + {% else %} + + {{ 'Download'|trans }} + {% endif %} +{% endmacro %} \ No newline at end of file diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro_mimeicon.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro_mimeicon.html.twig index a9bc07e2f..7079a0d94 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro_mimeicon.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro_mimeicon.html.twig @@ -48,8 +48,8 @@ {% endif %} {% endfor %} -
+ {{ label|capitalize }} -
+ {% endmacro %} \ No newline at end of file diff --git a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml index 17326b299..3dda25797 100644 --- a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml @@ -14,7 +14,7 @@ Edit attributes: Modifier les propriétés du document Existing document: Document existant No document to download: Aucun document à télécharger 'Choose a document category': Choisissez une catégorie de document -Any document found: Aucun document trouvé +No document found: Aucun document trouvé The document is successfully registered: Le document est enregistré The document is successfully updated: Le document est mis à jour Any description: Aucune description diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index f9a90c286..04b1da942 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -302,12 +302,12 @@ table.table-bordered { /// meta-data div.createdBy, div.updatedBy, -div.metadata { +.metadata { span.user, span.date { text-decoration: underline dotted; } } -div.metadata { +.metadata { font-size: smaller; color: $gray-600; span.user, span.date { diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss index 4d0bfcf8e..19da5aed3 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss @@ -106,18 +106,5 @@ section.chill-entity { // used for comment-embeddable &.entity-comment-embeddable { width: 100%; - - /* already defined !! - div.metadata { - font-size: smaller; - color: $gray-600; - span.user, span.date { - text-decoration: underline dotted; - &:hover { - color: $gray-700; - } - } - } - */ } } diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_attachment.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_attachment.html.twig index 299ae4660..24cf3cab4 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_attachment.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_attachment.html.twig @@ -1,4 +1,7 @@ -{# TODO Adapt condition #} +{# TODO + Check if this template is used + Adapt condition or Delete it +#} {% if random(1) == 0 %} {# For a document #} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 37672d449..a1e2b435e 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -62,6 +62,7 @@ Centers: Centres center: centre comment: commentaire Comment: Commentaire +Comments: Commentaires Pinned comment: Commentaire épinglé Any comment: Aucun commentaire Read more: Lire la suite 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 34452645d..eeb2eb2be 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 @@ -5,9 +5,12 @@ div.accompanying-course-work { border-collapse: collapse; border-radius: 5px; width: 100%; + margin-top: 1em; + margin-bottom: 1em; &, tr, th, td { border: 1px solid lightgray; padding: 0.3em; + background-color: $white; } th { h4.title_label { @@ -26,6 +29,11 @@ div.accompanying-course-work { } td.eval { width: 100%; + div.download { + .row > * { + transform: scale(0.85); + } + } } } @@ -47,10 +55,32 @@ div.accompanying-course-work { } } + div.item-bloc { + &.short {} + &.long {} + &.uniq {} + &.extended { + table.obj-res-eval { + margin-top: 0; + &:last-child { + margin-bottom: 0; + } + } + } + &.colored { + background-color: $chill-llight-gray; + } + } + } -div.flex-table div.item-bloc:nth-child(2n) table.obj-res-eval { - &, tr, th, td { - background-color: $chill-llight-gray; +/// item-bloc with background-color altern: even case +div.flex-table div.item-bloc:nth-child(2n) { + + // set table background + table.obj-res-eval { + &, tr, th, td { + background-color: $chill-llight-gray; + } } } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index 868b3c410..579487824 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -1,4 +1,10 @@ -
+{# +# OPTIONS +# - itemBlocClass: [uniq|colored|extended] +# - displayContent: [short|long] default: short +# - displayAction: [true|false] default: false +#} +

@@ -15,6 +21,13 @@ {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} {{ w.endDate|format_date('short') }} + {% else %} + {% if displayContent is defined and displayContent == 'long' %} +
  • + {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} + {{ 'Not given'|trans }} +
  • + {% endif %} {% endif %} @@ -25,7 +38,7 @@
    - {%- if w.persons -%} + {%- if w.persons -%}{# Usagers du parcours #}

    {{ 'Persons in accompanying course'|trans }}

    @@ -45,7 +58,7 @@
    {% endif %} - {%- if w.handlingThierParty -%} + {%- if w.handlingThierParty -%}{# Tiers traitant #}

    {{ 'Thirdparty handling'|trans }}

    @@ -62,23 +75,25 @@
    {% endif %} - {%- if w.referrers -%} -
    -
    -

    {{ 'Referrers'|trans }}

    -
    -
    +
    {# Agents traitants #} +
    +

    {%- if w.referrers|length > 1 -%}{{ 'Referrers'|trans }}{% else %}{{ 'Referrer2'|trans }}{% endif %}

    +
    +
    + {%- if w.referrers|length > 0 -%} {% for u in w.referrers %} {{ u|chill_entity_render_box }} {% if not loop.last %}, {% endif %} {% endfor %} -
    + {% else %} + {{ 'No referrer'|trans }} + {% endif %}
    - {% endif %} +
    - {%- if w.socialAction.issue -%} + {%- if w.socialAction.issue -%}{# Problématique sociale #}

    {{ 'Social issue'|trans }}

    @@ -93,62 +108,96 @@
    - -
    - {% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' %} -
    - -
    -
    - {% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) %} - {% if notif_counter.total > 0 %} - {{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) }} - {% endif %} - - {% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %} - {{ macro.updatedBy(w) }} + + {% if displayContent is not defined or displayContent == 'short' %} +
    + {% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with { + 'displayContent': displayContent + } %}
    - - {% if displayAction is defined and displayAction == true %} -
      - {% set suppEvaluations = [] %} - {% for e in w.accompanyingPeriodWorkEvaluations %} - {% set suppEvaluations = suppEvaluations|merge([ - {'relatedEntityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation', 'relatedEntityId': e.id } - ]) %} - - {% for d in e.documents %} - {% set suppEvaluations = suppEvaluations|merge([ - {'relatedEntityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', 'relatedEntityId': d.id } - ]) %} - {% endfor %} - {% endfor %} -
    • - {{ chill_entity_workflow_list( - 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', - w.id, [], suppEvaluations) }} -
    • -
    • - -
    • - {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w) %} + {% endif %} + + {% if displayContent is not defined or displayContent == 'short' %} +
      + + {% import '@ChillPerson/AccompanyingCourseWork/_macros.html.twig' as macro %} + +
      + {{ macro.metadata(w) }} +
      + + {% if displayAction is defined and displayAction == true %} +
        +
      • {{ macro.workflowButton(w) }}
      • -
      • + {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w) %} +
      • + +
      • + {% endif %} + {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_DELETE', w) %} +
      • + +
      • + {% endif %} +
      {% endif %} - {% if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_DELETE', w) %} -
    • - -
    • - {% endif %} -
    - {% endif %} -
    +
    + {% endif %}
    + +{# + # This is for 'long' version of content + # Note: this include is wrapped in a flex-table container. + # We start by closing the flex-table so we can add more. + # At the end we leave the last flex-table open, as it will be closed in the container. +#} +{% if displayContent is defined and displayContent == 'long' %} +
    + + {% if w.results|length > 0 or w.goals|length > 0 or w.accompanyingPeriodWorkEvaluations|length > 0 %} +

    {{ 'Dispositifs' }}

    + +
    {# new flex-table wrapper #} +
    + {% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with { + 'displayContent': displayContent + } %} +
    +
    + {% endif %} + +

    {{ 'Comments'|trans }}

    + +
    +
    +

    Public

    + {% if w.note is not empty %} +
    + {{ w.note|chill_entity_render_box({'metadata': true }) }} +
    + {% else %} + {{ 'No comment associated'|trans }} + {% endif %} +
    + {% set userId = app.user.id %} + {% if w.privateComment.comments|length > 0 and w.privateComment.comments[userId] %} +
    +

    Privé

    +
    + {{ w.privateComment.comments[userId]|chill_markdown_to_html }} +
    +
    + {% endif %} + {# Here flex-table stay open ! read above #} + +{% endif %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_macros.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_macros.html.twig new file mode 100644 index 000000000..10a0f94c7 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_macros.html.twig @@ -0,0 +1,23 @@ +{% macro metadata(w) %} + {% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) %} + {% if notif_counter.total > 0 %} + {{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) }} + {% endif %} + {% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %} + {{ macro.updatedBy(w) }} +{% endmacro %} + +{% macro workflowButton(w) %} + {% set suppEvaluations = [] %} + {% for e in w.accompanyingPeriodWorkEvaluations %} + {% set suppEvaluations = suppEvaluations|merge([ + {'relatedEntityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation', 'relatedEntityId': e.id } + ]) %} + {% for d in e.documents %} + {% set suppEvaluations = suppEvaluations|merge([ + {'relatedEntityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', 'relatedEntityId': d.id } + ]) %} + {% endfor %} + {% endfor %} + {{ chill_entity_workflow_list('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id, [], suppEvaluations) }} +{% endmacro %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig index ffa5da9ca..800d39935 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig @@ -1,6 +1,9 @@ - +{# +# OPTIONS +# - displayContent: [short|long] default: short +#} {% if w.results|length > 0 %} - +
    @@ -23,7 +26,7 @@ {% endif %} {% if w.goals|length > 0 %} -

    {{ 'accompanying_course_work.goal'|trans }}

    {{ 'accompanying_course_work.results'|trans }}

    +
    @@ -54,7 +57,7 @@ {% endif %} {% if w.accompanyingPeriodWorkEvaluations|length > 0 %} -

    {{ 'accompanying_course_work.goal'|trans }}

    {{ 'accompanying_course_work.results'|trans }}

    +
    {% endfor %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig index 418870c25..b12466e18 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig @@ -22,7 +22,11 @@ {% else %}
    {% for w in works %} - {% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with { 'displayAction': true } %} + {% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with { + 'displayAction': true, + 'displayContent': 'short', + 'itemBlocClass': '' + } %} {% endfor %}
    {% endif %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig index a20d13199..9e47b61d1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/show.html.twig @@ -1,15 +1,56 @@ {% extends '@ChillPerson/AccompanyingCourse/layout.html.twig' %} +{% import '@ChillPerson/AccompanyingCourseWork/_macros.html.twig' as macro %} + {% block title 'accompanying_course_work.Show accompanying course work'|trans %} {% block css %} {{ parent() }} + {{ encore_entry_link_tags('mod_async_upload') }} + {{ encore_entry_link_tags('mod_entity_workflow_pick') }} +{% endblock %} + +{% block js %} + {{ parent() }} + {{ encore_entry_script_tags('mod_async_upload') }} + {{ encore_entry_script_tags('mod_entity_workflow_pick') }} {% endblock %} {% block content %}

    {{ block('title') }}

    - {{ dump() }} + +
    + {% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with { + 'w': work, + 'displayAction': false, + 'displayContent': 'long', + 'itemBlocClass': 'uniq extended', + } %} +
    {{ macro.metadata(work) }}
    +
    + +
    {% endblock %} @@ -17,7 +58,3 @@ {% block block_post_menu %}
    {% endblock %} - -{% block js %} - {{ parent() }} -{% endblock %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.html.twig index 1e7d47511..18ea9d521 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Workflow/_accompanying_period_work.html.twig @@ -1,7 +1,9 @@
    {% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with { 'w': work, - 'itemBlocClass': 'bg-chill-llight-gray' + 'displayAction': false, + 'displayContent': 'short', + 'itemBlocClass': 'uniq colored' } %}
    diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 1e98ef35e..765c5a938 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -232,6 +232,8 @@ No resources: "Pas d'interlocuteurs privilégiés" Persons associated: Personnes concernés Referrer: Référent Referrers: Agents traitants +Referrer2: Agent traitant +No referrer: Pas d'agent traitant 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 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

    {{ 'accompanying_course_work.evaluations'|trans }}

    @@ -72,28 +75,82 @@ {{ 'accompanying_course_work.start_date'|trans ~ ' : ' }} {{ e.startDate|format_date('short') }} + {% if e.endDate %}
  • {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} {{ e.endDate|format_date('short') }}
  • + {% else %} + {% if displayContent is defined and displayContent == 'long' %} +
  • + {{ 'accompanying_course_work.end_date'|trans ~ ' : ' }} + {{ 'Not given'|trans }} +
  • + {% endif %} {% endif %} + {% if e.maxDate %}
  • {{ 'accompanying_course_work.max_date'|trans ~ ' : ' }} {{ e.maxDate|format_date('short') }}
  • + {% else %} + {% if displayContent is defined and displayContent == 'long' %} +
  • + {{ 'accompanying_course_work.max_date'|trans ~ ' : ' }} + {{ 'Not given'|trans }} +
  • + {% endif %} {% endif %} + {% if e.warningInterval and e.warningInterval.d > 0 %}
  • {% set days = (e.warningInterval.d + e.warningInterval.m * 30) %} {{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }} {{ 'accompanying_course_work.%days% days before max_date'|trans({'%days%': days }) }}
  • + {% else %} + {% if displayContent is defined and displayContent == 'long' %} +
  • + {{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }} + {{ 'Not given'|trans }} +
  • + {% endif %} {% endif %} + {% if displayContent is defined and displayContent == 'long' %} + +
    {{ e.comment|chill_entity_render_box }}
    + + {% import "@ChillDocStore/Macro/macro.html.twig" as m %} + {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} + +
    + {% if e.documents|length > 0 %} + + {% for d in e.documents %} +
    +
    + {{ d.title }} +
    +
    + {{ mm.mimeIcon(d.storedObject.type) }} +
    +
    + {{ m.download_button_small(d.storedObject, d.title) }} +
    +
    + {% endfor %} + + {% else %} + {{ 'No document found'|trans }} + {% endif %} +
    + + {% endif %}