diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read.js b/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read.js
new file mode 100644
index 000000000..6d1637494
--- /dev/null
+++ b/src/Bundle/ChillMainBundle/Resources/public/module/notification/toggle_read.js
@@ -0,0 +1,38 @@
+import {createApp} from "vue";
+import NotificationReadToggle from "ChillMainAssets/vuejs/_components/Notification/NotificationReadToggle.vue";
+
+const App = {
+ template: '',
+ components: {
+ NotificationReadToggle,
+ },
+ methods: {
+ onMarkRead() {
+ this.isRead = true;
+ },
+ onMarkUnread() {
+ this.isRead = false;
+ },
+ }
+}
+
+window.addEventListener('DOMContentLoaded', function (e) {
+ document.querySelectorAll('.notification_toggle_read_status')
+ .forEach(function (app) {
+ console.log('app', app);
+ const myApp = Object.assign(App, {
+ data() {
+ return {
+ notificationId: +app.dataset.notificationId,
+ isRead: 1 === +app.dataset.notificationCurrentIsRead,
+ }
+ }
+ })
+
+ createApp(myApp).mount(app);
+ });
+})
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue
new file mode 100644
index 000000000..d88c9916c
--- /dev/null
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Notification/NotificationReadToggle.vue
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/list.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/list.html.twig
index 064adcee1..915f42c25 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/Notification/list.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/list.html.twig
@@ -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 %}
@@ -66,6 +76,9 @@
+ -
+
+
{% if is_granted('CHILL_MAIN_NOTIFICATION_UPDATE', notification) %}
-
diff --git a/src/Bundle/ChillMainBundle/Resources/views/Notification/show.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Notification/show.html.twig
index 86fafd031..4fa354e67 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/Notification/show.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/Notification/show.html.twig
@@ -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 %}
@@ -77,6 +87,9 @@
{{ 'Cancel'|trans|chill_return_path_label }}
+
-
+
+
diff --git a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig
index 07b7970d8..a123ce405 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/layout.html.twig
@@ -106,6 +106,6 @@
});
- {% block js%}{% endblock %}
+ {% block js %}{% endblock %}