1
1
Fork 0

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.
This commit is contained in:
Friendica 2018-04-19 20:54:14 +00:00 committed by Andreas Neustifter
parent 666375fed1
commit 390983a331
6 changed files with 64 additions and 59 deletions

View file

@ -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);
}
/**

View file

@ -1,16 +1,17 @@
<div id="peoplefind-sidebar" class="widget">
<h3>{{$findpeople}}</h3>
<div id="peoplefind-desc">{{$desc}}</div>
<h3>{{$nv.findpeople}}</h3>
<div id="peoplefind-desc">{{$nv.desc}}</div>
<form action="dirfind" method="get" />
<input id="side-peoplefind-url" type="text" name="search" size="24" title="{{$hint|escape:'html'}}" /><input id="side-peoplefind-submit" type="submit" name="submit" value="{{$findthem|escape:'html'}}" />
<input id="side-peoplefind-url" type="text" name="search" size="24" title="{{$nv.hint|escape:'html'}}" /><input id="side-peoplefind-submit" type="submit" name="submit" value="{{$nv.findthem|escape:'html'}}" />
</form>
<div class="side-link" id="side-match-link"><a href="match" >{{$similar}}</a></div>
<div class="side-link" id="side-suggest-link"><a href="suggest" >{{$suggest}}</a></div>
<div class="side-link" id="side-directory-link"><a href="{{$global_dir}}" target="extlink" >{{$directory}}</a></div>
<div class="side-link" id="side-random-profile-link" ><a href="randprof" target="extlink" >{{$random}}</a></div>
{{if $inv}}
<div class="side-link" id="side-invite-link" ><a href="invite" >{{$inv}}</a></div>
<div class="side-link" id="side-match-link"><a href="match" >{{$nv.similar}}</a></div>
<div class="side-link" id="side-suggest-link"><a href="suggest" >{{$nv.suggest}}</a></div>
<div class="side-link" id="side-directory-link"><a href="directory" >{{$nv.local_directory}}</a></div>
<div class="side-link" id="side-directory-link"><a href="{{$nv.global_dir}}" target="extlink" >{{$nv.directory}}</a></div>
<div class="side-link" id="side-random-profile-link" ><a href="randprof" target="extlink" >{{$nv.random}}</a></div>
{{if $nv.inv}}
<div class="side-link" id="side-invite-link" ><a href="invite" >{{$nv.inv}}</a></div>
{{/if}}
</div>

View file

@ -1,22 +1,23 @@
<div id="peoplefind-sidebar" class="widget">
<h3>{{$findpeople}}</h3>
<h3>{{$nv.findpeople}}</h3>
<form action="dirfind" method="get">
{{* The search field *}}
<label for="side-peoplefind-url" id="peoplefind-desc">{{$desc}}</label>
<label for="side-peoplefind-url" id="peoplefind-desc">{{$nv.desc}}</label>
<div class="form-group form-group-search">
<input id="side-peoplefind-url" class="search-input form-control form-search" type="text" name="search" data-toggle="tooltip" title="{{$hint|escape:'html'}}" />
<button id="side-peoplefind-submit" class="btn btn-default btn-sm form-button-search" type="submit">{{$findthem}}</button>
<input id="side-peoplefind-url" class="search-input form-control form-search" type="text" name="search" data-toggle="tooltip" title="{{$nv.hint|escape:'html'}}" />
<button id="side-peoplefind-submit" class="btn btn-default btn-sm form-button-search" type="submit">{{$nv.findthem|escape: 'html'}}</button>
</div>
</form>
{{* Directory links *}}
<div class="side-link" id="side-directory-link"><a href="directory" >{{$nv.local_directory}}</a></div>
<div class="side-link" id="side-directory-link"><a href="{{$nv.global_dir}}" target="extlink" >{{$nv.directory}}</a></div>
{{* Additional links *}}
<div class="side-link" id="side-match-link"><a href="match" >{{$similar}}</a></div>
<div class="side-link" id="side-suggest-link"><a href="suggest" >{{$suggest}}</a></div>
<div class="side-link" id="side-match-link"><a href="match" >{{$nv.similar}}</a></div>
<div class="side-link" id="side-suggest-link"><a href="suggest" >{{$nv.suggest}}</a></div>
{{if $inv}}
<div class="side-link" id="side-invite-link" ><a href="invite" >{{$inv}}</a></div>
{{if $nv.inv}}
<div class="side-link" id="side-invite-link" ><a href="invite" >{{$nv.inv}}</a></div>
{{/if}}
</div>

View file

@ -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;

View file

@ -39,17 +39,7 @@
{{/if}}
{{if $nv}}
<div id="right_friends" class="widget">
<h3>{{$nv.title.1}}</h3>
<ul role="menu">
<li class="tool" role="menuitem"><a class="{{$nv.directory.2}}" href="{{$nv.directory.0}}" title="{{$nv.directory.3}}" >{{$nv.directory.1}}</a></li>
<li class="tool" role="menuitem"><a class="{{$nv.global_directory.2}}" href="{{$nv.global_directory.0}}" target="blank" title="{{$nv.global_directory.3}}" >{{$nv.global_directory.1}}</a></li>
<li class="tool" role="menuitem"><a class="{{$nv.match.2}}" href="{{$nv.match.0}}" title="{{$nv.match.3}}" >{{$nv.match.1}}</a></li>
<li class="tool" role="menuitem"><a class="{{$nv.suggest.2}}" href="{{$nv.suggest.0}}" title="{{$nv.suggest.3}}" >{{$nv.suggest.1}}</a></li>
<li class="tool" role="menuitem"><a class="{{$nv.invite.2}}" href="{{$nv.invite.0}}" title="{{$nv.invite.3}}" >{{$nv.invite.1}}</a></li>
</ul>
{{$nv.search}}
</div>
{{include file='peoplefind.tpl' nv=$nv}}
{{/if}}
{{if $lastusers_title}}

View file

@ -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'] = '<form name="simple_bar" method="get" action="dirfind">
<span class="sbox_l"></span>
<span class="sbox">
<input type="text" name="search" size="13" maxlength="50">
</span>
<span class="sbox_r" id="srch_clear"></span>';
$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;
}