aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl/notifications_widget.tpl
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-01-18 11:22:30 +0100
committerMario Vavti <mario@mariovavti.com>2018-01-18 11:22:30 +0100
commit21d081e175ccc3201fe58f44b5aabb98a3c15671 (patch)
treead3120c5b93cf5c48658d5836ce28bbcec988a22 /view/tpl/notifications_widget.tpl
parent647a9b2740f8b51c99909c7c059cad315b4661ba (diff)
downloadvolse-hubzilla-21d081e175ccc3201fe58f44b5aabb98a3c15671.tar.gz
volse-hubzilla-21d081e175ccc3201fe58f44b5aabb98a3c15671.tar.bz2
volse-hubzilla-21d081e175ccc3201fe58f44b5aabb98a3c15671.zip
implement notifications name filter and slightly change the way we load notification to the ui
Diffstat (limited to 'view/tpl/notifications_widget.tpl')
-rw-r--r--view/tpl/notifications_widget.tpl30
1 files changed, 26 insertions, 4 deletions
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index 9d2e08c41..9489e850c 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -65,6 +65,23 @@
$('#nav-{{$notification.type}}-menu [data-thread_top=false]').toggle();
$(this).toggleClass('active sticky-top');
});
+ $(document).on('keyup', '#cn-{{$notification.type}}-input', function(e) {
+ var val = $('#cn-{{$notification.type}}-input').val().toLowerCase();
+
+ if(val)
+ $('#cn-{{$notification.type}}-only').addClass('active sticky-top');
+ else
+ $('#cn-{{$notification.type}}-only').removeClass('active sticky-top');
+
+ $("#nav-{{$notification.type}}-menu .notification").each(function(i, el){
+ var cn = $(el).data('contact_name').toLowerCase();
+
+ if(cn.indexOf(val) === -1)
+ $(this).addClass('d-none');
+ else
+ $(this).removeClass('d-none');
+ });
+ });
{{/if}}
{{/foreach}}
@@ -90,7 +107,7 @@
</div>
<div id="notifications" class="navbar-nav" data-children=".nav-item">
<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}">
+ <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}">
<img class="menu-img-3" data-src="{1}">
<span class="contactname">{2}</span>
<span class="dropdown-sub-text">{3}<br>{4}</span>
@@ -98,11 +115,11 @@
</div>
{{foreach $notifications as $notification}}
<div class="collapse {{$notification.type}}-button">
- <a class="list-group-item" href="#nav-{{$notification.type}}-menu" title="{{$notification.title}}" data-toggle="collapse" data-parent="#notifications" rel="#nav-{{$notification.type}}-menu">
+ <a class="list-group-item" href="#nav-{{$notification.type}}-sub" title="{{$notification.title}}" data-toggle="collapse" data-parent="#notifications" rel="#nav-{{$notification.type}}-menu">
<i class="fa fa-fw fa-{{$notification.icon}}"></i> {{$notification.label}}
<span class="float-right badge badge-{{$notification.severity}} {{$notification.type}}-update"></span>
</a>
- <div id="nav-{{$notification.type}}-menu" class="collapse notification-content" rel="{{$notification.type}}">
+ <div id="nav-{{$notification.type}}-sub" class="collapse notification-content">
{{if $notification.viewall}}
<a class="list-group-item text-dark" id="nav-{{$notification.type}}-see-all" href="{{$notification.viewall.url}}">
<i class="fa fa-fw fa-external-link"></i> {{$notification.viewall.label}}
@@ -117,8 +134,13 @@
<div class="list-group-item cursor-pointer" id="tt-{{$notification.type}}-only">
<i class="fa fa-fw fa-filter"></i> {{$notification.filter.label}}
</div>
+ <div class="list-group-item notifications-textinput" id="cn-{{$notification.type}}-only">
+ <input id="cn-{{$notification.type}}-input" type="text" class="form-control form-control-sm" placeholder="&#xf0b0; Filter by name">
+ </div>
{{/if}}
- {{$loading}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span>
+ <div id="nav-{{$notification.type}}-menu" class="" rel="{{$notification.type}}">
+ {{$loading}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span>
+ </div>
</div>
</div>
{{/foreach}}