[closing motive] add an hierarchy + admin section for closing motives

This commit is contained in:
2020-03-12 12:19:15 +01:00
parent ceb3b5e955
commit e59f58f461
26 changed files with 712 additions and 41 deletions

View File

@@ -8,10 +8,9 @@
<table class="rounded">
<thead>
<tr>
<th class="chill-red">{{ 'Opening date'|trans }}</th>
<th class="chill-green">{{ 'Closing date'|trans }}</th>
<th class="chill-red">{{ 'accompanying_period.dates'|trans }}</th>
{% if chill_accompanying_periods.fields.user == 'visible' %}
<th class="chill-green">{{ 'Accompanying user'|trans }}</th>
<th class="chill-blue">{{ 'Accompanying user'|trans }}</th>
{% endif %}
<th class="chill-orange">{{ 'Remark'|trans }}</th>
<th>&nbsp;</th>
@@ -21,14 +20,17 @@
<tbody>
{% for accompanying_period in accompanying_periods %}
<tr>
<td>{{ accompanying_period.openingDate|localizeddate('long', 'none', app.request.locale) }}</td>
<td>{% spaceless %}
{% if accompanying_period.isOpen %}
{{ 'Period opened'|trans }}
<td>
{% if accompanying_period.isOpen == false %}
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|localizeddate('long', 'none') } ) }}
{% else %}
{{ accompanying_period.closingDate|localizeddate('long', 'none', app.request.locale) }}
{{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({
'%opening_date%': accompanying_period.openingDate|localizeddate('long', 'none'),
'%closing_date%': accompanying_period.closingDate|localizeddate('long', 'none')}
) }}
<div>{{ accompanying_period.closingMotive|chill_entity_render_box }}</div>
{% endif %}
{% endspaceless %}</td>
</td>
{% if chill_accompanying_periods.fields.user == 'visible' %}
<td>
{% if accompanying_period.user %}
@@ -39,13 +41,7 @@
</td>
{% endif %}
<td>
{% if accompanying_period.remark is empty %}
<p class="chill-no-data-statement">{{ 'No remark'|trans }}</p>
{% else %}
<blockquote class="chill-user-quote">
{{ accompanying_period.remark|nl2br }}
</blockquote>
{% endif %}
{{ accompanying_period.remark|chill_print_or_message('No remark', 'blockquote') }}
</td>
<td>
<ul class="record_actions">
@@ -82,14 +78,15 @@
</a>
</li>
<li>
<a href="{{ path ('chill_person_accompanying_period_create', {'person_id' : person.id } ) }}" class="sc-button bt-create">
{{ 'Add an accompanying period in the past'|trans }}
<a href="{{ path ('chill_person_accompanying_period_create', {'person_id' : person.id } ) }}" class="sc-button bt-create has-hidden">
<span class="show-on-hover">{{ 'Add an accompanying period in the past'|trans }}</span>
</a>
</li>
{% if person.isOpen == false %}
<li>
<a href="{{ path('chill_person_accompanying_period_open', {'person_id' : person.id} ) }}" class="sc-button bt-create change-icon">
<i class="fa fa-unlock" aria-hidden="true"></i>{{'Begin a new accompanying period'|trans }}
<a href="{{ path('chill_person_accompanying_period_open', {'person_id' : person.id} ) }}" class="sc-button bt-create change-icon has-hidden">
<i class="fa fa-unlock" aria-hidden="true"></i>
<span class="show-on-hover">{{'Begin a new accompanying period'|trans }}</span>
</a>
</li>
{% endif %}