AccompanyingPeriod list: adding new wrapheader asset and improve wraplist structure

wrapheader manage header of flex-table first row. the 2 cascades are independant.
This commit is contained in:
Mathieu Jaumotte 2021-08-20 13:35:15 +02:00
parent 28f69d8dec
commit 38dcca7397
2 changed files with 116 additions and 91 deletions

View File

@ -203,3 +203,36 @@ div.wraplist {
} }
} }
} }
/*
* __WRAP_HEADER_BLOC________
* HEADER ROW FOR FLEX-TABLE ELEMENTS
*/
div.wrapheader {
width: 100%;
div.wh-row {
display: flex;
flex-direction: row;
&:first-child {
align-items: baseline;
}
&:last-child {}
div.wh-col {
&:first-child {
flex-grow: 0; flex-shrink: 1; flex-basis: auto;
}
&:last-child {
flex-grow: 1; flex-shrink: 1; flex-basis: auto;
display: flex;
justify-content: flex-end;
}
}
}
}

View File

@ -2,102 +2,95 @@
<div class="flex-table"> <div class="flex-table">
{% for accompanying_period in accompanying_periods %} {% for accompanying_period in accompanying_periods %}
<div class="item-bloc"> <div class="item-bloc">
<div class="item-row"> <div class="item-row">
<div class="item-col">
<span class="h3">
<i class="fa fa-fw fa-random"></i>
<b>{{ accompanying_period.id }}</b>
</span>
{% if accompanying_period.emergency %}
<span class="badge bg-danger">{{- 'Emergency'|trans|upper -}}</span>
{% endif %}
{% if accompanying_period.confidential %}
<span class="badge bg-danger">{{- 'Confidential'|trans|upper -}}</span>
{% endif %}
</div>
<div class="item-col">
{% if accompanying_period.step == 'DRAFT' %}
<span class="badge bg-secondary">{{- 'Draft'|trans|upper -}}</span>
{% else %}
<span class="badge bg-success">{{- 'Confirmed'|trans|upper -}}</span>
{% endif %}
</div>
</div>
<div class="item-row">
<div class="item-col">
{% if accompanying_period.closingDate == null %}
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }}
{% else %}
{{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({
'%opening_date%': accompanying_period.openingDate|format_date('long'),
'%closing_date%': accompanying_period.closingDate|format_date('long')}
) }}
{% if accompanying_period.isOpen == false %}
<dl class="chill_view_data">
<dt>{{ 'Closing motive'|trans }}&nbsp;:</dt>
<dd>{{ accompanying_period.closingMotive|chill_entity_render_box }}</dd>
</dl>
{% endif %}
{% endif %}
</div>
<div class="item-col">
{% if chill_accompanying_periods.fields.user == 'visible' %}
{% if accompanying_period.user %}
{{ accompanying_period.user.username }}
{% else %}
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
{% endif %}
{% endif %}
</div>
</div>
<div class="item-row separator"> <div class="wrapheader">
<div class="wraplist"> <div class="wh-row">
<div class="wl-row"> <div class="wh-col">
<div class="wl-col title"><h3>{{ 'Participants'|trans }}</h3></div> <span class="h3">
<div class="wl-col list"> <i class="fa fa-fw fa-random"></i>
{% if accompanying_period.participations.count > 0 %} <b>{{ accompanying_period.id }}</b>
{% for p in accompanying_period.participations %} </span>
<p class="wl-item"> {% if accompanying_period.emergency %}
<a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}"> <span class="badge bg-danger">{{- 'Emergency'|trans|upper -}}</span>
{{ p.person.firstname ~ ' ' ~ p.person.lastname }} {% endif %}
</a> {% if accompanying_period.confidential %}
</p> <span class="badge bg-danger">{{- 'Confidential'|trans|upper -}}</span>
{% endfor %} {% endif %}
</div>
<div class="wh-col">
{% if accompanying_period.step == 'DRAFT' %}
<span class="badge bg-secondary">{{- 'Draft'|trans|upper -}}</span>
{% else %} {% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span> <span class="badge bg-success">{{- 'Confirmed'|trans|upper -}}</span>
{% endif %}
</div>
</div>
<div class="wh-row">
<div class="wh-col">
{% if accompanying_period.closingDate == null %}
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }}
{% else %}
{{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({
'%opening_date%': accompanying_period.openingDate|format_date('long'),
'%closing_date%': accompanying_period.closingDate|format_date('long')}
) }}
{% if accompanying_period.isOpen == false %}
<dl class="chill_view_data">
<dt>{{ 'Closing motive'|trans }}&nbsp;:</dt>
<dd>{{ accompanying_period.closingMotive|chill_entity_render_box }}</dd>
</dl>
{% endif %}
{% endif %}
</div>
<div class="wh-col">
{% if chill_accompanying_periods.fields.user == 'visible' %}
{% if accompanying_period.user %}
{{ accompanying_period.user.username }}
{% else %}
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
{% endif %}
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div> </div>
</div>
{% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %} </div>
<div class="item-row"> <div class="item-row separator">
<div class="wraplist"> <div class="wraplist">
<div class="wl-row"> {% if accompanying_period.participations.count > 0 %}
<div class="wl-col title"><h3>{{ 'Requestor'|trans }}</h3></div> <div class="wl-row">
<div class="wl-col list"> <div class="wl-col title"><h3>{{ 'Participants'|trans }}</h3></div>
{% if accompanying_period.requestorPerson is not null %} <div class="wl-col list">
<p class="wl-item"> {% for p in accompanying_period.participations %}
{{ accompanying_period.requestorPerson.firstname ~ ' ' ~ accompanying_period.requestorPerson.lastname }} <p class="wl-item">
</p> <a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}">
{% endif %} {{ p.person.firstname ~ ' ' ~ p.person.lastname }}
{% if accompanying_period.requestorThirdParty is not null %} </a>
<p class="wl-item"> </p>
{{ accompanying_period.requestorThirdParty.name }} {% endfor %}
</p> </div>
{% endif %}
</div> </div>
</div> {% endif %}
</div> {% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %}
</div> <div class="wl-row">
{% endif %} <div class="wl-col title"><h3>{{ 'Requestor'|trans }}</h3></div>
<div class="wl-col list">
{% if accompanying_period.socialIssues.count > 0 %} {% if accompanying_period.requestorPerson is not null %}
<div class="item-row"> <p class="wl-item">
<div class="wraplist"> {{ accompanying_period.requestorPerson.firstname ~ ' ' ~ accompanying_period.requestorPerson.lastname }}
</p>
{% endif %}
{% if accompanying_period.requestorThirdParty is not null %}
<p class="wl-item">
{{ accompanying_period.requestorThirdParty.name }}
</p>
{% endif %}
</div>
</div>
{% endif %}
{% if accompanying_period.socialIssues.count > 0 %}
<div class="wl-row"> <div class="wl-row">
<div class="wl-col title"><h3>{{ 'Social issues'|trans }}</h3></div> <div class="wl-col title"><h3>{{ 'Social issues'|trans }}</h3></div>
<div class="wl-col list"> <div class="wl-col list">
@ -108,13 +101,13 @@
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
</div> {% endif %}
</div> </div>
{% endif %}
</div>
<div class="item-row separator"> <div class="item-row separator">
<ul class="record_actions">
<ul class="record_actions">
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #} {# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
<li> <li>
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': accompanying_period.id }) }}" <a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': accompanying_period.id }) }}"
@ -147,10 +140,9 @@
{% elseif household is defined %} {% elseif household is defined %}
{# TODO buttons specific for household ? #} {# TODO buttons specific for household ? #}
{% endif %} {% endif %}
</ul> </ul>
</div>
</div>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>