]> git.mxchange.org Git - friendica.git/commitdiff
add mention-/showgroup button also to profile/vcard.tpl
authorJakobus Schürz <jakobus.schuerz@home.arpa>
Fri, 6 Oct 2023 23:28:23 +0000 (01:28 +0200)
committerJakobus Schürz <jakobus.schuerz@home.arpa>
Fri, 6 Oct 2023 23:28:23 +0000 (01:28 +0200)
update translations

src/Model/Contact.php
src/Model/Profile.php
view/theme/frio/templates/profile/vcard.tpl

index 3e547fcaffcd9c6e2fb60440fcf2ab5d3c83859d..be3cec47014a23204e5280bcece7eb85aec05dd3 100644 (file)
@@ -1198,20 +1198,16 @@ class Contact
                        $pm_url = 'message/new/' . $contact['id'];
                }
 
-               if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
-                       $mention_label = DI::l10n()->t('Post to group');
-                       $mention_url = 'compose/0?body=!' . $contact['addr'];
-               } else {
-                       $mention_label = DI::l10n()->t('Mention');
-                       $mention_url = 'compose/0?body=@' . $contact['addr'];
-               }
-
                $contact_url = 'contact/' . $contact['id'];
 
                if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
+                       $mention_label = DI::l10n()->t('Post to group');
+                       $mention_url = 'compose/0?body=!' . $contact['addr'];
                        $network_label = DI::l10n()->t('View group');
                        $network_url = 'network/group/' . $contact['id'];
                } else {
+                       $mention_label = DI::l10n()->t('Mention');
+                       $mention_url = 'compose/0?body=@' . $contact['addr'];
                        $network_label = DI::l10n()->t('Network Posts');
                        $network_url = 'contact/' . $contact['id'] . '/conversations';
                }
index 9c7aab54ad6aa1b59ed4f3e079415b562f08ad17..0aa44c6735d3558fa710e664f6c6e6429fa104ad 100644 (file)
@@ -453,6 +453,18 @@ class Profile
                        Logger::warning('Missing hidewall key in profile array', ['profile' => $profile, 'callstack' => System::callstack(10)]);
                }
 
+               if ($profile['account-type'] == Contact::TYPE_COMMUNITY) {
+                       $mention_label = DI::l10n()->t('Post to group');
+                       $mention_url = 'compose/0?body=!' . $profile['addr'];
+                       $network_label = DI::l10n()->t('View group');
+                       $network_url = 'network/group/' . $profile['id'];
+               } else {
+                       $mention_label = DI::l10n()->t('Mention');
+                       $mention_url = 'compose/0?body=@' . $profile['addr'];
+                       $network_label = DI::l10n()->t('Network Posts');
+                       $network_url = 'contact/' . $profile['id'] . '/conversations';
+               }
+
                $tpl = Renderer::getMarkupTemplate('profile/vcard.tpl');
                $o .= Renderer::replaceMacros($tpl, [
                        '$profile' => $p,
@@ -476,6 +488,10 @@ class Profile
                        '$updated' => $updated,
                        '$diaspora' => $diaspora,
                        '$contact_block' => $contact_block,
+                       '$mention_label' => $mention_label,
+                       '$mention_url' => $mention_url,
+                       '$network_label' => $network_label,
+                       '$network_url' => $network_url,
                ]);
 
                $arr = ['profile' => &$profile, 'entry' => &$o];
index 94f62bd0d3e663a7ca6fbb67c5946ef1b31bffd3..86d6bd9179ef5b7bb5768dd53a7850044edb1f1e 100644 (file)
                        {{/if}}
                         {{if $profile.addr}}
                                <div id="mention-link-button">
-                                       <button type="button" id="mention-link" class="btn btn-labeled btn-primary" onclick="openWallMessage('compose/0?body={{if $profile.forum==1}}!{{else}}@{{/if}}{{$profile.addr}}')">
+                                       <button type="button" id="mention-link" class="btn btn-labeled btn-primary" onclick="openWallMessage('{{$mention_url}}')">
                                               <span class=""><i class="fa fa-pencil-square-o"></i></span>
-                                              <span class="">{{$mention}}</span>
+                                              <span class="">{{$mention_label}}</span>
+                               </div>
+                       {{/if}}
+                        {{if $network_label}}
+                               <div id="showgroup-button">
+                                       <button type="button" id="showgroup" class="btn btn-labeled btn-primary" onclick="window.location.href=('{{$network_url}}')">
+                                              <span class=""><i class="fa fa-group"></i></span>
+                                              <span class="">{{$network_label}}</span>
                                </div>
                        {{/if}}
                </div>