[RemoteFollow] Fix location display

This commit is contained in:
Alexei Sorokin 2020-07-22 19:49:24 +03:00 committed by Diogo Peralta Cordeiro
parent 2894eb9ed2
commit b79d97c4e1

View File

@ -100,12 +100,14 @@ class RemoteFollowSubAction extends Action
$this->elementStart('ul', 'form_data');
$this->elementStart('li');
$this->input('profile',
$this->input(
'profile',
// TRANS: Field label for a field that takes an user address.
_m('Subscribe to'),
$this->uri,
// TRANS: Tooltip for field label "Subscribe to".
_m('User\'s address, like nickname@example.com or http://example.net/nickname.'));
_m('User\'s address, like nickname@example.com or http://example.net/nickname.')
);
$this->elementEnd('li');
$this->elementEnd('ul');
// TRANS: Button text.
@ -138,13 +140,15 @@ class RemoteFollowSubAction extends Action
$this->elementStart('fieldset');
$this->hidden('token', common_session_token());
$this->hidden('profile', $this->uri);
$this->submit('submit',
$this->submit(
'submit',
// TRANS: Button text.
_m('BUTTON', 'Confirm'),
'submit',
null,
// TRANS: Tooltip for button "Confirm".
_m('Subscribe to this user'));
_m('Subscribe to this user')
);
$this->elementEnd('fieldset');
$this->elementEnd('form');
$this->elementEnd('li');
@ -160,10 +164,12 @@ class RemoteFollowSubAction extends Action
public function preview(): bool
{
if ($this->scoped->isSubscribed($this->profile)) {
$this->element('div',
$this->element(
'div',
['class' => 'error'],
// TRANS: Extra paragraph in remote profile view when already subscribed.
_m('You are already subscribed to this user.'));
_m('You are already subscribed to this user.')
);
$ok = false;
} else {
$ok = true;
@ -171,10 +177,12 @@ class RemoteFollowSubAction extends Action
$avatarUrl = $this->profile->avatarUrl(AVATAR_PROFILE_SIZE);
$this->showEntity($this->profile,
$this->showEntity(
$this->profile,
$this->profile->getUrl(),
$avatarUrl,
$this->profile->getDescription());
$this->profile->getDescription()
);
return $ok;
}
@ -209,9 +217,10 @@ class RemoteFollowSubAction extends Action
$this->elementEnd('div');
}
if (!is_null($location)) {
$location_name = (is_null($location) ? null : $location->getName());
if (!is_null($location_name)) {
$this->elementStart('div', 'label entity_location');
$this->text($location);
$this->text($location_name);
$this->elementEnd('div');
}
@ -373,7 +382,7 @@ class RemoteFollowSubAction extends Action
*
* @return string
*/
function selfLink(): string
public function selfLink(): string
{
return common_local_url('RemoteFollowSub');
}