notification: small vue component to toggle read status of a notification

This commit is contained in:
2021-12-29 18:51:25 +01:00
parent 8fe94bd117
commit 9ddfd194be
6 changed files with 109 additions and 3 deletions

View File

@@ -2,6 +2,16 @@
{% block title 'notification.List'|trans %}
{% block js %}
{{ parent() }}
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
{% endblock %}
{% block css %}
{{ parent() }}
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
{% endblock %}
{% block content %}
<div id="container content">
<div class="row">
@@ -66,6 +76,9 @@
</div>
<div class="item-row">
<ul class="record_actions">
<li>
<span class="notification_toggle_read_status" data-notification-id="{{ notification.id }}" data-notification-current-is-read="{{ notification.isReadBy(app.user) }}"></span>
</li>
{% if is_granted('CHILL_MAIN_NOTIFICATION_UPDATE', notification) %}
<li>
<a href="{{ chill_path_add_return_path('chill_main_notification_edit', {'id': notification.id}) }}" class="btn btn-edit"></a>

View File

@@ -2,6 +2,16 @@
{% block title 'notification.show notification from %sender%'|trans({ '%sender%': notification.sender|chill_entity_render_string }) %}
{% block js %}
{{ parent() }}
{{ encore_entry_script_tags('mod_notification_toggle_read_status') }}
{% endblock %}
{% block css %}
{{ parent() }}
{{ encore_entry_link_tags('mod_notification_toggle_read_status') }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-10">
@@ -77,6 +87,9 @@
{{ 'Cancel'|trans|chill_return_path_label }}
</a>
</li>
<li>
<span class="notification_toggle_read_status" data-notification-id="{{ notification.id }}" data-notification-current-is-read="1"></span>
</li>
</ul>
</div>
</div>

View File

@@ -106,6 +106,6 @@
});
</script>
{% block js%}<!-- nothing added to js -->{% endblock %}
{% block js %}<!-- nothing added to js -->{% endblock %}
</body>
</html>