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('View Contact') => $contact_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('Ignore') => $ignore_link,
$this->l10n->t('Collapse') => $collapse_link,

View File

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

View File

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

View File

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

View File

@ -74,7 +74,7 @@
<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}}')">
<span class=""><i class="fa fa-pencil-square-o"></i></span>
<span class="">{{$mentioning}}</span>
<span class="">{{$mention}}</span>
</div>
{{/if}}
</div>

View File

@ -60,7 +60,7 @@
<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="">{{if $contact.forum==1}}{{$post2group}}{{else}}{{$mentioning}}{{/if}}</span>
<span class="">{{if $contact.forum==1}}{{$posttogroup}}{{else}}{{$mention}}{{/if}}</span>
</button>
</div>
{{/if}}