From 390983a3312b14c3c122740bb7141426214cb33e Mon Sep 17 00:00:00 2001 From: Friendica Date: Thu, 19 Apr 2018 20:54:14 +0000 Subject: [PATCH] Haromonize Find People Widget. In the right_aside on the /contacts page in the left aside there are almost identical widgets to search for contacts. Drop one and use common widget in both places. --- src/Content/Widget.php | 31 ++++++++++++--------- view/templates/peoplefind.tpl | 19 +++++++------ view/theme/frio/templates/peoplefind.tpl | 21 +++++++------- view/theme/vier/style.css | 15 ++++++++-- view/theme/vier/templates/communityhome.tpl | 12 +------- view/theme/vier/theme.php | 25 ++++++++--------- 6 files changed, 64 insertions(+), 59 deletions(-) diff --git a/src/Content/Widget.php b/src/Content/Widget.php index 058a7a1fb..04dfbb8e0 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -55,19 +55,24 @@ class Widget } } - return replace_macros(get_markup_template('peoplefind.tpl'), array( - '$findpeople' => L10n::t('Find People'), - '$desc' => L10n::t('Enter name or interest'), - '$label' => L10n::t('Connect/Follow'), - '$hint' => L10n::t('Examples: Robert Morgenstein, Fishing'), - '$findthem' => L10n::t('Find'), - '$suggest' => L10n::t('Friend Suggestions'), - '$similar' => L10n::t('Similar Interests'), - '$random' => L10n::t('Random Profile'), - '$inv' => L10n::t('Invite Friends'), - '$directory' => L10n::t('View Global Directory'), - '$global_dir' => $global_dir - )); + $nv = []; + $nv['findpeople'] = L10n::t('Find People'); + $nv['desc'] = L10n::t('Enter name or interest'); + $nv['label'] = L10n::t('Connect/Follow'); + $nv['hint'] = L10n::t('Examples: Robert Morgenstein, Fishing'); + $nv['findthem'] = L10n::t('Find'); + $nv['suggest'] = L10n::t('Friend Suggestions'); + $nv['similar'] = L10n::t('Similar Interests'); + $nv['random'] = L10n::t('Random Profile'); + $nv['inv'] = L10n::t('Invite Friends'); + $nv['directory'] = L10n::t('Global Directory'); + $nv['global_dir'] = $global_dir; + $nv['local_directory'] = L10n::t('Local Directory'); + + $aside = []; + $aside['$nv'] = $nv; + + return replace_macros(get_markup_template('peoplefind.tpl'), $aside); } /** diff --git a/view/templates/peoplefind.tpl b/view/templates/peoplefind.tpl index 481bdd71e..67f7a8086 100644 --- a/view/templates/peoplefind.tpl +++ b/view/templates/peoplefind.tpl @@ -1,16 +1,17 @@
-

{{$findpeople}}

-
{{$desc}}
+

{{$nv.findpeople}}

+
{{$nv.desc}}
- +
- - - - - {{if $inv}} - + + + + + + {{if $nv.inv}} + {{/if}}
diff --git a/view/theme/frio/templates/peoplefind.tpl b/view/theme/frio/templates/peoplefind.tpl index 5a84f26c8..f5bf57c02 100644 --- a/view/theme/frio/templates/peoplefind.tpl +++ b/view/theme/frio/templates/peoplefind.tpl @@ -1,22 +1,23 @@ -
-

{{$findpeople}}

+

{{$nv.findpeople}}

{{* The search field *}} - +
+ {{* Directory links *}} + + {{* Additional links *}} - - + + - {{if $inv}} - + {{if $nv.inv}} + {{/if}}
- diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index 507b4b570..710c76f6a 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -1153,9 +1153,9 @@ aside #profiles-menu { left: 10px; } -aside #search-text, aside #side-follow-url, aside #side-peoplefind-url, right_aside input { - width: 140px; - height: 17px; +aside #search-text, aside #side-follow-url, aside #side-peoplefind-url, right_aside #side-peoplefind-url { + width: 65%; + float: left; padding-left: 10px; /*border-top-left-radius: 15px; border-top-right-radius: 15px; @@ -1167,6 +1167,15 @@ aside #search-text, aside #side-follow-url, aside #side-peoplefind-url, right_as -moz-border-right-colors: #dbdbdb;*/ } +aside #side-peoplefind-submit, right_aside #side-peoplefind-submit { + width: 25%; + float: right; +} + +#side-match-link { + clear: both; +} + aside h4, right_aside h4 { margin-bottom: 0px; margin-top: 0px; diff --git a/view/theme/vier/templates/communityhome.tpl b/view/theme/vier/templates/communityhome.tpl index a85b4419f..b32b63804 100644 --- a/view/theme/vier/templates/communityhome.tpl +++ b/view/theme/vier/templates/communityhome.tpl @@ -39,17 +39,7 @@ {{/if}} {{if $nv}} -
-

{{$nv.title.1}}

- -{{$nv.search}} -
+{{include file='peoplefind.tpl' nv=$nv}} {{/if}} {{if $lastusers_title}} diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php index e758cb651..c75259465 100644 --- a/view/theme/vier/theme.php +++ b/view/theme/vier/theme.php @@ -196,19 +196,18 @@ function vier_community_info() //right_aside FIND FRIENDS if ($show_friends && local_user()) { $nv = []; - $nv['title'] = ["", L10n::t('Find Friends'), "", ""]; - $nv['directory'] = ['directory', L10n::t('Local Directory'), "", ""]; - $nv['global_directory'] = [get_server(), L10n::t('Global Directory'), "", ""]; - $nv['match'] = ['match', L10n::t('Similar Interests'), "", ""]; - $nv['suggest'] = ['suggest', L10n::t('Friend Suggestions'), "", ""]; - $nv['invite'] = ['invite', L10n::t('Invite Friends'), "", ""]; - - $nv['search'] = '
- - - - - '; + $nv['findpeople'] = L10n::t('Find People'); + $nv['desc'] = L10n::t('Enter name or interest'); + $nv['label'] = L10n::t('Connect/Follow'); + $nv['hint'] = L10n::t('Examples: Robert Morgenstein, Fishing'); + $nv['findthem'] = L10n::t('Find'); + $nv['suggest'] = L10n::t('Friend Suggestions'); + $nv['similar'] = L10n::t('Similar Interests'); + $nv['random'] = L10n::t('Random Profile'); + $nv['inv'] = L10n::t('Invite Friends'); + $nv['directory'] = L10n::t('Global Directory'); + $nv['global_dir'] = get_server(); + $nv['local_directory'] = L10n::t('Local Directory'); $aside['$nv'] = $nv; }