]> git.mxchange.org Git - friendica.git/commitdiff
Show the network icon for the contact
authorMichael <heluecht@pirati.ca>
Sat, 24 Jul 2021 12:21:33 +0000 (12:21 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 24 Jul 2021 12:21:33 +0000 (12:21 +0000)
src/Content/Widget/VCard.php
view/theme/frio/css/style.css
view/theme/frio/templates/widget/vcard.tpl

index e3550b28b8fe39a827cba6d0d2847b122c1b9c0b..ffe4759f5ca36e15d1cb2ec32c13e6f6677918c7 100644 (file)
@@ -21,6 +21,7 @@
 
 namespace Friendica\Content\Widget;
 
+use Friendica\Content\ContactSelector;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
@@ -49,10 +50,12 @@ class VCard
                        Logger::warning('Incomplete contact', ['contact' => $contact ?? [], 'callstack' => System::callstack(20)]);
                }
 
-               if (($contact['network'] != '') && ($contact['network'] != Protocol::DFRN)) {
-                       $network_link = Strings::formatNetworkName($contact['network'], $contact['url']);
+               if ($contact['network'] != '') {
+                       $network_link   = Strings::formatNetworkName($contact['network'], $contact['url']);
+                       $network_avatar = ContactSelector::networkToIcon($contact['network'], $contact['url']);
                } else {
-                       $network_link = '';
+                       $network_link   = '';
+                       $network_avatar = '';
                }
 
                $follow_link      = '';
@@ -93,6 +96,7 @@ class VCard
                        '$xmpp'             => DI::l10n()->t('XMPP:'),
                        '$location'         => DI::l10n()->t('Location:'),
                        '$network_link'     => $network_link,
+                       '$network_avatar'   => $network_avatar,
                        '$network'          => DI::l10n()->t('Network:'),
                        '$account_type'     => Contact::getAccountType($contact),
                        '$follow'           => DI::l10n()->t('Follow'),
index e5d30d1d2c8e8067b580ed5db46b022a94ade3f2..4ec229fc3eef3a410fefad15971efba3a7964bfc 100644 (file)
@@ -1167,7 +1167,8 @@ aside .vcard .detail {
        display: table;
        padding: 5px 0;
 }
-aside .xmpp {
+aside .xmpp,
+aside .network {
        display: table;
 }
 aside .vcard .icon {
index 69fb4d4afdff16549e34c788bd35f4a599432cf3..5bd481a96a3b342cf8b123f58d356453b92e3244 100644 (file)
                </div>
                {{/if}}
 
-               {{if $network_link}}<dl class="network"><dt class="network-label">{{$network}}</dt><dd class="x-network">{{$network_link nofilter}}</dd></dl>{{/if}}
+               {{if $network_link}}
+               <div class="network">
+                       <span class="network-label icon"><i class="fa fa-{{$network_avatar}}"></i></span>
+                       <span class="x-network">{{$network_link nofilter}}</span>
+               </div>
+               {{/if}}
        </div>
 </div>