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"> <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">
<div class="wrapheader">
<div class="wh-row">
<div class="wh-col">
<span class="h3"> <span class="h3">
<i class="fa fa-fw fa-random"></i> <i class="fa fa-fw fa-random"></i>
<b>{{ accompanying_period.id }}</b> <b>{{ accompanying_period.id }}</b>
@ -16,7 +18,7 @@
<span class="badge bg-danger">{{- 'Confidential'|trans|upper -}}</span> <span class="badge bg-danger">{{- 'Confidential'|trans|upper -}}</span>
{% endif %} {% endif %}
</div> </div>
<div class="item-col"> <div class="wh-col">
{% 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 %}
@ -24,8 +26,8 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="item-row"> <div class="wh-row">
<div class="item-col"> <div class="wh-col">
{% if accompanying_period.closingDate == null %} {% if accompanying_period.closingDate == null %}
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }} {{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }}
{% else %} {% else %}
@ -41,7 +43,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>
<div class="item-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 }} {{ accompanying_period.user.username }}
@ -51,13 +53,16 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
</div>
<div class="item-row separator"> <div class="item-row separator">
<div class="wraplist"> <div class="wraplist">
{% 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>
<div class="wl-col list"> <div class="wl-col list">
{% if accompanying_period.participations.count > 0 %}
{% for p in accompanying_period.participations %} {% for p in accompanying_period.participations %}
<p class="wl-item"> <p class="wl-item">
<a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}"> <a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}">
@ -65,17 +70,10 @@
</a> </a>
</p> </p>
{% endfor %} {% endfor %}
{% else %} </div>
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span> </div>
{% endif %} {% endif %}
</div>
</div>
</div>
</div>
{% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %} {% 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-row">
<div class="wl-col title"><h3>{{ 'Requestor'|trans }}</h3></div> <div class="wl-col title"><h3>{{ 'Requestor'|trans }}</h3></div>
<div class="wl-col list"> <div class="wl-col list">
@ -91,13 +89,8 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
</div>
{% endif %} {% endif %}
{% if accompanying_period.socialIssues.count > 0 %} {% if accompanying_period.socialIssues.count > 0 %}
<div class="item-row">
<div class="wraplist">
<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>
</div>
{% endif %} {% endif %}
</div>
</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,11 +140,10 @@
{% 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>
{% endblock content %} {% endblock content %}