add ACTIVITY_SEE_DETAILS role

This new role allow to see the details (remark + reasons) in the timeline.
This commit is contained in:
2017-06-20 15:17:51 +02:00
parent f7c9e6f3b8
commit 239ea38e92
4 changed files with 30 additions and 6 deletions

View File

@@ -1,3 +1,5 @@
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
<div>
<h3>{{ activity.date|localizeddate('long', 'none') }}<span class="activity"> / {{ 'Activity'|trans }}</span></h3>
<div class="statement">
@@ -9,5 +11,20 @@
) }}</span> <span class="links"><a href="{{ path('chill_activity_activity_show',
{ 'person_id': person.id, 'id': activity.id} ) }}">{{ 'Show the activity'|trans }}</a></span>
{% if is_granted(constant('Chill\\ActivityBundle\\Security\\Authorization\\ActivityVoter::SEE_DETAILS'), activity) %}
<dl class="chill_view_data">
<dt class="inline">{{ 'Remark'|trans }}</dt>
<dd>{% if activity.remark is empty %}{{ 'No remarks'|trans }}{% else %}<blockquote class="chill-user-quote">{{ activity.remark|nl2br }}</blockquote>{% endif %}</dd>
<dt class="inline">{{ 'Reasons'|trans }}</dt>
{%- 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>
{%- endif -%}
</dl>
{% endif %}
</div>
</div>