fix code because of review

This commit is contained in:
Jakobus Schürz 2023-10-02 12:00:23 +02:00
parent 8378edc95f
commit 05f2cf9202
7 changed files with 62 additions and 67 deletions

View File

@ -432,8 +432,6 @@ class Item
$this->l10n->t('Network Posts') => $posts_link, $this->l10n->t('Network Posts') => $posts_link,
$this->l10n->t('View Contact') => $contact_url, $this->l10n->t('View Contact') => $contact_url,
$this->l10n->t('Send PM') => $pm_url, $this->l10n->t('Send PM') => $pm_url,
$this->l10n->t('Mention') => $mention_url,
$this->l10n->t('Post to group') => $mention_url,
$this->l10n->t('Block') => $block_link, $this->l10n->t('Block') => $block_link,
$this->l10n->t('Ignore') => $ignore_link, $this->l10n->t('Ignore') => $ignore_link,
$this->l10n->t('Collapse') => $collapse_link, $this->l10n->t('Collapse') => $collapse_link,

View File

@ -101,7 +101,7 @@ class VCard
$wallmessage_link = 'message/new/' . $id; $wallmessage_link = 'message/new/' . $id;
} }
if (in_array($rel, [Contact::SHARING])) { if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
$showgroup_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,
'$mentioning' => DI::l10n()->t('Mention'), '$mention' => DI::l10n()->t('Mention'),
'$post2group' => DI::l10n()->t('Post to group'), '$posttogroup' => DI::l10n()->t('Post to group'),
'$showgroup' => DI::l10n()->t('View group'), '$showgroup' => DI::l10n()->t('View group'),
'$showgroup_link' => $showgroup_link, '$showgroup_link' => $showgroup_link,
]); ]);

View File

@ -1180,7 +1180,6 @@ class Contact
$mention_url = ''; $mention_url = '';
$status_link = ''; $status_link = '';
$photos_link = ''; $photos_link = '';
$self = false;
if (($contact['network'] === Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) { if (($contact['network'] === Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) {
$profile_link = 'contact/redir/' . $contact['id']; $profile_link = 'contact/redir/' . $contact['id'];
@ -1199,17 +1198,12 @@ class Contact
$pm_url = 'message/new/' . $contact['id']; $pm_url = 'message/new/' . $contact['id'];
} }
if (in_array($contact['rel'], [contact::SHARING])) { if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
$mention_url = 'compose/0?body=!' . $contact['addr']; $mention_url = 'compose/0?body=!' . $contact['addr'];
} else { } else {
$mention_url = 'compose/0?body=@' . $contact['addr']; $mention_url = 'compose/0?body=@' . $contact['addr'];
} }
if (in_array($contact['rel'], [contact::SHARING])) {
$self = true;
}
$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']; $group_link = 'network/group/' . $contact['id'];
@ -1228,6 +1222,8 @@ class Contact
* Menu array: * Menu array:
* "name" => [ "Label", "link", (bool)Should the link opened in a new tab? ] * "name" => [ "Label", "link", (bool)Should the link opened in a new tab? ]
*/ */
if (empty($contact['uid'])) { if (empty($contact['uid'])) {
$menu = [ $menu = [
'profile' => [DI::l10n()->t('View Profile'), $profile_link, true], 'profile' => [DI::l10n()->t('View Profile'), $profile_link, true],
@ -1250,7 +1246,7 @@ class Contact
'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], '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' => [$contact['self'] ?? false, true],
]; ];
if (!empty($contact['pending'])) { if (!empty($contact['pending'])) {

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2023.09-dev\n" "Project-Id-Version: 2023.09-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-02 00:00+0200\n" "POT-Creation-Date: 2023-10-02 10:20+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -1784,46 +1784,35 @@ msgstr ""
msgid "Follow Thread" msgid "Follow Thread"
msgstr "" msgstr ""
#: src/Content/Item.php:429 src/Model/Contact.php:1243 #: src/Content/Item.php:429 src/Model/Contact.php:1239
msgid "View Status" msgid "View Status"
msgstr "" msgstr ""
#: src/Content/Item.php:430 src/Content/Item.php:453 src/Model/Contact.php:1176 #: src/Content/Item.php:430 src/Content/Item.php:451 src/Model/Contact.php:1176
#: src/Model/Contact.php:1233 src/Model/Contact.php:1244 #: src/Model/Contact.php:1229 src/Model/Contact.php:1240
#: src/Module/Directory.php:157 src/Module/Settings/Profile/Index.php:259 #: src/Module/Directory.php:157 src/Module/Settings/Profile/Index.php:259
msgid "View Profile" msgid "View Profile"
msgstr "" msgstr ""
#: src/Content/Item.php:431 src/Model/Contact.php:1245 #: src/Content/Item.php:431 src/Model/Contact.php:1241
msgid "View Photos" msgid "View Photos"
msgstr "" msgstr ""
#: src/Content/Item.php:432 src/Model/Contact.php:1234 #: src/Content/Item.php:432 src/Model/Contact.php:1230
#: src/Model/Contact.php:1246 #: src/Model/Contact.php:1242
msgid "Network Posts" msgid "Network Posts"
msgstr "" msgstr ""
#: src/Content/Item.php:433 src/Model/Contact.php:1235 #: src/Content/Item.php:433 src/Model/Contact.php:1231
#: src/Model/Contact.php:1247 #: src/Model/Contact.php:1243
msgid "View Contact" msgid "View Contact"
msgstr "" msgstr ""
#: src/Content/Item.php:434 src/Model/Contact.php:1248 #: src/Content/Item.php:434 src/Model/Contact.php:1244
msgid "Send PM" msgid "Send PM"
msgstr "" msgstr ""
#: src/Content/Item.php:435 src/Content/Widget/VCard.php:127 #: src/Content/Item.php:435 src/Module/Contact.php:468
#: src/Model/Contact.php:1238 src/Model/Contact.php:1251
#: src/Module/Moderation/Item/Source.php:85
msgid "Mention"
msgstr ""
#: src/Content/Item.php:436 src/Content/Widget/VCard.php:128
#: src/Model/Contact.php:1238 src/Model/Contact.php:1251
msgid "Post to group"
msgstr ""
#: src/Content/Item.php:437 src/Module/Contact.php:468
#: src/Module/Contact/Profile.php:511 #: src/Module/Contact/Profile.php:511
#: src/Module/Moderation/Blocklist/Contact.php:116 #: src/Module/Moderation/Blocklist/Contact.php:116
#: src/Module/Moderation/Users/Active.php:137 #: src/Module/Moderation/Users/Active.php:137
@ -1831,7 +1820,7 @@ msgstr ""
msgid "Block" msgid "Block"
msgstr "" msgstr ""
#: src/Content/Item.php:438 src/Module/Contact.php:469 #: src/Content/Item.php:436 src/Module/Contact.php:469
#: src/Module/Contact/Profile.php:519 #: src/Module/Contact/Profile.php:519
#: src/Module/Notifications/Introductions.php:134 #: src/Module/Notifications/Introductions.php:134
#: src/Module/Notifications/Introductions.php:206 #: src/Module/Notifications/Introductions.php:206
@ -1839,27 +1828,27 @@ msgstr ""
msgid "Ignore" msgid "Ignore"
msgstr "" msgstr ""
#: src/Content/Item.php:439 src/Module/Contact.php:470 #: src/Content/Item.php:437 src/Module/Contact.php:470
#: src/Module/Contact/Profile.php:527 #: src/Module/Contact/Profile.php:527
msgid "Collapse" msgid "Collapse"
msgstr "" msgstr ""
#: src/Content/Item.php:440 src/Object/Post.php:288 #: src/Content/Item.php:438 src/Object/Post.php:288
#, php-format #, php-format
msgid "Ignore %s server" msgid "Ignore %s server"
msgstr "" msgstr ""
#: src/Content/Item.php:444 src/Object/Post.php:490 #: src/Content/Item.php:442 src/Object/Post.php:490
msgid "Languages" msgid "Languages"
msgstr "" msgstr ""
#: src/Content/Item.php:450 src/Content/Widget.php:80 #: src/Content/Item.php:448 src/Content/Widget.php:80
#: src/Model/Contact.php:1236 src/Model/Contact.php:1249 #: src/Model/Contact.php:1232 src/Model/Contact.php:1245
#: src/Module/Contact/Follow.php:167 view/theme/vier/theme.php:195 #: src/Module/Contact/Follow.php:167 view/theme/vier/theme.php:195
msgid "Connect/Follow" msgid "Connect/Follow"
msgstr "" msgstr ""
#: src/Content/Item.php:884 #: src/Content/Item.php:882
msgid "Unable to fetch user." msgid "Unable to fetch user."
msgstr "" msgstr ""
@ -2361,7 +2350,7 @@ msgstr ""
msgid "Organisations" msgid "Organisations"
msgstr "" msgstr ""
#: src/Content/Widget.php:536 src/Model/Contact.php:1717 #: src/Content/Widget.php:536 src/Model/Contact.php:1713
msgid "News" msgid "News"
msgstr "" msgstr ""
@ -2446,14 +2435,24 @@ msgstr ""
msgid "Network:" msgid "Network:"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:123 src/Model/Contact.php:1237 #: src/Content/Widget/VCard.php:123 src/Model/Contact.php:1233
#: src/Model/Contact.php:1250 src/Model/Profile.php:463 #: src/Model/Contact.php:1246 src/Model/Profile.php:463
#: src/Module/Contact/Profile.php:463 #: src/Module/Contact/Profile.php:463
msgid "Unfollow" msgid "Unfollow"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:129 src/Model/Contact.php:1239 #: src/Content/Widget/VCard.php:127 src/Model/Contact.php:1234
#: src/Model/Contact.php:1252 #: src/Model/Contact.php:1247 src/Module/Moderation/Item/Source.php:85
msgid "Mention"
msgstr ""
#: src/Content/Widget/VCard.php:128 src/Model/Contact.php:1234
#: src/Model/Contact.php:1247
msgid "Post to group"
msgstr ""
#: src/Content/Widget/VCard.php:129 src/Model/Contact.php:1235
#: src/Model/Contact.php:1248
msgid "View group" msgid "View group"
msgstr "" msgstr ""
@ -3205,82 +3204,82 @@ msgstr ""
msgid "Edit circles" msgid "Edit circles"
msgstr "" msgstr ""
#: src/Model/Contact.php:1259 src/Module/Moderation/Users/Pending.php:102 #: src/Model/Contact.php:1255 src/Module/Moderation/Users/Pending.php:102
#: src/Module/Notifications/Introductions.php:132 #: src/Module/Notifications/Introductions.php:132
#: src/Module/Notifications/Introductions.php:204 #: src/Module/Notifications/Introductions.php:204
msgid "Approve" msgid "Approve"
msgstr "" msgstr ""
#: src/Model/Contact.php:1713 #: src/Model/Contact.php:1709
msgid "Organisation" msgid "Organisation"
msgstr "" msgstr ""
#: src/Model/Contact.php:1721 #: src/Model/Contact.php:1717
msgid "Group" msgid "Group"
msgstr "" msgstr ""
#: src/Model/Contact.php:3024 #: src/Model/Contact.php:3020
msgid "Disallowed profile URL." msgid "Disallowed profile URL."
msgstr "" msgstr ""
#: src/Model/Contact.php:3029 src/Module/Friendica.php:101 #: src/Model/Contact.php:3025 src/Module/Friendica.php:101
msgid "Blocked domain" msgid "Blocked domain"
msgstr "" msgstr ""
#: src/Model/Contact.php:3034 #: src/Model/Contact.php:3030
msgid "Connect URL missing." msgid "Connect URL missing."
msgstr "" msgstr ""
#: src/Model/Contact.php:3043 #: src/Model/Contact.php:3039
msgid "" msgid ""
"The contact could not be added. Please check the relevant network " "The contact could not be added. Please check the relevant network "
"credentials in your Settings -> Social Networks page." "credentials in your Settings -> Social Networks page."
msgstr "" msgstr ""
#: src/Model/Contact.php:3061 #: src/Model/Contact.php:3057
#, php-format #, php-format
msgid "Expected network %s does not match actual network %s" msgid "Expected network %s does not match actual network %s"
msgstr "" msgstr ""
#: src/Model/Contact.php:3078 #: src/Model/Contact.php:3074
msgid "The profile address specified does not provide adequate information." msgid "The profile address specified does not provide adequate information."
msgstr "" msgstr ""
#: src/Model/Contact.php:3080 #: src/Model/Contact.php:3076
msgid "No compatible communication protocols or feeds were discovered." msgid "No compatible communication protocols or feeds were discovered."
msgstr "" msgstr ""
#: src/Model/Contact.php:3083 #: src/Model/Contact.php:3079
msgid "An author or name was not found." msgid "An author or name was not found."
msgstr "" msgstr ""
#: src/Model/Contact.php:3086 #: src/Model/Contact.php:3082
msgid "No browser URL could be matched to this address." msgid "No browser URL could be matched to this address."
msgstr "" msgstr ""
#: src/Model/Contact.php:3089 #: src/Model/Contact.php:3085
msgid "" msgid ""
"Unable to match @-style Identity Address with a known protocol or email " "Unable to match @-style Identity Address with a known protocol or email "
"contact." "contact."
msgstr "" msgstr ""
#: src/Model/Contact.php:3090 #: src/Model/Contact.php:3086
msgid "Use mailto: in front of address to force email check." msgid "Use mailto: in front of address to force email check."
msgstr "" msgstr ""
#: src/Model/Contact.php:3096 #: src/Model/Contact.php:3092
msgid "" msgid ""
"The profile address specified belongs to a network which has been disabled " "The profile address specified belongs to a network which has been disabled "
"on this site." "on this site."
msgstr "" msgstr ""
#: src/Model/Contact.php:3101 #: src/Model/Contact.php:3097
msgid "" msgid ""
"Limited profile. This person will be unable to receive direct/personal " "Limited profile. This person will be unable to receive direct/personal "
"notifications from you." "notifications from you."
msgstr "" msgstr ""
#: src/Model/Contact.php:3167 #: src/Model/Contact.php:3163
msgid "Unable to retrieve contact information." msgid "Unable to retrieve contact information."
msgstr "" msgstr ""

View File

@ -22,7 +22,9 @@
{{* @todo we have two different photo menus one for contacts and one for items at the network stream. We currently use the contact photo menu, so the items options are missing We need to move them *}} {{* @todo we have two different photo menus one for contacts and one for items at the network stream. We currently use the contact photo menu, so the items options are missing We need to move them *}}
<div class="hover-card-actions-social"> <div class="hover-card-actions-social">
{{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}}
{{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.0}}<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="{{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.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}}

View File

@ -74,7 +74,7 @@
<div id="mention-link-button"> <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('compose/0?body={{if $profile.forum==1}}!{{else}}@{{/if}}{{$profile.addr}}')">
<span class=""><i class="fa fa-pencil-square-o"></i></span> <span class=""><i class="fa fa-pencil-square-o"></i></span>
<span class="">{{$mentioning}}</span> <span class="">{{$mention}}</span>
</div> </div>
{{/if}} {{/if}}
</div> </div>

View File

@ -60,7 +60,7 @@
<div id="mention-link-button"> <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}}')"> <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=""><i class="fa fa-pencil-square-o"></i></span>
<span class="">{{if $contact.forum==1}}{{$post2group}}{{else}}{{$mentioning}}{{/if}}</span> <span class="">{{if $contact.forum==1}}{{$posttogroup}}{{else}}{{$mention}}{{/if}}</span>
</button> </button>
</div> </div>
{{/if}} {{/if}}