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,9 +2,11 @@
<div class="flex-table">
{% for accompanying_period in accompanying_periods %}
<div class="item-bloc">
<div class="item-row">
<div class="item-col">
<div class="wrapheader">
<div class="wh-row">
<div class="wh-col">
<span class="h3">
<i class="fa fa-fw fa-random"></i>
<b>{{ accompanying_period.id }}</b>
@ -16,7 +18,7 @@
<span class="badge bg-danger">{{- 'Confidential'|trans|upper -}}</span>
{% endif %}
</div>
<div class="item-col">
<div class="wh-col">
{% if accompanying_period.step == 'DRAFT' %}
<span class="badge bg-secondary">{{- 'Draft'|trans|upper -}}</span>
{% else %}
@ -24,8 +26,8 @@
{% endif %}
</div>
</div>
<div class="item-row">
<div class="item-col">
<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 %}
@ -41,7 +43,7 @@
{% endif %}
{% endif %}
</div>
<div class="item-col">
<div class="wh-col">
{% if chill_accompanying_periods.fields.user == 'visible' %}
{% if accompanying_period.user %}
{{ accompanying_period.user.username }}
@ -51,13 +53,16 @@
{% endif %}
</div>
</div>
</div>
</div>
<div class="item-row separator">
<div class="wraplist">
{% if accompanying_period.participations.count > 0 %}
<div class="wl-row">
<div class="wl-col title"><h3>{{ 'Participants'|trans }}</h3></div>
<div class="wl-col list">
{% if accompanying_period.participations.count > 0 %}
{% for p in accompanying_period.participations %}
<p class="wl-item">
<a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}">
@ -65,17 +70,10 @@
</a>
</p>
{% endfor %}
{% else %}
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %}
<div class="item-row">
<div class="wraplist">
<div class="wl-row">
<div class="wl-col title"><h3>{{ 'Requestor'|trans }}</h3></div>
<div class="wl-col list">
@ -91,13 +89,8 @@
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
{% if accompanying_period.socialIssues.count > 0 %}
<div class="item-row">
<div class="wraplist">
<div class="wl-row">
<div class="wl-col title"><h3>{{ 'Social issues'|trans }}</h3></div>
<div class="wl-col list">
@ -108,13 +101,13 @@
{% endfor %}
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
<div class="item-row separator">
<ul class="record_actions">
<ul class="record_actions">
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
<li>
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': accompanying_period.id }) }}"
@ -147,11 +140,10 @@
{% elseif household is defined %}
{# TODO buttons specific for household ? #}
{% endif %}
</ul>
</div>
</div>
</div>
{% endfor %}
</div>
{% endblock content %}