improve banners render : context person, with common improvements on accompanyingcourse and household context

This commit is contained in:
2021-07-01 16:13:07 +02:00
parent a78de0f96c
commit fc63955205
7 changed files with 144 additions and 70 deletions

View File

@@ -1,50 +1,58 @@
<div class="subheader banner-household">
<div class="subheader banner banner-household">
<div class="grid-12 parent" id="header-household-name" >
<div class="grid-10 push-1 grid-mobile-12 grid-tablet-12 push-mobile-0 push-tablet-0 parent">
<div class="grid-6">{% set title = title %}
<div class="grid-7">
<h1>
<i class="fa fa-home"></i>
{{ 'household.Household'|trans }}
<span style="font-weight: lighter; font-size: 50%;">(n°{{ household.id }})</span>
<span class="id-number">{{ household.id }}</span>
</h1>
</div>
<div class="grid-3" id="banner-flags"></div>
<div class="grid-3" id="banner-status">
{% set address = household.currentAddress %}
{% if address is empty %}
<p class="chill-no-data-statement">{{ 'household.Household does not have any address currently'|trans }}</p>
{% else %}
<div>
{{ address|chill_entity_render_box({'multiline': true, 'with_valid_from': false}) }}
</div>
{% endif %}
<div class="grid-5">
<ul class="list-content fa-ul">
<li>
{% set address = household.currentAddress %}
<i class="fa fa-li fa-map-marker"></i>
{% if address is empty %}
<p class="chill-no-data-statement">{{ 'household.Household does not have any address currently'|trans }}</p>
{% else %}
{{ address|chill_entity_render_box({'multiline': false, 'with_valid_from': false}) }}
{% endif %}
</li>
</ul>
</div>
</div>
</div>
<div class="grid-12 parent" id="header-household-details" >
<div class="grid-10 push-1 grid-mobile-12 grid-tablet-12 push-mobile-0 push-tablet-0 parent">
<div id="banner-misc">
{%- set members = household.getCurrentMembersOrdered() -%}
{%- if members|length > 0 -%}
<span class="current-members-explain">
{{- 'household.Current household members'|trans }}:
</span>
{%- for m in members|slice(0, 5) -%}
{{- m.person|chill_entity_render_box({'addLink': false}) -}}
{%- if m.holder %} <span class="badge badge-primary">{{ 'household.holder'|trans }}</span>{% endif -%}
{%- if false == loop.last -%}, {% endif -%}
{%- endfor -%}
{% if members|length > 5 %}
<span class="current-members-more">
{{ 'household.and x other persons'|trans({'x': members|length-5}) }}
</span>
{% endif %}
{%- endif -%}
{%- set members = household.getCurrentMembersOrdered() -%}
{%- if members|length > 0 -%}
<span class="current-members-explain">
{{- 'household.Current household members'|trans }}:
</span>
{%- for m in members|slice(0, 5) -%}
{{- m.person|chill_entity_render_box({'addLink': false}) -}}
{%- if m.holder %}
<span class="badge badge-primary">
{{ 'household.holder'|trans }}
</span>
{% endif -%}
{%- if false == loop.last -%}, {% endif -%}
{%- endfor -%}
{% if members|length > 5 %}
<span class="current-members-more">
{{ 'household.and x other persons'|trans({'x': members|length-5}) }}
</span>
{% endif %}
{%- endif -%}
</div>
</div>
</div>
</div>
<span id="banner-household"></span>