From 78e9ee651ff23365bf13909dc325237d360d53d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jakobus=20Sch=C3=BCrz=20=28admin=29?= Date: Sun, 1 Oct 2023 14:25:23 +0200 Subject: [PATCH] show "view group" in hovercard but only on group-contacts. rename all *forum to *group in code --- src/Content/Widget/VCard.php | 8 ++++---- src/Model/Contact.php | 2 ++ view/templates/hovercard.tpl | 1 + view/theme/frio/templates/widget/vcard.tpl | 14 +++----------- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/Content/Widget/VCard.php b/src/Content/Widget/VCard.php index 8a949e9360..3e4f1e1d87 100644 --- a/src/Content/Widget/VCard.php +++ b/src/Content/Widget/VCard.php @@ -68,7 +68,7 @@ class VCard $follow_link = ''; $unfollow_link = ''; $wallmessage_link = ''; - $showforum_link = ''; + $showgroup_link = ''; $photo = Contact::getPhoto($contact); @@ -102,7 +102,7 @@ class VCard } 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, '$wallmessage' => DI::l10n()->t('Message'), '$wallmessage_link' => $wallmessage_link, - '$showforum' => DI::l10n()->t('Show Forum'), - '$showforum_link' => $showforum_link, + '$showgroup' => DI::l10n()->t('Show group'), + '$showgroup_link' => $showgroup_link, '$mentioning' => DI::l10n()->t('Mention'), ]); } diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 243b48ad1d..d9f870f561 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1199,6 +1199,7 @@ class Contact $contact_url = 'contact/' . $contact['id']; $posts_link = 'contact/' . $contact['id'] . '/conversations'; + $group_link = 'network/group/' . $contact['id']; $follow_link = ''; $unfollow_link = ''; @@ -1232,6 +1233,7 @@ class Contact 'pm' => [DI::l10n()->t('Send PM'), $pm_url, false], 'follow' => [DI::l10n()->t('Connect/Follow'), $follow_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'])) { diff --git a/view/templates/hovercard.tpl b/view/templates/hovercard.tpl index 563a5a248e..a820e5c550 100644 --- a/view/templates/hovercard.tpl +++ b/view/templates/hovercard.tpl @@ -24,6 +24,7 @@ {{if $profile.actions.pm}}{{$profile.actions.pm.0}}{{/if}}
+ {{if $profile.actions.group.2==1}}{{/if}} {{if $profile.actions.network}}{{/if}} {{if $profile.actions.edit}}{{/if}} {{if $profile.actions.follow}}{{/if}} diff --git a/view/theme/frio/templates/widget/vcard.tpl b/view/theme/frio/templates/widget/vcard.tpl index 8ae0a1d1cd..41c48aa390 100644 --- a/view/theme/frio/templates/widget/vcard.tpl +++ b/view/theme/frio/templates/widget/vcard.tpl @@ -56,19 +56,11 @@
{{/if}} - {{if $contact.addr}} - - {{/if}} {{if $contact.forum==1 || $contact.prv==1}} - {{/if}} -- 2.39.5