reorganise flex-table assets, improve search results, and accompanyingPeriods list

This commit is contained in:
Mathieu Jaumotte 2021-08-20 16:19:15 +02:00
parent 38dcca7397
commit d2b0b9d7da
16 changed files with 194 additions and 87 deletions

View File

@ -17,8 +17,8 @@ $chill-theme-buttons: (
"update": $chill-orange, "update": $chill-orange,
"show": $chill-blue, "show": $chill-blue,
"view": $chill-blue, "view": $chill-blue,
"misc": $chill-light-gray, "misc": $gray-300,
"cancel": $chill-light-gray, "cancel": $gray-300,
); );
@each $button, $color in $chill-theme-buttons { @each $button, $color in $chill-theme-buttons {
@ -74,17 +74,17 @@ $chill-theme-buttons: (
} }
&[class*='btn-']:empty { &[class*='btn-']:empty {
&::before { &::before {
margin-right: 0; margin-right: 0;
} }
} }
} }
.btn { .btn {
&.btn-new::before, &.btn-new::before,
&.btn-create::before { content: "\f067"; } // fa-plus &.btn-create::before { content: "\f067"; } // fa-plus
&.btn-edit::before, &.btn-edit::before,
&.btn-update::before { content: "\f040"; } // fa-pencil &.btn-update::before { content: "\f040"; } // fa-pencil
&.btn-show::before, &.btn-show::before,
&.btn-view::before { content: "\f06e"; } // fa-eye &.btn-view::before { content: "\f06e"; } // fa-eye
&.btn-save::before { content: "\f0c7"; } // fa-floppy-o &.btn-save::before { content: "\f0c7"; } // fa-floppy-o
&.btn-duplicate::before { content: "\f24d"; } // fa-clone // f0c5 fa-files-o &.btn-duplicate::before { content: "\f24d"; } // fa-clone // f0c5 fa-files-o

View File

@ -59,11 +59,6 @@ div.flex-bloc {
flex-direction: column; flex-direction: column;
div.item-col { div.item-col {
&.separator {
margin-top: 0.5em;
border-top: 1px dotted $gray-900;
padding-top: 0.5em;
}
&:first-child { &:first-child {
flex-grow: 0; flex-shrink: 0; flex-basis: auto; flex-grow: 0; flex-shrink: 0; flex-basis: auto;
@ -71,15 +66,10 @@ div.flex-bloc {
&:last-child { &:last-child {
flex-grow: 1; flex-shrink: 1; flex-basis: auto; flex-grow: 1; flex-shrink: 1; flex-basis: auto;
@include separator;
ul.record_actions { ul.record_actions {
align-self: flex-end; align-self: flex-end;
flex-grow: 1; flex-shrink: 0; flex-basis: auto;
margin: 0;
li {
margin-right: 5px;
}
} }
} }
} }
@ -108,17 +98,6 @@ div.flex-table {
div.item-row { div.item-row {
flex-direction: row; flex-direction: row;
&:first-child {
align-items: baseline; //
}
&.separator {
margin-top: 0.5em;
border-top: 1px dotted $gray-900;
padding-top: 0.5em;
//flex-direction: column;
}
div.item-col { div.item-col {
&:first-child { &:first-child {
flex-grow: 0; flex-shrink: 0; flex-basis: auto; flex-grow: 0; flex-shrink: 0; flex-basis: auto;
@ -128,8 +107,11 @@ div.flex-table {
flex-grow: 1; flex-shrink: 1; flex-basis: auto; flex-grow: 1; flex-shrink: 1; flex-basis: auto;
justify-content: flex-end; justify-content: flex-end;
@include media-breakpoint-down(md) {
@include separator;
}
ul.record_actions { ul.record_actions {
flex-grow: 1; flex-shrink: 0; flex-basis: auto;
align-self: flex-start; align-self: flex-start;
} }
} }
@ -150,11 +132,11 @@ div.flex-table {
} }
/* /*
* __WRAP-LIST-INLINE_________ * __WRAP_LIST_INLINE_________
* FLEX RESPONSIVE INLINE DEFINITION LIST * FLEX RESPONSIVE INLINE DEFINITION LIST
*/ */
div.wraplist { div.wrap-list {
padding: 0; padding: 0;
width: 100%; width: 100%;
@ -166,6 +148,7 @@ div.wraplist {
div.wl-col.title { div.wl-col.title {
width: auto; width: auto;
flex-shrink: 0;
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
margin-left: 1.5em; margin-left: 1.5em;
@ -205,12 +188,13 @@ div.wraplist {
} }
/* /*
* __WRAP_HEADER_BLOC________ * __WRAP_HEADER_BLOC________
* HEADER ROW FOR FLEX-TABLE ELEMENTS * HEADER ROW FOR FLEX-TABLE ELEMENTS
*/ */
div.wrapheader { div.wrap-header {
width: 100%; width: 100%;
div.wh-row { div.wh-row {
@ -233,6 +217,44 @@ div.wrapheader {
justify-content: flex-end; justify-content: flex-end;
} }
} }
}
&.debug {
border: 1px solid $black;
div.wh-row {
&:first-child div.wh-col {
&:first-child { background-color: $yellow; }
&:last-child { background-color: $beige; }
}
&:last-child div.wh-col {
&:first-child { background-color: $orange; }
&:last-child { background-color: $pink; }
}
}
}
}
/*
* COMMON
*/
div.flex-bloc,
div.flex-table,
div.wrap-list,
div.wrap-header {
div.separator {
@include separator;
}
ul.record_actions {
flex-grow: 1;
flex-shrink: 0;
flex-basis: auto;
margin: 0;
li {
margin-right: 5px;
}
} }
} }

View File

@ -26,3 +26,10 @@
0 1px 0 0 var(--bs-dark) inset; 0 1px 0 0 var(--bs-dark) inset;
} }
// Dotted line to separate rows
@mixin separator {
margin-top: 0.5em;
border-top: 1px dotted $gray-900;
padding-top: 0.5em;
}

View File

@ -115,6 +115,12 @@ div.banner {
} }
} }
abbr.referrer {
font-size: 70%;
padding-right: 0.4em;
align-self: center; // in flex context
}
/* /*
* HOUSEHOLD CONTEXT * HOUSEHOLD CONTEXT
* Header custom for Household * Header custom for Household

View File

@ -1,8 +1,50 @@
/// /// Search Page (list_with_period.html.twig)
div.list-with-period, div.list-household-members { div.list-with-period {
div.periods { // override wrap-list
div.wrap-list.periods-list {
div.wl-row {
flex-wrap: nowrap;
div.wl-col {
&.title {
width: 36%;
@include media-breakpoint-up(md) {
margin-left: 0;
}
}
&.list {
display: flex;
flex-wrap: wrap; //
margin: unset;
}
}
@include media-breakpoint-down(sm) {
flex-wrap: wrap;
div.wl-col {
&.title, &.list {
width: 100%;
}
&.title {
text-align: left;
div {
display: inline-block;
}
}
}
}
}
}
div.periods-list {
div.title {
text-align: right;
div.date {}
div.user {}
}
}
/*
div.header, div.header,
div.list-content { div.list-content {
width: calc(100% - 40px); width: calc(100% - 40px);
@ -21,9 +63,6 @@ div.list-with-period, div.list-household-members {
padding: 5px; padding: 5px;
} }
} }
abbr.referrer {
font-size: 70%;
}
span.user { span.user {
margin-left: 1em; margin-left: 1em;
} }
@ -33,8 +72,24 @@ div.list-with-period, div.list-household-members {
font-style: italic; font-style: italic;
} }
} }
*/
}
/// TODO
/// dans householdmembereditor/Concerned.vue
div.positions {
div.list-household-members {
div.participation-details {}
} }
} }
/// dans householdmembereditor/Concerned.vue et dans household/summary
div.list-household-members {
div.move_to {
p.move_hint {}
}
div.comment {}
}

View File

@ -1,8 +1,18 @@
section.chill-entity { /// CHILL ENTITY RENDER BOX
.chill-entity {
/// PERSON
&.entity-person { &.entity-person {
span.firstname, span.firstname,
span.lastname, span.lastname,
span.altname {} span.altname {}
} }
/// SOCIAL-ISSUE
&.entity-social-issue {
margin-right: 0.3em;
}
} }

View File

@ -40,7 +40,7 @@
</div> </div>
</div> </div>
<div class="item-col separator"> <div class="item-col">
<ul class="list-content fa-ul"> <ul class="list-content fa-ul">
<li v-if="person.current_household_address"> <li v-if="person.current_household_address">
<i class="fa fa-li fa-map-marker"></i> <i class="fa fa-li fa-map-marker"></i>

View File

@ -1,12 +1,12 @@
<div class="border border-danger"> <div class="border border-warning">
<div class="alert alert-danger alert-with-actions mb-0"> <div class="alert alert-warning alert-with-actions mb-0">
<div class="message"> <div class="message">
{{ 'Some peoples does not belong to any household currently. Add them to an household soon'|trans }} {{ 'Some peoples does not belong to any household currently. Add them to an household soon'|trans }}
</div> </div>
<ul class="record_actions"> <ul class="record_actions">
<li> <li>
<button class="btn btn-chill-pink" data-bs-toggle="collapse" href="#withoutHouseholdList"> <button class="btn btn-chill-beige" data-bs-toggle="collapse" href="#withoutHouseholdList">
<i class="fa fa-fw fa-caret-down"></i><span class="text-light">{{ 'Add to household now'|trans }}</span> <i class="fa fa-fw fa-caret-down"></i><span class="">{{ 'Add to household now'|trans }}</span>
</button> </button>
</li> </li>
</ul> </ul>

View File

@ -8,7 +8,7 @@
{% if person.isSharingHousehold %} {% if person.isSharingHousehold %}
<li> <li>
<a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': person.getCurrentHousehold.id }) }}" <a href="{{ chill_path_add_return_path('chill_person_household_summary', { 'household_id': person.getCurrentHousehold.id }) }}"
class="btn btn-sm btn-chill-pink" title="{{ 'Show household'|trans ~ ' n° ' ~ person.getCurrentHousehold.id }}"> class="btn btn-sm btn-chill-beige" title="{{ 'Show household'|trans ~ ' n° ' ~ person.getCurrentHousehold.id }}">
<i class="fa fa-home"></i> <i class="fa fa-home"></i>
</a> </a>
</li> </li>

View File

@ -4,7 +4,7 @@
<div class="item-bloc"> <div class="item-bloc">
<div class="item-row"> <div class="item-row">
<div class="wrapheader"> <div class="wrap-header">
<div class="wh-row"> <div class="wh-row">
<div class="wh-col"> <div class="wh-col">
<span class="h3"> <span class="h3">
@ -22,7 +22,7 @@
{% if accompanying_period.step == 'DRAFT' %} {% if accompanying_period.step == 'DRAFT' %}
<span class="badge bg-secondary">{{- 'Draft'|trans|upper -}}</span> <span class="badge bg-secondary">{{- 'Draft'|trans|upper -}}</span>
{% else %} {% else %}
<span class="badge bg-success">{{- 'Confirmed'|trans|upper -}}</span> <span class="badge bg-primary">{{- 'Confirmed'|trans|upper -}}</span>
{% endif %} {% endif %}
</div> </div>
</div> </div>
@ -46,7 +46,8 @@
<div class="wh-col"> <div class="wh-col">
{% if chill_accompanying_periods.fields.user == 'visible' %} {% if chill_accompanying_periods.fields.user == 'visible' %}
{% if accompanying_period.user %} {% if accompanying_period.user %}
{{ accompanying_period.user.username }} <abbr class="referrer" title="{{ 'Referrer'|trans }}">ref:</abbr>
{{ accompanying_period.user.username|chill_entity_render_box }}
{% else %} {% else %}
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span> <span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
{% endif %} {% endif %}
@ -58,7 +59,7 @@
</div> </div>
<div class="item-row separator"> <div class="item-row separator">
<div class="wraplist"> <div class="wrap-list">
{% if accompanying_period.participations.count > 0 %} {% if accompanying_period.participations.count > 0 %}
<div class="wl-row"> <div class="wl-row">
<div class="wl-col title"><h3>{{ 'Participants'|trans }}</h3></div> <div class="wl-col title"><h3>{{ 'Participants'|trans }}</h3></div>

View File

@ -100,7 +100,7 @@
<div class="item-col"> <div class="item-col">
{{ _self.label(person, options) }} {{ _self.label(person, options) }}
</div> </div>
<div class="item-col separator"> <div class="item-col">
<ul class="list-content fa-ul"> <ul class="list-content fa-ul">
{% set multiline = (options['address_multiline']) ? true : false %} {% set multiline = (options['address_multiline']) ? true : false %}
{{ person.getLastAddress|chill_entity_render_box({ {{ person.getLastAddress|chill_entity_render_box({

View File

@ -1,12 +1,12 @@
{% set reversed_parents = parents|reverse %} {% set reversed_parents = parents|reverse %}
<span class="chill-entity chill-entity__social-issue"> <span class="chill-entity entity-social-issue">
<span class="badge bg-primary"> <span class="badge bg-chill-pink">
{%- for p in reversed_parents %} {%- for p in reversed_parents %}
<span class="chill-entity__social-issue__parent--{{ loop.revindex0 }}"> <span class="parent-{{ loop.revindex0 }}">
{{ p.title|localize_translatable_string }}{{ options['default.separator'] }} {{ p.title|localize_translatable_string }}{{ options['default.separator'] }}
</span> </span>
{%- endfor -%} {%- endfor -%}
<span class="chill-entity__social-issue__child"> <span class="child">
{{ socialIssue.title|localize_translatable_string }} {{ socialIssue.title|localize_translatable_string }}
</span> </span>
</span> </span>

View File

@ -1,7 +1,7 @@
{% macro button_person(person) %} {% macro button_person(person) %}
<li> <li>
<a href="{{ path('chill_person_accompanying_period_list', { 'person_id' : person.id }) }}" <a href="{{ path('chill_person_accompanying_period_list', { 'person_id' : person.id }) }}"
class="btn btn-sm btn-primary" title="{{ 'See accompanying periods'|trans }}"><i class="fa fa-random"></i></a> class="btn btn-sm btn-outline-primary" title="{{ 'See accompanying periods'|trans }}"><i class="fa fa-random"></i></a>
</li> </li>
{% endmacro %} {% endmacro %}
@ -59,44 +59,50 @@
}) }} }) }}
{#- 'apps' is for AccompanyingPeriodParticipationS #} {#- 'apps' is for AccompanyingPeriodParticipationS #}
{#- filter using acl -#}
{%- set apps = [] %} {%- set apps = [] %}
{%- for app in person.openedParticipations %} {%- for app in person.openedParticipations %}
{%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', app.accompanyingPeriod) %} {%- if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', app.accompanyingPeriod) %}
{%- set apps = apps|merge([app]) %} {%- set apps = apps|merge([app]) %}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{% if apps|length > 0 %} {% if apps|length > 0 %}
<div class="item-row separator periods"> <div class="item-row">
{% for app in apps %} <div class="wrap-list periods-list">
{% for app in apps %}
<div class="header"> <div class="wl-row separator">
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': app.accompanyingPeriod.id }) }}" <div class="wl-col title">
class="btn btn-chill-green" title="{{ 'See accompanying period'|trans }}"> <div class="date">
<i class="fa fa-random"></i> {{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
</a> </div>
<span> {% if app.accompanyingPeriod.user is not null %}
{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }} <div class="user">
</span> <abbr class="referrer" title="{{ 'Referrer'|trans }}">ref:</abbr>
{% if app.accompanyingPeriod.user is not null %} {{ app.accompanyingPeriod.user|chill_entity_render_box }}
<span class="user"> </div>
<abbr class="referrer" title="{{ 'Referrer'|trans }}">ref:</abbr> {% endif %}
{{ app.accompanyingPeriod.user|chill_entity_render_box }} </div>
</span> <div class="wl-col list">
{% endif %} {% for issue in app.accompanyingPeriod.socialIssues %}
</div> {{ issue|chill_entity_render_box }}
{% endfor %}
<div class="list-content"> {# ^^ display all socialIssues
{% for issue in app.accompanyingPeriod.socialIssues|slice(0,2) %} |slice(0,2)
<span>{{ issue|chill_entity_render_box }}</span> {% if app.accompanyingPeriod.socialIssues|length > 2 %}
<span class="more">{{ 'and %number% other'|transchoice(app.accompanyingPeriod.socialIssues|length-2) }}</span>
{% endif %}
#}
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': app.accompanyingPeriod.id }) }}"
class="btn btn-sm btn-outline-primary" title="{{ 'See accompanying period'|trans }}">
<i class="fa fa-random fa-fw"></i>
</a>
</li>
</ul>
</div>
</div>
{% endfor %} {% endfor %}
{% if app.accompanyingPeriod.socialIssues|length > 2 %}
<span class="more">{{ 'and %number% other'|transchoice(app.accompanyingPeriod.socialIssues|length-2) }}</span>
{% endif %}
</div> </div>
{% endfor %}
</div> </div>
{% endif %} {% endif %}

View File

@ -191,7 +191,7 @@ Social actions: Actions d'accompagnement
Social issues: Problématiques sociales Social issues: Problématiques sociales
Last events on accompanying course: Dernières actions de suivi Last events on accompanying course: Dernières actions de suivi
Edit & activate accompanying course: Modifier et valider Edit & activate accompanying course: Modifier et valider
See accompanying periods: Voir les périodes d'accompagnement See accompanying periods: Voir toutes les périodes d'accompagnement
See accompanying period: Voir la période See accompanying period: Voir la période
Edit accompanying period: Modifier la période Edit accompanying period: Modifier la période
See this period: Voir cette période See this period: Voir cette période

View File

@ -31,7 +31,7 @@
</div> </div>
</div> </div>
<div class="item-col separator"> <div class="item-col">
<ul class="list-content fa-ul"> <ul class="list-content fa-ul">
<li v-if="thirdparty.address"> <li v-if="thirdparty.address">
<i class="fa fa-li fa-map-marker"></i> <i class="fa fa-li fa-map-marker"></i>

View File

@ -66,7 +66,7 @@
<div class="item-col"> <div class="item-col">
{{ _self.label(thirdparty, options) }} {{ _self.label(thirdparty, options) }}
</div> </div>
<div class="item-col separator"> <div class="item-col">
<ul class="list-content fa-ul"> <ul class="list-content fa-ul">
{{ thirdparty.getAddress|chill_entity_render_box({ {{ thirdparty.getAddress|chill_entity_render_box({
'render': 'list', 'render': 'list',