replace dropdown for selecting reasons and use chillEntity for reason rendering

This commit is contained in:
2020-04-21 14:41:40 +02:00
parent 544466d504
commit a9349becf7
14 changed files with 186 additions and 53 deletions

View File

@@ -16,8 +16,6 @@
#}
{% extends "ChillPersonBundle::layout.html.twig" %}
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
{% set activeRouteKey = 'chill_activity_activity_list' %}
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
@@ -47,10 +45,15 @@
<td>{% if activity.date %}{{ activity.date|localizeddate('long', 'none') }}{% endif %}</td>
<td>{{ activity.durationTime|date('H:i') }}</td>
<td>
{% if activity.remark is not empty %}
<blockquote class="chill-user-quote">
{{ activity.remark|truncate(250, true) }}
</blockquote>
{% endif %}
{%- if activity.reasons is empty -%}
{{ 'No reason associated'|trans }}
{%- else -%}
{% for r in activity.reasons %}{{ m.reason(r) }} {% endfor %}
{% for r in activity.reasons %}{{ r|chill_entity_render_box }} {% endfor %}
{%- endif -%}
</td>
<td>{{ activity.type.name | localize_translatable_string }}</td>

View File

@@ -35,7 +35,7 @@
{%- if entity.reasons is empty -%}
<dd><span class="chill-no-data-statement">{{ 'No reason associated'|trans }}</span></dd>
{%- else -%}
<dd>{% for r in entity.reasons %}{{ m.reason(r) }} {% endfor %}</dd>
<dd>{% for r in entity.reasons %}{{ r|chill_entity_render_box }} {% endfor %}</dd>
{%- endif -%}
</dl>

View File

@@ -20,7 +20,7 @@
{%- if activity.reasons is empty -%}
<dd><span class="chill-no-data-statement">{{ 'No reason associated'|trans }}</span></dd>
{%- else -%}
<dd>{% for r in activity.reasons %}{{ m.reason(r) }} {% endfor %}</dd>
<dd>{% for r in activity.reasons %}{{ r|chill_entity_render_box }} {% endfor %}</dd>
{%- endif -%}
</dl>