From 5089bba4d7cb6c820f50a933b1776d1458889000 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 29 Dec 2021 12:11:20 +0100 Subject: [PATCH] improve masonry bloc style --- .../Resources/public/chill/chillperson.scss | 16 ++ .../views/AccompanyingCourse/index.html.twig | 167 ++++++++++-------- 2 files changed, 109 insertions(+), 74 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss index f39f64eb2..9680f116a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss +++ b/src/Bundle/ChillPersonBundle/Resources/public/chill/chillperson.scss @@ -254,3 +254,19 @@ abbr.referrer { // still used ? border: 1px solid black; padding: 10px; } + +/// Masonry blocs on AccompanyingCourse resume page +div#dashboards { + div.mbloc { + & > div:not(.warnings) { + border: 1px solid $chill-light-gray; + padding: 1rem; + } + & > div.warnings .alert { + margin-bottom: 0; + } + blockquote.chill-user-quote { + margin: -1.2em; + } + } +} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index 39e924d18..cf05ccdf9 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -19,104 +19,123 @@ {% endblock %} {% block content %} -
+
-
- {% if 'DRAFT' == accompanyingCourse.step %} -
- {% include '@ChillPerson/AccompanyingCourse/_still_draft.html.twig' %} +
+ +
+
+ {% include '@ChillPerson/AccompanyingCourse/_still_draft.html.twig' %} +
+ {% if 'DRAFT' == accompanyingCourse.step %} {% endif %} +
+
+ {% include '@ChillPerson/AccompanyingCourse/_join_household.html.twig' %} +
+
{% if 'DRAFT' != accompanyingCourse.step %} {% if withoutHousehold|length > 0 %} -
- {% include '@ChillPerson/AccompanyingCourse/_join_household.html.twig' %} -
{% endif %} {% endif %} +
+
+ {% include '@ChillPerson/AccompanyingCourse/_warning_address.html.twig' %} +
+
{% if accompanyingCourse.locationStatus == 'address' or accompanyingCourse.locationStatus == 'none' %} -
- {% include '@ChillPerson/AccompanyingCourse/_warning_address.html.twig' %} -
{% endif %} -
- {% 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 == '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 %} + {% if accompanyingCourse.locationStatus != 'none' %} + {{ accompanyingCourse.location|chill_entity_render_box }} + {% endif %} +
{% if accompanyingCourse.participations is not empty %} -
-

{{ 'Persons associated'|trans }}

- {% for r in accompanyingCourse.participations %} - {{ _self.insert_onthefly('person', r.person) }} - {% endfor %} -
- {% endif %} - - {% if accompanyingCourse.resources is not empty %} -
-

{{ 'Resources'|trans }}

- {% for r in accompanyingCourse.resources %} - {% if r.person is not null %} +
+
+

{{ 'Persons associated'|trans }}

+ {% for r in accompanyingCourse.participations %} {{ _self.insert_onthefly('person', r.person) }} - {% elseif r.thirdParty is not null %} - {{ _self.insert_onthefly('thirdparty', r.thirdParty) }} - {% endif %} - {% endfor %} -
- {% endif %} - - {% if accompanyingCourse.pinnedComment is not empty %} -
-

{{ 'Pinned comment'|trans }}

-
- {{ accompanyingCourse.pinnedComment.content }} - -
-
- {% endif %} - - {% if accompanyingCourse.scopes is not empty %} -
-

{{ 'Scopes'|trans }}

-
- {% for s in accompanyingCourse.scopes %} - {{ s.name|localize_translatable_string|capitalize }}{% if not loop.last %}, {% endif %} {% endfor %}
{% endif %} + {% if accompanyingCourse.resources is not empty %} +
+
+

{{ 'Resources'|trans }}

+ {% for r in accompanyingCourse.resources %} + {% if r.person is not null %} + {{ _self.insert_onthefly('person', r.person) }} + {% elseif r.thirdParty is not null %} + {{ _self.insert_onthefly('thirdparty', r.thirdParty) }} + {% endif %} + {% endfor %} +
+
+ {% endif %} + + {% if accompanyingCourse.pinnedComment is not empty %} +
+
+

{{ 'Pinned comment'|trans }}

+
+ {{ accompanyingCourse.pinnedComment.content|chill_markdown_to_html }} + +
+
+
+ {% endif %} + + {% if accompanyingCourse.scopes is not empty %} +
+
+

{{ 'Scopes'|trans }}

+
+ {% for s in accompanyingCourse.scopes %} + {{ s.name|localize_translatable_string|capitalize }}{% if not loop.last %}, {% endif %} + {% endfor %} +
+
+
+ {% endif %} + {% if accompanyingCourse.requestorPerson is not null or accompanyingCourse.requestorThirdParty is not null %} -
- {% if accompanyingCourse.requestorPerson is not null %} -

{{ 'Requestor'|trans }}

- {{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }} - {% elseif accompanyingCourse.requestorThirdParty is not null %} -

{{ 'Requestor'|trans }}

- {{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }} - {% endif %} +
+
+ {% if accompanyingCourse.requestorPerson is not null %} +

{{ 'Requestor'|trans }}

+ {{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }} + {% elseif accompanyingCourse.requestorThirdParty is not null %} +

{{ 'Requestor'|trans }}

+ {{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }} + {% endif %} +
{% endif %}