Add a link between accompanying period and user

It is now allowed to indicates who make/made the accompanying period.

This feature may be hidden by a specific configuration option. Default
to visible.
This commit is contained in:
2019-07-01 15:21:34 +02:00
parent 5b60415166
commit 19cc54a674
13 changed files with 173 additions and 31 deletions

View File

@@ -39,6 +39,10 @@
{% if form.closingMotive is defined %}
{{ form_row(form.closingMotive, {'label' : 'Closing motive'} ) }}
{% endif %}
{% if form.user is defined %}
{{ form_row(form.user, {'label': 'Accompanying user'}) }}
{% endif %}
{{ form_row(form.remark, {'label' : 'Remark' } ) }}

View File

@@ -10,6 +10,9 @@
<tr>
<th class="chill-red">{{ 'Opening date'|trans }}</th>
<th class="chill-green">{{ 'Closing date'|trans }}</th>
{% if chill_accompanying_periods.fields.user == 'visible' %}
<th class="chill-green">{{ 'Accompanying user'|trans }}</th>
{% endif %}
<th class="chill-orange">{{ 'Remark'|trans }}</th>
<th>&nbsp;</th>
</tr>
@@ -26,6 +29,15 @@
{{ accompanying_period.closingDate|localizeddate('long', 'none', app.request.locale) }}
{% endif %}
{% endspaceless %}</td>
{% if chill_accompanying_periods.fields.user == 'visible' %}
<td>
{% if accompanying_period.user %}
{{ accompanying_period.user.username }}
{% else %}
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
{% endif %}
</td>
{% endif %}
<td>
{% if accompanying_period.remark is empty %}
<p class="chill-no-data-statement">{{ 'No remark'|trans }}</p>