simplify concernedGroups template for bloc/row include

This commit is contained in:
Mathieu Jaumotte 2021-06-04 19:50:00 +02:00
parent c1ba892811
commit 574b5dcbd0
2 changed files with 49 additions and 20 deletions

View File

@ -71,6 +71,24 @@ div.flex-table.list-records {
&:nth-child(2) {
flex-grow: 0; flex-shrink: 1; flex-basis: 70%;
}
&:only-child {
flex-grow: 0; flex-shrink: 0; flex-basis: 100%;
& > div.concerned-groups {
flex-grow: 0; flex-shrink: 0; flex-basis: 100%;
display: flex;
flex-direction: column; // TODO pas fini
div.group {
flex-grow: 1; flex-shrink: 0; flex-basis: 30%;
h4 {}
ul.list-content {
li {
display: inline;
}
}
}
}
}
}
div.concerned-groups {
font-size: 85%;

View File

@ -46,27 +46,15 @@
] %}
{% endif %}
{% set level1 = (with_display == 'bloc') ? context ~ ' flex-bloc ' : '' %}
{% set level2 = (with_display == 'bloc') ? 'item-bloc ' : '' %}
{% set level3 = (with_display == 'bloc') ? 'item-row ' : '' %}
{% set level4 = (with_display == 'bloc') ? 'item-col ' : '' %}
<div class="{{ level1 }}concerned-groups">
{% if (with_display == 'bloc') %}
<div class="{{ context }} flex-bloc concerned-groups">
{% for bloc in blocs %}
<div class="{{ level2 }}">
<div class="{{ level3 }}">
<div class="{{ level4 }}">
{% if with_display == 'bloc' or bloc.items|length > 0 %}
<h4>{{ bloc.title }}</h4>
{% endif %}
{% if with_display == 'bloc' %}
<div class="item-bloc">
<div class="item-row">
<div class="item-col">
<h4>{{ bloc.title }}</h4>
</div>
<div class="{{ level4 }}">
{% endif %}
<div class="item-col">
<ul class="list-content">
{% for item in bloc.items %}
<li>
@ -82,5 +70,28 @@
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% if (with_display == 'row') %}
<div class="concerned-groups">
{% for bloc in blocs %}
<div class="group">
{% if bloc.items|length > 0 %}
<h4>{{ bloc.title }}</h4>
<ul class="list-content">
{% for item in bloc.items %}
<li>
<a href="{{ _self.href(bloc.path, bloc.key, item.id) }}">
<span class="badge badge-primary">
{{ item|chill_entity_render_box({'only_denomination': true}) }}
</span>
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}