Merge branch 'showgroup-button' into better-navigation

This commit is contained in:
Jakobus Schürz 2023-10-01 22:59:27 +02:00
commit f8a1b7ea56
5 changed files with 18 additions and 2 deletions

View file

@ -68,6 +68,7 @@ class VCard
$follow_link = ''; $follow_link = '';
$unfollow_link = ''; $unfollow_link = '';
$wallmessage_link = ''; $wallmessage_link = '';
$showgroup_link = '';
$photo = Contact::getPhoto($contact); $photo = Contact::getPhoto($contact);
@ -99,6 +100,10 @@ class VCard
if (in_array($rel, [Contact::FOLLOWER, Contact::FRIEND]) && Contact::canReceivePrivateMessages($contact)) { if (in_array($rel, [Contact::FOLLOWER, Contact::FRIEND]) && Contact::canReceivePrivateMessages($contact)) {
$wallmessage_link = 'message/new/' . $id; $wallmessage_link = 'message/new/' . $id;
} }
if (in_array($rel, [Contact::SHARING])) {
$showgroup_link = 'network/group/' . $id;
}
} }
return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [ return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [
@ -121,6 +126,8 @@ class VCard
'$wallmessage_link' => $wallmessage_link, '$wallmessage_link' => $wallmessage_link,
'$mentioning' => DI::l10n()->t('Mention'), '$mentioning' => DI::l10n()->t('Mention'),
'$post2group' => DI::l10n()->t('Post to group'), '$post2group' => DI::l10n()->t('Post to group'),
'$showgroup' => DI::l10n()->t('Show group'),
'$showgroup_link' => $showgroup_link,
]); ]);
} }
} }

View file

@ -1246,9 +1246,9 @@ class Contact
'network' => [DI::l10n()->t('Network Posts'), $posts_link, false], 'network' => [DI::l10n()->t('Network Posts'), $posts_link, false],
'edit' => [DI::l10n()->t('View Contact'), $contact_url, false], 'edit' => [DI::l10n()->t('View Contact'), $contact_url, false],
'pm' => [DI::l10n()->t('Send PM'), $pm_url, false], 'pm' => [DI::l10n()->t('Send PM'), $pm_url, false],
'mention' => [DI::l10n()->t('Mention'), DI::l10n()->t('Post to group'), $mention_url, false],
'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link, true], 'follow' => [DI::l10n()->t('Connect/Follow'), $follow_link, true],
'unfollow' => [DI::l10n()->t('Unfollow'), $unfollow_link, true], 'unfollow' => [DI::l10n()->t('Unfollow'), $unfollow_link, true],
'mention' => [DI::l10n()->t('Mention'), DI::l10n()->t('Post to group'), $mention_url, false],
'group' => [DI::l10n()->t('View group'), $group_link, $contact['forum'], true], 'group' => [DI::l10n()->t('View group'), $group_link, $contact['forum'], true],
'self' => [$self], 'self' => [$self],
]; ];

View file

@ -2963,4 +2963,4 @@ $a->strings['Last users'] = 'Letzte Nutzer';
$a->strings['Quick Start'] = 'Schnell-Start'; $a->strings['Quick Start'] = 'Schnell-Start';
$a->strings['Mention'] = 'Erwähne'; $a->strings['Mention'] = 'Erwähne';
$a->strings['Post to group'] = 'In Gruppe posten'; $a->strings['Post to group'] = 'In Gruppe posten';
$a->strings['View group'] = 'Zeige Gruppe';

View file

@ -25,6 +25,7 @@
{{if $profile.addr && !$profile.actions.self}}<a class="btn btn-labeled btn-primary btn-sm" href="{{$profile.actions.mention.2}}" aria-label="{{if $profile.actions.group.2==1}}{{$profile.actions.mention.1}}{{else}}{{$profile.actions.mention.0}}{{/if}}" title="{{$profile.actions.rel.0}}{{if $profile.actions.group.2==1}}{{$profile.actions.mention.1}}{{else}}{{$profile.actions.mention.0}}{{/if}}"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a>{{/if}} {{if $profile.addr && !$profile.actions.self}}<a class="btn btn-labeled btn-primary btn-sm" href="{{$profile.actions.mention.2}}" aria-label="{{if $profile.actions.group.2==1}}{{$profile.actions.mention.1}}{{else}}{{$profile.actions.mention.0}}{{/if}}" title="{{$profile.actions.rel.0}}{{if $profile.actions.group.2==1}}{{$profile.actions.mention.1}}{{else}}{{$profile.actions.mention.0}}{{/if}}"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a>{{/if}}
</div> </div>
<div class="hover-card-actions-connection"> <div class="hover-card-actions-connection">
{{if $profile.actions.group.2==1}}<a class="btn btn-labeled btn-primary btn-sm" href="{{$profile.actions.group.1}}" aria-label="{{$profile.actions.group.0}}" title="{{$profile.actions.group.0}}"><i class="fa fa-group" aria-hidden="true"></i></a>{{/if}}
{{if $profile.actions.network}}<a class="btn btn-labeled btn-primary btn-sm" href="{{$profile.actions.network.1}}" aria-label="{{$profile.actions.network.0}}" title="{{$profile.actions.network.0}}"><i class="fa fa-cloud" aria-hidden="true"></i></a>{{/if}} {{if $profile.actions.network}}<a class="btn btn-labeled btn-primary btn-sm" href="{{$profile.actions.network.1}}" aria-label="{{$profile.actions.network.0}}" title="{{$profile.actions.network.0}}"><i class="fa fa-cloud" aria-hidden="true"></i></a>{{/if}}
{{if $profile.actions.edit}}<a class="btn btn-labeled btn-primary btn-sm" href="{{$profile.actions.edit.1}}" aria-label="{{$profile.actions.edit.0}}" title="{{$profile.actions.edit.0}}"><i class="fa fa-user" aria-hidden="true"></i></a>{{/if}} {{if $profile.actions.edit}}<a class="btn btn-labeled btn-primary btn-sm" href="{{$profile.actions.edit.1}}" aria-label="{{$profile.actions.edit.0}}" title="{{$profile.actions.edit.0}}"><i class="fa fa-user" aria-hidden="true"></i></a>{{/if}}
{{if $profile.actions.follow}}<a class="btn btn-labeled btn-primary btn-sm" href="{{$profile.actions.follow.1}}" aria-label="{{$profile.actions.follow.0}}" title="{{$profile.actions.follow.0}}"><i class="fa fa-user-plus" aria-hidden="true"></i></a>{{/if}} {{if $profile.actions.follow}}<a class="btn btn-labeled btn-primary btn-sm" href="{{$profile.actions.follow.1}}" aria-label="{{$profile.actions.follow.0}}" title="{{$profile.actions.follow.0}}"><i class="fa fa-user-plus" aria-hidden="true"></i></a>{{/if}}

View file

@ -64,6 +64,14 @@
</button> </button>
</div> </div>
{{/if}} {{/if}}
{{if $contact.forum==1 || $contact.prv==1}}
<div id="show-group-button">
<button type="button" id="show-group" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="window.location.href='{{$showgroup_link}}'">
<span class=""><i class="fa fa-group"></i></span>
<span class="">{{$showgroup}}</span>
</button>
</div>
{{/if}}
</div> </div>
<div class="clear"></div> <div class="clear"></div>