show "view group" in hovercard

but only on group-contacts.
rename all *forum to *group in code
This commit is contained in:
Jakobus Schürz (admin) 2023-10-01 14:25:23 +02:00
parent e6a4467557
commit 78e9ee651f
4 changed files with 10 additions and 15 deletions

View file

@ -68,7 +68,7 @@ class VCard
$follow_link = ''; $follow_link = '';
$unfollow_link = ''; $unfollow_link = '';
$wallmessage_link = ''; $wallmessage_link = '';
$showforum_link = ''; $showgroup_link = '';
$photo = Contact::getPhoto($contact); $photo = Contact::getPhoto($contact);
@ -102,7 +102,7 @@ class VCard
} }
if (in_array($rel, [Contact::SHARING])) { if (in_array($rel, [Contact::SHARING])) {
$showforum_link = 'network/group/' . $id; $showgroup_link = 'network/group/' . $id;
} }
} }
@ -124,8 +124,8 @@ class VCard
'$unfollow_link' => $unfollow_link, '$unfollow_link' => $unfollow_link,
'$wallmessage' => DI::l10n()->t('Message'), '$wallmessage' => DI::l10n()->t('Message'),
'$wallmessage_link' => $wallmessage_link, '$wallmessage_link' => $wallmessage_link,
'$showforum' => DI::l10n()->t('Show Forum'), '$showgroup' => DI::l10n()->t('Show group'),
'$showforum_link' => $showforum_link, '$showgroup_link' => $showgroup_link,
'$mentioning' => DI::l10n()->t('Mention'), '$mentioning' => DI::l10n()->t('Mention'),
]); ]);
} }

View file

@ -1199,6 +1199,7 @@ class Contact
$contact_url = 'contact/' . $contact['id']; $contact_url = 'contact/' . $contact['id'];
$posts_link = 'contact/' . $contact['id'] . '/conversations'; $posts_link = 'contact/' . $contact['id'] . '/conversations';
$group_link = 'network/group/' . $contact['id'];
$follow_link = ''; $follow_link = '';
$unfollow_link = ''; $unfollow_link = '';
@ -1232,6 +1233,7 @@ class Contact
'pm' => [DI::l10n()->t('Send PM'), $pm_url, false], 'pm' => [DI::l10n()->t('Send PM'), $pm_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],
'group' => [DI::l10n()->t('View group'), $group_link, $contact['forum'], true],
]; ];
if (!empty($contact['pending'])) { if (!empty($contact['pending'])) {

View file

@ -24,6 +24,7 @@
{{if $profile.actions.pm}}<a class="btn btn-labeled btn-primary btn-sm add-to-modal" href="{{$profile.actions.pm.1}}" aria-label="{{$profile.actions.pm.0}}"><i class="fa fa-envelope" aria-hidden="true" title="{{$profile.actions.pm.0}}"></i><span class="sr-only">{{$profile.actions.pm.0}}</span></a>{{/if}} {{if $profile.actions.pm}}<a class="btn btn-labeled btn-primary btn-sm add-to-modal" href="{{$profile.actions.pm.1}}" aria-label="{{$profile.actions.pm.0}}"><i class="fa fa-envelope" aria-hidden="true" title="{{$profile.actions.pm.0}}"></i><span class="sr-only">{{$profile.actions.pm.0}}</span></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

@ -56,19 +56,11 @@
</button> </button>
</div> </div>
{{/if}} {{/if}}
{{if $contact.addr}}
<div id="mention-link-button">
<button type="button" id="mention-link" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="openWallMessage('compose/0?body={{if $contact.forum==1}}!{{else}}@{{/if}}{{$contact.addr}}')">
<span class=""><i class="fa fa-pencil-square-o"></i></span>
<span class="">{{$mentioning}}</span>
</button>
</div>
{{/if}}
{{if $contact.forum==1 || $contact.prv==1}} {{if $contact.forum==1 || $contact.prv==1}}
<div id="mention-link-button"> <div id="show-group-button">
<button type="button" id="mention-link" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="window.location.href='{{$showforum_link}}'"> <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=""><i class="fa fa-group"></i></span>
<span class="">{{$showforum}}</span> <span class="">{{$showgroup}}</span>
</button> </button>
</div> </div>
{{/if}} {{/if}}