diff options
Diffstat (limited to 'view')
-rw-r--r-- | view/js/main.js | 22 | ||||
-rw-r--r-- | view/pdl/mod_network.pdl | 3 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 8 | ||||
-rwxr-xr-x | view/tpl/common_pills.tpl | 3 | ||||
-rw-r--r-- | view/tpl/notifications_widget.tpl | 14 | ||||
-rwxr-xr-x | view/tpl/settings.tpl | 1 |
6 files changed, 45 insertions, 6 deletions
diff --git a/view/js/main.js b/view/js/main.js index 63ab938f0..45c412296 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -420,6 +420,14 @@ function notificationsUpdate(cached_data) { // Put the object into storage sessionStorage.setItem('notifications_cache', JSON.stringify(data)); + var fnotifs = []; + if(data.forums) { + $.each(data.forums_sub, function() { + fnotifs.push(this); + }); + handleNotificationsItems('forums', fnotifs); + } + if(data.invalid == 1) { window.location.href=window.location.href; } @@ -495,13 +503,13 @@ function handleNotifications(data) { } function handleNotificationsItems(notifyType, data) { - var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html()); + var notifications_tpl = ((notifyType == 'forums') ? unescape($("#nav-notifications-forums-template[rel=template]").html()) : unescape($("#nav-notifications-template[rel=template]").html())); var notify_menu = $("#nav-" + notifyType + "-menu"); notify_menu.html(''); $(data).each(function() { - html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top); + html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top,this.unseen,this.private_forum); notify_menu.append(html); }); @@ -812,6 +820,15 @@ function updateInit() { if (initialLoad && (sessionStorage.getItem('notifications_cache') !== null)) { var cached_data = JSON.parse(sessionStorage.getItem('notifications_cache')); notificationsUpdate(cached_data); + + var fnotifs = []; + if(cached_data.forums) { + $.each(cached_data.forums_sub, function() { + fnotifs.push(this); + }); + handleNotificationsItems('forums', fnotifs); + } + } if(! src) { @@ -1022,6 +1039,7 @@ function loadNotificationItems(notifyType) { } console.log('updating ' + notifyType + ' notifications...'); + $.get(pingExCmd, function(data) { if(data.invalid == 1) { window.location.href=window.location.href; diff --git a/view/pdl/mod_network.pdl b/view/pdl/mod_network.pdl index d26422093..a4bdf0a9f 100644 --- a/view/pdl/mod_network.pdl +++ b/view/pdl/mod_network.pdl @@ -1,9 +1,8 @@ [region=aside] [widget=activity_order][/widget] [widget=activity_filter][/widget] -[widget=forums][/widget] -[widget=suggestions][/widget] [widget=savedsearch][/widget] +[widget=suggestions][/widget] [widget=notes][/widget] [/region] diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 002fa700a..87c97f1f5 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -593,7 +593,8 @@ footer { background-color: $comment_item_colour; } -#nav-notifications-template { +#nav-notifications-template, +#nav-notifications-forums-template { display: none; } @@ -837,6 +838,11 @@ div.jGrowl div.jGrowl-notification { white-space: nowrap; } +.notification.notification-forum { + font-size: 0.9rem; + color: $font_colour; +} + #acl-search::-webkit-input-placeholder { /* non-fontawesome fonts set a fallback for text parts of the placeholder*/ font-family: ForkAwesome, sans-serif, arial, freesans; diff --git a/view/tpl/common_pills.tpl b/view/tpl/common_pills.tpl index 8f4381f3d..e2b018d26 100755 --- a/view/tpl/common_pills.tpl +++ b/view/tpl/common_pills.tpl @@ -3,6 +3,7 @@ <li class="nav-item hover-fx-show"{{if $p.id}} id="{{$p.id}}"{{/if}}> <a class="nav-link{{if $p.sel}} {{$p.sel}}{{/if}}" href="{{$p.url}}"{{if $p.title}} title="{{$p.title}}"{{/if}}{{if $p.sub}} onclick="{{if $p.sel}}closeOpen('{{$p.id}}_sub');{{else}}openClose('{{$p.id}}_sub');{{/if}} return false;"{{/if}}> {{if $p.icon}}<i class="fa fa-fw fa-{{$p.icon}}"></i>{{/if}} + {{if $p.img}}<img class="menu-img-1" src="{{$p.img}}">{{/if}} {{$p.label}} {{if $p.sub}}<i class="fa fa-fw fa-caret-down hover-fx-hide"></i>{{/if}} </a> @@ -12,7 +13,9 @@ <li class="nav-item"{{if $ps.id}} id="{{$ps.id}}"{{/if}}> <a class="nav-link{{if $ps.sel}} {{$ps.sel}}{{/if}}" href="{{$ps.url}}"{{if $ps.title}} title="{{$ps.title}}"{{/if}}> {{if $ps.icon}}<i class="fa fa-fw fa-{{$ps.icon}}"></i>{{/if}} + {{if $ps.img}}<img class="menu-img-1" src="{{$ps.img}}">{{/if}} {{$ps.label}} + {{if $ps.lock}}<i class="fa fa-{{$ps.lock}} text-muted"></i>{{/if}} </a> </li> {{/foreach}} diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 215fddd08..068441997 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -127,12 +127,20 @@ {{$no_notifications}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span> </div> <div id="nav-notifications-template" rel="template"> - <a class="list-group-item clearfix notification {5}" href="{0}" title="{2} {3}" data-b64mid="{6}" data-notify_id="{7}" data-thread_top="{8}" data-contact_name="{2}"> + <a class="list-group-item clearfix notification {5}" href="{0}" title="{2}" data-b64mid="{6}" data-notify_id="{7}" data-thread_top="{8}" data-contact_name="{2}"> <img class="menu-img-3" data-src="{1}"> <span class="contactname">{2}</span> <span class="dropdown-sub-text">{3}<br>{4}</span> </a> </div> + <div id="nav-notifications-forums-template" rel="template"> + <a class="list-group-item clearfix notification notification-forum" href="{0}" title="{3}" data-b64mid="{6}" data-notify_id="{7}" data-thread_top="{8}" data-contact_name="{2}"> + <span class="float-right badge badge-{{$notification.severity}}">{9}</span> + <img class="menu-img-1" src="{1}"> + <span class="">{2}</span> + <i class="fa fa-{10} text-muted"></i> + </a> + </div> <div id="notifications" class="navbar-nav"> {{foreach $notifications as $notification}} <div class="collapse {{$notification.type}}-button"> @@ -152,15 +160,19 @@ </div> {{/if}} {{if $notification.filter}} + {{if $notification.filter.posts_label}} <div class="list-group-item cursor-pointer" id="tt-{{$notification.type}}-only"> <i class="fa fa-fw fa-filter"></i> {{$notification.filter.posts_label}} </div> + {{/if}} + {{if $notification.filter.name_label}} <div class="list-group-item clearfix notifications-textinput" id="cn-{{$notification.type}}-only"> <div class="text-muted notifications-textinput-filter"><i class="fa fa-fw fa-filter"></i></div> <input id="cn-{{$notification.type}}-input" type="text" class="form-control form-control-sm" placeholder="{{$notification.filter.name_label}}"> <div id="cn-{{$notification.type}}-input-clear" class="text-muted notifications-textinput-clear d-none"><i class="fa fa-times"></i></div> </div> {{/if}} + {{/if}} <div id="nav-{{$notification.type}}-menu" class=""> {{$loading}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span> </div> diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl index b5e871c36..3a05ea828 100755 --- a/view/tpl/settings.tpl +++ b/view/tpl/settings.tpl @@ -147,6 +147,7 @@ {{include file="field_intcheckbox.tpl" field=$vnotify13}} {{/if}} {{include file="field_intcheckbox.tpl" field=$vnotify14}} + {{include file="field_intcheckbox.tpl" field=$vnotify15}} {{include file="field_intcheckbox.tpl" field=$always_show_in_notices}} {{include file="field_input.tpl" field=$evdays}} </div> |