notify the referrer from an activity page or list

This commit is contained in:
Julien Fastré 2022-06-14 21:24:28 +02:00
parent 4592be3a8d
commit f339cf56d6
2 changed files with 48 additions and 9 deletions

View File

@ -2,12 +2,30 @@
{% if is_granted('CHILL_ACTIVITY_SEE_DETAILS', activity) %}
{% if no_action is not defined or no_action == false %}
<li>
<a class="btn btn-misc" href="{{ chill_path_add_return_path('chill_main_notification_create', {
'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity',
'entityId': activity.id
}) }}">
<i class="fa fa-paper-plane fa-fw"></i>
{{ 'notification.Notify'|trans }}</a>
{% set showGroup = activity.accompanyingPeriod is not null and activity.accompanyingPeriod.hasUser and activity.accompanyingPeriod.user is not same as(app.user) %}
<div class="{% if showGroup %}btn-group{% endif %}" {% if showGroup %}role="group"{% endif %}>
{% if showGroup %}
<button id="btnGroupNotifyButtons" type="button" class="btn btn-notify dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
{{ 'notification.Notify'|trans }}
</button>
<ul class="dropdown-menu" aria-labelledby="btnGroupNotifyButtons">
<li>
<a class="dropdown-item" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': activity.id, 'tos': [activity.accompanyingPeriod.user.id]}) }}">
{{ 'notification.Notify referrer'|trans }}
</a>
</li>
<li>
<a class="dropdown-item" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': activity.id}) }}">
{{ 'notification.Notify any'|trans }}
</a>
</li>
</ul>
{% else %}
<a class="btn btn-notify" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': activity.id}) }}">
{{ 'notification.Notify'|trans }}
</a>
{% endif %}
</div>
</li>
{% endif %}
{% if context == 'person' and activity.accompanyingPeriod is not empty %}

View File

@ -217,9 +217,30 @@
</a>
</li>
<li>
<a class="btn btn-notify" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': entity.id}) }}">
{{ 'notification.Notify'|trans }}
</a>
{% set showGroup = entity.accompanyingPeriod is not null and entity.accompanyingPeriod.hasUser and entity.accompanyingPeriod.user is not same as(app.user) %}
<div class="{% if showGroup %}btn-group{% endif %}" {% if showGroup %}role="group"{% endif %}>
{% if showGroup %}
<button id="btnGroupNotifyButtons" type="button" class="btn btn-notify dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
{{ 'notification.Notify'|trans }}
</button>
<ul class="dropdown-menu" aria-labelledby="btnGroupNotifyButtons">
<li>
<a class="dropdown-item" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': entity.id, 'tos': [entity.accompanyingPeriod.user.id]}) }}">
{{ 'notification.Notify referrer'|trans }}
</a>
</li>
<li>
<a class="dropdown-item" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': entity.id}) }}">
{{ 'notification.Notify any'|trans }}
</a>
</li>
</ul>
{% else %}
<a class="btn btn-notify" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\ActivityBundle\\Entity\\Activity', 'entityId': entity.id}) }}">
{{ 'notification.Notify'|trans }}
</a>
{% endif %}
</div>
</li>
{% if is_granted('CHILL_ACTIVITY_UPDATE', entity) %}
<li>