aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-07-07 13:24:26 +0000
committerMario <mario@mariovavti.com>2024-07-07 13:24:26 +0000
commit2ddc0875128e17a9e36393974d721f19ccbe64e3 (patch)
treefa799b1fdf8bdd4083dd190516a56d7151efba19 /view/tpl
parentb0fe94b4b33126d0bfb1c10869262d47e31a337d (diff)
downloadvolse-hubzilla-2ddc0875128e17a9e36393974d721f19ccbe64e3.tar.gz
volse-hubzilla-2ddc0875128e17a9e36393974d721f19ccbe64e3.tar.bz2
volse-hubzilla-2ddc0875128e17a9e36393974d721f19ccbe64e3.zip
notifications: provide possibility to only display system notofications
Diffstat (limited to 'view/tpl')
-rw-r--r--view/tpl/notifications_widget.tpl45
1 files changed, 25 insertions, 20 deletions
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index a9d98dae9..30547da97 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -5,6 +5,7 @@
var sse_partial_result = false;
var sse_rmids = [];
var sse_fallback_interval;
+ var sse_sys_only = {{$sys_only}};
$(document).ready(function() {
let notifications_parent;
@@ -219,8 +220,9 @@
}
function sse_bs_counts() {
- if(sse_bs_active)
+ if(sse_bs_active || sse_sys_only) {
return;
+ }
sse_bs_active = true;
@@ -238,10 +240,11 @@
function sse_bs_notifications(e, replace, followup) {
- if(sse_bs_active)
+ if(sse_bs_active || sse_sys_only) {
return;
+ }
- var manual = false;
+ let manual = false;
if(typeof replace === 'undefined')
replace = e.data.replace;
@@ -302,9 +305,23 @@
function sse_handleNotifications(obj, replace, followup) {
- var primary_notifications = ['dm', 'home', 'intros', 'register', 'notify', 'files'];
- var secondary_notifications = ['network', 'forums', 'all_events', 'pubs'];
- var all_notifications = primary_notifications.concat(secondary_notifications);
+ // notice and info
+
+ if(obj.notice) {
+ $(obj.notice.notifications).each(function() {
+ toast(this, 'danger');
+ });
+ }
+
+ if(obj.info) {
+ $(obj.info.notifications).each(function(){
+ toast(this, 'info');
+ });
+ }
+
+ let primary_notifications = ['dm', 'home', 'intros', 'register', 'notify', 'files'];
+ let secondary_notifications = ['network', 'forums', 'all_events', 'pubs'];
+ let all_notifications = primary_notifications.concat(secondary_notifications);
all_notifications.forEach(function(type, index) {
if(typeof obj[type] === typeof undefined)
@@ -336,20 +353,6 @@
sse_setNotificationsStatus();
- // notice and info
-
- if(obj.notice) {
- $(obj.notice.notifications).each(function() {
- toast(this, 'danger');
- });
- }
-
- if(obj.info) {
- $(obj.info.notifications).each(function(){
- toast(this, 'info');
- });
- }
-
// load more notifications if visible notifications count becomes low
if(sse_type && sse_offset != -1 && $('#nav-' + sse_type + '-menu').children(':not(.tt-filter-active)').length < 15) {
sse_bs_notifications(sse_type, false, true);
@@ -533,6 +536,7 @@
}
</script>
+{{if !$sys_only}}
<div id="notifications_wrapper" class="mb-4">
<div id="no_notifications" class="d-xl-none">
{{$no_notifications}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span>
@@ -604,3 +608,4 @@
{{/foreach}}
</div>
</div>
+{{/if}}