aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Widget/Activity_filter.php17
-rw-r--r--include/features.php11
-rw-r--r--view/css/widgets.css1
-rw-r--r--view/js/mod_network.js3
-rw-r--r--view/tpl/activity_filter_widget.tpl10
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>