improve flex-table logic, with accompanying period list template

This commit is contained in:
2021-08-01 18:38:31 +02:00
parent d34a00b2c0
commit ee819e7767
10 changed files with 180 additions and 147 deletions

View File

@@ -5,33 +5,28 @@
<div class="item-row">
<div class="item-col">
<b>#{{ accompanying_period.id }}</b>
<span class="h3">
<i class="fa fa-fw fa-random"></i>
<b>{{ accompanying_period.id }}</b>
</span>
{% if accompanying_period.step == 'DRAFT' %}
<span class="badge bg-primary">{{- 'Draft'|trans|upper -}}</span>
{% else %}
<span class="badge bg-primary">{{- 'Confirmed'|trans|upper -}}</span>
{% endif %}
{% if accompanying_period.emergency %}
<span class="badge bg-primary">{{- 'Emergency'|trans|upper -}}</span>
{% endif %}
{% if accompanying_period.confidential %}
<span class="badge bg-primary">{{- 'Confidential'|trans|upper -}}</span>
{% endif %}
{% if accompanying_period.step == 'DRAFT' %}
<span class="badge bg-primary">{{- 'Draft'|trans|upper -}}</span>
{% else %}
<span class="badge bg-primary">{{- 'Confirmed'|trans|upper -}}</span>
{% 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 class="item-col"></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 %}
@@ -46,9 +41,20 @@
</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">
<div class="item-row separator">
<div class="item-col"><h3>{{ 'Participants'|trans }}</h3></div>
<div class="item-col">
@@ -99,17 +105,14 @@
{% endif %}
</div>
<div class="item-row">
<div class="item-row separator">
<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 }) }}"
class="btn btn-primary" title="{{ 'See accompanying period'|trans }}">
<i class="fa fa-fw fa-random"></i>
{{ 'See this period'|trans }}
</a>
class="btn btn-show" title="{{ 'See accompanying period'|trans }}">{{ 'See this period'|trans }}</a>
</li>
{# TODO cause error in household context. only works in person context

View File

@@ -89,7 +89,7 @@
<div class="item-col">
{{ _self.label(person, options) }}
</div>
<div class="item-col">
<div class="item-col separator">
<ul class="list-content fa-ul">
{% set multiline = (options['address_multiline']) ? true : false %}
{{ person.getLastAddress|chill_entity_render_box({

View File

@@ -68,7 +68,7 @@
{%- endfor %}
{% if apps|length > 0 %}
<div class="item-row periods">
<div class="item-row separator periods">
{% for app in apps %}
<div class="header">