Add follow/unfollow link to the contact actions menu
This commit is contained in:
parent
ae5dde9f5e
commit
d5b29b1c61
4 changed files with 25 additions and 1 deletions
|
@ -415,6 +415,24 @@ class Profile extends BaseModule
|
|||
|
||||
$formSecurityToken = self::getFormSecurityToken('contact_action');
|
||||
|
||||
if ($localRelationship->rel & Contact::SHARING) {
|
||||
$contact_actions['unfollow'] = [
|
||||
'label' => $this->t('Unfollow'),
|
||||
'url' => 'contact/unfollow?url=' . urlencode($contact['url']) . '&auto=1',
|
||||
'title' => '',
|
||||
'sel' => '',
|
||||
'id' => 'unfollow',
|
||||
];
|
||||
} else {
|
||||
$contact_actions['follow'] = [
|
||||
'label' => $this->t('Follow'),
|
||||
'url' => 'contact/follow?url=' . urlencode($contact['url']) . '&auto=1',
|
||||
'title' => '',
|
||||
'sel' => '',
|
||||
'id' => 'follow',
|
||||
];
|
||||
}
|
||||
|
||||
// Provide friend suggestion only for Friendica contacts
|
||||
if ($contact['network'] === Protocol::DFRN) {
|
||||
$contact_actions['suggest'] = [
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
<a class="btn" rel="#contact-actions-menu" href="#" id="contact-edit-actions-button">{{$contact_action_button}}</a>
|
||||
|
||||
<ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup">
|
||||
{{if $contact_actions.follow}}<li role="menuitem"><a href="{{$contact_actions.follow.url}}" title="{{$contact_actions.follow.title}}">{{$contact_actions.follow.label}}</a></li>{{/if}}
|
||||
{{if $contact_actions.unfollow}}<li role="menuitem"><a href="{{$contact_actions.unfollow.url}}" title="{{$contact_actions.unfollow.title}}">{{$contact_actions.unfollow.label}}</a></li>{{/if}}
|
||||
{{if $lblsuggest}}<li role="menuitem"><a href="{{$contact_actions.suggest.url}}" title="{{$contact_actions.suggest.title}}">{{$contact_actions.suggest.label}}</a></li>{{/if}}
|
||||
{{if $poll_enabled}}<li role="menuitem"><a href="{{$contact_actions.update.url}}" title="{{$contact_actions.update.title}}">{{$contact_actions.update.label}}</a></li>{{/if}}
|
||||
{{if $contact_actions.updateprofile}}<li role="menuitem"><a href="{{$contact_actions.updateprofile.url}}" title="{{$contact_actions.updateprofile.title}}">{{$contact_actions.updateprofile.label}}</a></li>{{/if}}
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
</button>
|
||||
|
||||
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="contact-edit-actions-button" aria-haspopup="true" id="contact-actions-menu">
|
||||
{{if $contact_actions.follow}}<li role="presentation"><a role="menuitem" href="{{$contact_actions.follow.url}}" title="{{$contact_actions.follow.title}}">{{$contact_actions.follow.label}}</a></li>{{/if}}
|
||||
{{if $contact_actions.unfollow}}<li role="presentation"><a role="menuitem" href="{{$contact_actions.unfollow.url}}" title="{{$contact_actions.unfollow.title}}">{{$contact_actions.unfollow.label}}</a></li>{{/if}}
|
||||
{{if $lblsuggest}}<li role="presentation"><a role="menuitem" href="{{$contact_actions.suggest.url}}" title="{{$contact_actions.suggest.title}}">{{$contact_actions.suggest.label}}</a></li>{{/if}}
|
||||
{{if $poll_enabled}}<li role="presentation"><a role="menuitem" href="{{$contact_actions.update.url}}" title="{{$contact_actions.update.title}}">{{$contact_actions.update.label}}</a></li>{{/if}}
|
||||
{{if $contact_actions.updateprofile}}<li role="presentation"><a role="menuitem" href="{{$contact_actions.updateprofile.url}}" title="{{$contact_actions.updateprofile.title}}">{{$contact_actions.updateprofile.label}}</a></li>{{/if}}
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
<a class="btn" id="contact-edit-actions-button">{{$contact_action_button}}</a>
|
||||
|
||||
<ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup">
|
||||
{{if $contact_actions.follow}}<li role="menuitem"><a href="{{$contact_actions.follow.url}}" title="{{$contact_actions.follow.title}}">{{$contact_actions.follow.label}}</a></li>{{/if}}
|
||||
{{if $contact_actions.unfollow}}<li role="menuitem"><a href="{{$contact_actions.unfollow.url}}" title="{{$contact_actions.unfollow.title}}">{{$contact_actions.unfollow.label}}</a></li>{{/if}}
|
||||
{{if $lblsuggest}}<li role="menuitem"><a href="{{$contact_actions.suggest.url}}" title="{{$contact_actions.suggest.title}}">{{$contact_actions.suggest.label}}</a></li>{{/if}}
|
||||
{{if $poll_enabled}}<li role="menuitem"><a href="{{$contact_actions.update.url}}" title="{{$contact_actions.update.title}}">{{$contact_actions.update.label}}</a></li>{{/if}}
|
||||
{{if $contact_actions.updateprofile}}<li role="menuitem"><a href="{{$contact_actions.updateprofile.url}}" title="{{$contact_actions.updateprofile.title}}">{{$contact_actions.updateprofile.label}}</a></li>{{/if}}
|
||||
|
|
Loading…
Reference in a new issue