diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-06-08 23:03:05 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-06-08 23:03:05 +0200 |
commit | 468af29e3e4fb5c59f44afe8e870e21b66153992 (patch) | |
tree | f92f91af92b761c5ee6733364596f395e00c098f | |
parent | 7c98aea52497ebbdd1880d98b0dbc26c32eaca39 (diff) | |
download | volse-hubzilla-468af29e3e4fb5c59f44afe8e870e21b66153992.tar.gz volse-hubzilla-468af29e3e4fb5c59f44afe8e870e21b66153992.tar.bz2 volse-hubzilla-468af29e3e4fb5c59f44afe8e870e21b66153992.zip |
new feature filter network by name
-rw-r--r-- | Zotlabs/Widget/Activity_filter.php | 17 | ||||
-rw-r--r-- | include/features.php | 11 | ||||
-rw-r--r-- | view/css/widgets.css | 1 | ||||
-rw-r--r-- | view/js/mod_network.js | 3 | ||||
-rw-r--r-- | view/tpl/activity_filter_widget.tpl | 10 |
5 files changed, 40 insertions, 2 deletions
diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php index 32da20bf6..78e439fdd 100644 --- a/Zotlabs/Widget/Activity_filter.php +++ b/Zotlabs/Widget/Activity_filter.php @@ -154,6 +154,20 @@ class Activity_filter { ]; } + $name = []; + if(feature_enabled(local_channel(),'name_tab')) { + if(x($_GET,'cid') && ! x($_GET,'pf')) { + $filter_active = 'name'; + } + $name = [ + 'label' => x($_GET,'name') ? $_GET['name'] : t('Filter by name'), + 'icon' => 'filter', + 'url'=> z_root() . '/' . $cmd . '/', + 'sel'=> $filter_active == 'name' ? 'is-valid' : '', + 'title' => '' + ]; + } + $reset = []; if($filter_active) { $reset = [ @@ -179,7 +193,8 @@ class Activity_filter { $o .= replace_macros(get_markup_template('activity_filter_widget.tpl'), [ '$title' => t('Activity Filters'), '$reset' => $reset, - '$content' => $content + '$content' => $content, + '$name' => $name ]); } diff --git a/include/features.php b/include/features.php index bcdea73e0..03f50c9a4 100644 --- a/include/features.php +++ b/include/features.php @@ -395,6 +395,15 @@ function get_features($filtered = true, $level = (-1)) { ], [ + 'name_tab', + t('Contact Filter'), + t('Ability to display only posts of a selected contact'), + false, + get_config('feature_lock','name_tab'), + feature_level('name_tab',1), + ], + + [ 'forums_tab', t('Forum Filter'), t('Ability to display only posts of a specific forum'), @@ -406,7 +415,7 @@ function get_features($filtered = true, $level = (-1)) { [ 'personal_tab', t('Personal Posts Filter'), - t('Ability to display only Network posts that you\'ve interacted on'), + t('Ability to display only posts that you\'ve interacted on'), false, get_config('feature_lock','personal_tab'), feature_level('personal_tab',1), diff --git a/view/css/widgets.css b/view/css/widgets.css index 9730d6915..e330c38e1 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -182,6 +182,7 @@ a.wikilist { .notifications-textinput { padding: .75rem 0.85rem; + position: relative; } .notifications-textinput input { diff --git a/view/js/mod_network.js b/view/js/mod_network.js index 2899bbacd..734e572bb 100644 --- a/view/js/mod_network.js +++ b/view/js/mod_network.js @@ -1,4 +1,7 @@ $(document).ready(function() { $("#search-text").contact_autocomplete(baseurl + '/search_ac','',true); + $("#cid-filter").name_autocomplete(baseurl + '/acl', 'a', true, function(data) { + $("#cid").val(data.id); + }); }); diff --git a/view/tpl/activity_filter_widget.tpl b/view/tpl/activity_filter_widget.tpl index 7ff5a4f7e..1b1e2c880 100644 --- a/view/tpl/activity_filter_widget.tpl +++ b/view/tpl/activity_filter_widget.tpl @@ -8,4 +8,14 @@ {{/if}} </h3> {{$content}} + {{if $name}} + <div class="notifications-textinput"> + <form method="get" action="{{$name.url}}" role="search"> + <div class="text-muted notifications-textinput-filter"><i class="fa fa-fw fa-filter"></i></div> + <input id="cid" type="hidden" value="" name="cid" /> + <input id="cid-filter" class="form-control form-control-sm{{if $name.sel}} {{$name.sel}}{{/if}}" type="text" value="" placeholder="{{$name.label}}" name="name" title="" /> + </form> + </div> + {{/if}} + </div> |