include AccompanyingPeriod in notification (shownInNotification)

This commit is contained in:
2022-01-10 10:31:09 +01:00
parent 98ab3b66ba
commit a40077e91b
2 changed files with 26 additions and 9 deletions

View File

@@ -1,12 +1,25 @@
{# variables availables: notification, period. #}
{% macro recordAction(period) %}
<li>
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period }) }}"
class="btn btn-show" title="{{ 'See accompanying period'|trans }}"></a>
</li>
{% endmacro %}
{% if period is not null %}
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', period) %}
<a href="{{ path('chill_person_accompanying_course_index', {'accompanying_period_id': notification.relatedEntityId }) }}">
Resume Accompanying Course (renderbox + links)
</a>
{% else %}
You are getting a notification for a period you are not allowed to see. This is the minimal details: {{ period.id }}
{% endif %}
<div class="flex-table">
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_SEE', period) %}
{% include 'ChillPersonBundle:AccompanyingPeriod:_list_item.html.twig' with {
'recordAction': _self.recordAction(notification.relatedEntityId)
} %}
{% else %}
<div class="alert alert-warning">
{{ 'This is the minimal details'|trans ~ ': ' ~ period.id }}<br>
{{ 'You are getting a notification for a period you are not allowed to see.'|trans }}
</div>
{% endif %}
</div>
{% else %}
<div>You are getting a notification for a period which does not exists any more</div>
<div class="alert alert-warning">
{{ 'You are getting a notification for a period which does not exists any more'|trans }}
</div>
{% endif %}