notification-list: todo add a comment counter

This commit is contained in:
Mathieu Jaumotte 2022-01-31 11:25:23 +01:00
parent 230d73498e
commit efb5bd64b4

View File

@ -70,34 +70,44 @@
</div> </div>
{% if c.action_button is not defined or c.action_button != false %} {% if c.action_button is not defined or c.action_button != false %}
<div class="item-row separator"> <div class="item-row separator">
<ul class="record_actions"> <div class="item-col item-meta">
<li>
{# Vue component #} {# TODO twig extension to count comments #}
<span class="notification_toggle_read_status" <div class="comment-counter visually-hidden">
data-notification-id="{{ c.notification.id }}" <span>x commentaires</span>
data-notification-current-is-read="{{ c.notification.isReadBy(app.user) }}" </div>
data-container="notification-status"
></span> </div>
</li> <div class="item-col">
{% if is_granted('CHILL_MAIN_NOTIFICATION_UPDATE', c.notification) %} <ul class="record_actions">
<li> <li>
<a href="{{ chill_path_add_return_path('chill_main_notification_edit', {'id': c.notification.id}) }}" {# Vue component #}
class="btn btn-edit" title="{{ 'Edit'|trans }}"></a> <span class="notification_toggle_read_status"
data-notification-id="{{ c.notification.id }}"
data-notification-current-is-read="{{ c.notification.isReadBy(app.user) }}"
data-container="notification-status"
></span>
</li> </li>
{% endif %} {% if is_granted('CHILL_MAIN_NOTIFICATION_UPDATE', c.notification) %}
{% if is_granted('CHILL_MAIN_NOTIFICATION_SEE', c.notification) %} <li>
<li> <a href="{{ chill_path_add_return_path('chill_main_notification_edit', {'id': c.notification.id}) }}"
<a href="{{ chill_path_add_return_path('chill_main_notification_show', {'id': c.notification.id}) }}" class="btn btn-edit" title="{{ 'Edit'|trans }}"></a>
class="btn {% if not c.notification.isSystem %}btn-show change-icon{% else %}btn-misc{% endif %}" title="{{ 'notification.see_comments_thread'|trans }}"> </li>
{% if not c.notification.isSystem() %} {% endif %}
<i class="fa fa-comment"></i> {% if is_granted('CHILL_MAIN_NOTIFICATION_SEE', c.notification) %}
{% else %} <li>
{{ 'Read more'|trans }} <a href="{{ chill_path_add_return_path('chill_main_notification_show', {'id': c.notification.id}) }}"
{% endif %} class="btn {% if not c.notification.isSystem %}btn-show change-icon{% else %}btn-misc{% endif %}" title="{{ 'notification.see_comments_thread'|trans }}">
</a> {% if not c.notification.isSystem() %}
</li> <i class="fa fa-comment"></i>
{% endif %} {% else %}
</ul> {{ 'Read more'|trans }}
{% endif %}
</a>
</li>
{% endif %}
</ul>
</div>
</div> </div>
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}