Avoid duplicated post button on the contact conversation page (#13867)

* Avoid duplicated post button on the contact conversation page

* Updated messages.po
This commit is contained in:
Michael Vogel 2024-02-01 19:47:43 +01:00 committed by GitHub
parent 665316c14d
commit 6a6e2cd2a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 64 additions and 61 deletions

View File

@ -28,7 +28,6 @@ use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Util\Network;
use Friendica\Util\Strings; use Friendica\Util\Strings;
/** /**
@ -42,9 +41,11 @@ class VCard
* Get HTML for vcard block * Get HTML for vcard block
* *
* @template widget/vcard.tpl * @template widget/vcard.tpl
* @param array $contact
* @param bool $hide_mention
* @return string * @return string
*/ */
public static function getHTML(array $contact): string public static function getHTML(array $contact, bool $hide_mention = false): string
{ {
if (!isset($contact['network']) || !isset($contact['id'])) { if (!isset($contact['network']) || !isset($contact['id'])) {
Logger::warning('Incomplete contact', ['contact' => $contact ?? []]); Logger::warning('Incomplete contact', ['contact' => $contact ?? []]);
@ -99,10 +100,12 @@ class VCard
} }
if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) { if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
$mention_label = DI::l10n()->t('Post to group'); if (!$hide_mention) {
$mention_link = 'compose/0?body=!' . $contact['addr']; $mention_label = DI::l10n()->t('Post to group');
$mention_link = 'compose/0?body=!' . $contact['addr'];
}
$showgroup_link = 'network/group/' . $id; $showgroup_link = 'network/group/' . $id;
} else { } elseif (!$hide_mention) {
$mention_label = DI::l10n()->t('Mention'); $mention_label = DI::l10n()->t('Mention');
$mention_link = 'compose/0?body=@' . $contact['addr']; $mention_link = 'compose/0?body=@' . $contact['addr'];
} }

View File

@ -107,7 +107,7 @@ class Conversations extends BaseModule
$this->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css')); $this->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css'));
$this->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css')); $this->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css'));
$this->page['aside'] .= Widget\VCard::getHTML($contact); $this->page['aside'] .= Widget\VCard::getHTML($contact, true);
Nav::setSelected('contact'); Nav::setSelected('contact');

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2024.03-dev\n" "Project-Id-Version: 2024.03-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-30 15:26+0100\n" "POT-Creation-Date: 2024-02-01 16:16+0000\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"
@ -1381,7 +1381,7 @@ msgstr ""
msgid "Public post" msgid "Public post"
msgstr "" msgstr ""
#: src/Content/Conversation.php:426 src/Content/Widget/VCard.php:127 #: src/Content/Conversation.php:426 src/Content/Widget/VCard.php:130
#: src/Model/Profile.php:483 src/Module/Admin/Logs/View.php:92 #: src/Model/Profile.php:483 src/Module/Admin/Logs/View.php:92
#: src/Module/Post/Edit.php:181 #: src/Module/Post/Edit.php:181
msgid "Message" msgid "Message"
@ -1755,26 +1755,26 @@ msgid ""
"Contact birthday events are private to you." "Contact birthday events are private to you."
msgstr "" msgstr ""
#: src/Content/GroupManager.php:147 src/Content/Nav.php:278 #: src/Content/GroupManager.php:148 src/Content/Nav.php:278
#: src/Content/Text/HTML.php:881 src/Content/Widget.php:537 #: src/Content/Text/HTML.php:881 src/Content/Widget.php:537
#: src/Model/User.php:1381 #: src/Model/User.php:1381
msgid "Groups" msgid "Groups"
msgstr "" msgstr ""
#: src/Content/GroupManager.php:149 #: src/Content/GroupManager.php:150
msgid "External link to group" msgid "External link to group"
msgstr "" msgstr ""
#: src/Content/GroupManager.php:153 src/Content/Widget.php:512 #: src/Content/GroupManager.php:154 src/Content/Widget.php:512
msgid "show less" msgid "show less"
msgstr "" msgstr ""
#: src/Content/GroupManager.php:154 src/Content/Widget.php:410 #: src/Content/GroupManager.php:155 src/Content/Widget.php:410
#: src/Content/Widget.php:513 #: src/Content/Widget.php:513
msgid "show more" msgid "show more"
msgstr "" msgstr ""
#: src/Content/GroupManager.php:155 #: src/Content/GroupManager.php:156
msgid "Create new group" msgid "Create new group"
msgstr "" msgstr ""
@ -2232,7 +2232,7 @@ msgstr ""
msgid "The end" msgid "The end"
msgstr "" msgstr ""
#: src/Content/Text/HTML.php:860 src/Content/Widget/VCard.php:123 #: src/Content/Text/HTML.php:860 src/Content/Widget/VCard.php:126
#: src/Model/Profile.php:477 src/Module/Contact/Profile.php:471 #: src/Model/Profile.php:477 src/Module/Contact/Profile.php:471
msgid "Follow" msgid "Follow"
msgstr "" msgstr ""
@ -2436,27 +2436,27 @@ msgstr[1] ""
msgid "More Trending Tags" msgid "More Trending Tags"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:102 src/Model/Contact.php:1212 #: src/Content/Widget/VCard.php:104 src/Model/Contact.php:1212
#: src/Model/Profile.php:461 #: src/Model/Profile.php:461
msgid "Post to group" msgid "Post to group"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:106 src/Model/Contact.php:1217 #: src/Content/Widget/VCard.php:109 src/Model/Contact.php:1217
#: src/Model/Profile.php:466 src/Module/Moderation/Item/Source.php:85 #: src/Model/Profile.php:466 src/Module/Moderation/Item/Source.php:85
msgid "Mention" msgid "Mention"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:116 src/Model/Profile.php:380 #: src/Content/Widget/VCard.php:119 src/Model/Profile.php:380
#: src/Module/Contact/Profile.php:408 src/Module/Profile/Profile.php:199 #: src/Module/Contact/Profile.php:408 src/Module/Profile/Profile.php:199
msgid "XMPP:" msgid "XMPP:"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:117 src/Model/Profile.php:381 #: src/Content/Widget/VCard.php:120 src/Model/Profile.php:381
#: src/Module/Contact/Profile.php:410 src/Module/Profile/Profile.php:203 #: src/Module/Contact/Profile.php:410 src/Module/Profile/Profile.php:203
msgid "Matrix:" msgid "Matrix:"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:118 src/Model/Event.php:82 #: src/Content/Widget/VCard.php:121 src/Model/Event.php:82
#: src/Model/Event.php:109 src/Model/Event.php:471 src/Model/Event.php:963 #: src/Model/Event.php:109 src/Model/Event.php:471 src/Model/Event.php:963
#: src/Model/Profile.php:375 src/Module/Contact/Profile.php:406 #: src/Model/Profile.php:375 src/Module/Contact/Profile.php:406
#: src/Module/Directory.php:147 src/Module/Notifications/Introductions.php:187 #: src/Module/Directory.php:147 src/Module/Notifications/Introductions.php:187
@ -2464,18 +2464,18 @@ msgstr ""
msgid "Location:" msgid "Location:"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:121 src/Model/Profile.php:490 #: src/Content/Widget/VCard.php:124 src/Model/Profile.php:490
#: src/Module/Notifications/Introductions.php:201 #: src/Module/Notifications/Introductions.php:201
msgid "Network:" msgid "Network:"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:125 src/Model/Contact.php:1245 #: src/Content/Widget/VCard.php:128 src/Model/Contact.php:1245
#: src/Model/Contact.php:1257 src/Model/Profile.php:479 #: src/Model/Contact.php:1257 src/Model/Profile.php:479
#: src/Module/Contact/Profile.php:463 #: src/Module/Contact/Profile.php:463
msgid "Unfollow" msgid "Unfollow"
msgstr "" msgstr ""
#: src/Content/Widget/VCard.php:131 src/Model/Contact.php:1214 #: src/Content/Widget/VCard.php:134 src/Model/Contact.php:1214
#: src/Model/Profile.php:463 #: src/Model/Profile.php:463
msgid "View group" msgid "View group"
msgstr "" msgstr ""
@ -2748,8 +2748,8 @@ msgstr ""
#: src/Core/Installer.php:516 #: src/Core/Installer.php:516
msgid "" msgid ""
"The web installer needs to be able to create a file called \"local.config." "The web installer needs to be able to create a file called \"local.config.php"
"php\" in the \"config\" folder of your web server and it is unable to do so." "\" in the \"config\" folder of your web server and it is unable to do so."
msgstr "" msgstr ""
#: src/Core/Installer.php:517 #: src/Core/Installer.php:517
@ -3909,8 +3909,8 @@ msgid ""
"profile\n" "profile\n"
"\t\t\t(on the \"Profiles\" page) so that other people can easily find you.\n" "\t\t\t(on the \"Profiles\" page) so that other people can easily find you.\n"
"\n" "\n"
"\t\t\tWe recommend adding a profile photo, adding some profile " "\t\t\tWe recommend adding a profile photo, adding some profile \"keywords"
"\"keywords\" (very useful\n" "\" (very useful\n"
"\t\t\tin making new friends) - and perhaps what country you live in; if you " "\t\t\tin making new friends) - and perhaps what country you live in; if you "
"do not wish\n" "do not wish\n"
"\t\t\tto be more specific than that.\n" "\t\t\tto be more specific than that.\n"
@ -5657,9 +5657,9 @@ msgstr ""
#: src/Module/Admin/Summary.php:98 #: src/Module/Admin/Summary.php:98
msgid "" msgid ""
"The last update failed. Please run \"php bin/console.php dbstructure " "The last update failed. Please run \"php bin/console.php dbstructure update"
"update\" from the command line and have a look at the errors that might " "\" from the command line and have a look at the errors that might appear. "
"appear. (Some of the errors are possibly inside the logfile.)" "(Some of the errors are possibly inside the logfile.)"
msgstr "" msgstr ""
#: src/Module/Admin/Summary.php:102 #: src/Module/Admin/Summary.php:102
@ -5810,8 +5810,8 @@ msgstr ""
#, php-format #, php-format
msgid "" msgid ""
"Show some informations regarding the needed information to operate the node " "Show some informations regarding the needed information to operate the node "
"according e.g. to <a href=\"%s\" target=\"_blank\" rel=\"noopener " "according e.g. to <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer"
"noreferrer\">EU-GDPR</a>." "\">EU-GDPR</a>."
msgstr "" msgstr ""
#: src/Module/Admin/Tos.php:81 #: src/Module/Admin/Tos.php:81
@ -6255,9 +6255,9 @@ msgstr ""
#: src/Module/Circle.php:98 src/Module/Circle.php:107 #: src/Module/Circle.php:98 src/Module/Circle.php:107
#: src/Module/Contact/Advanced.php:70 src/Module/Contact/Advanced.php:109 #: src/Module/Contact/Advanced.php:70 src/Module/Contact/Advanced.php:109
#: src/Module/Contact/Contacts.php:71 src/Module/Contact/Conversations.php:84 #: src/Module/Contact/Contacts.php:71 src/Module/Contact/Conversations.php:86
#: src/Module/Contact/Conversations.php:89 #: src/Module/Contact/Conversations.php:91
#: src/Module/Contact/Conversations.php:94 src/Module/Contact/Media.php:61 #: src/Module/Contact/Conversations.php:96 src/Module/Contact/Media.php:61
#: src/Module/Contact/Posts.php:78 src/Module/Contact/Posts.php:83 #: src/Module/Contact/Posts.php:78 src/Module/Contact/Posts.php:83
#: src/Module/Contact/Posts.php:88 src/Module/Contact/Profile.php:154 #: src/Module/Contact/Posts.php:88 src/Module/Contact/Profile.php:154
#: src/Module/Contact/Profile.php:159 src/Module/Contact/Profile.php:164 #: src/Module/Contact/Profile.php:159 src/Module/Contact/Profile.php:164
@ -7052,33 +7052,33 @@ msgstr ""
msgid "Not available." msgid "Not available."
msgstr "" msgstr ""
#: src/Module/Conversation/Network.php:206 #: src/Module/Conversation/Network.php:204
msgid "No such circle" msgid "No such circle"
msgstr "" msgstr ""
#: src/Module/Conversation/Network.php:210 #: src/Module/Conversation/Network.php:208
#, php-format #, php-format
msgid "Circle: %s" msgid "Circle: %s"
msgstr "" msgstr ""
#: src/Module/Conversation/Network.php:229 #: src/Module/Conversation/Network.php:227
#, php-format #, php-format
msgid "Error %d (%s) while fetching the timeline." msgid "Error %d (%s) while fetching the timeline."
msgstr "" msgstr ""
#: src/Module/Conversation/Network.php:306 #: src/Module/Conversation/Network.php:304
msgid "Network feed not available." msgid "Network feed not available."
msgstr "" msgstr ""
#: src/Module/Conversation/Timeline.php:168 #: src/Module/Conversation/Timeline.php:169
msgid "Own Contacts" msgid "Own Contacts"
msgstr "" msgstr ""
#: src/Module/Conversation/Timeline.php:172 #: src/Module/Conversation/Timeline.php:173
msgid "Include" msgid "Include"
msgstr "" msgstr ""
#: src/Module/Conversation/Timeline.php:173 #: src/Module/Conversation/Timeline.php:174
msgid "Hide" msgid "Hide"
msgstr "" msgstr ""
@ -9123,8 +9123,8 @@ msgstr ""
#: src/Module/Profile/Profile.php:158 #: src/Module/Profile/Profile.php:158
#, php-format #, php-format
msgid "" msgid ""
"You're currently viewing your profile as <b>%s</b> <a href=\"%s\" " "You're currently viewing your profile as <b>%s</b> <a href=\"%s\" class="
"class=\"btn btn-sm pull-right\">Cancel</a>" "\"btn btn-sm pull-right\">Cancel</a>"
msgstr "" msgstr ""
#: src/Module/Profile/Profile.php:167 #: src/Module/Profile/Profile.php:167
@ -9361,48 +9361,48 @@ msgstr ""
msgid "Please enter the identical mail address in the second field." msgid "Please enter the identical mail address in the second field."
msgstr "" msgstr ""
#: src/Module/Register.php:292 #: src/Module/Register.php:291
msgid "Nickname cannot start with a digit." msgid "Nickname cannot start with a digit."
msgstr "" msgstr ""
#: src/Module/Register.php:295 #: src/Module/Register.php:293
msgid "Nickname can only contain US-ASCII characters." msgid "Nickname can only contain US-ASCII characters."
msgstr "" msgstr ""
#: src/Module/Register.php:324 #: src/Module/Register.php:322
msgid "The additional account was created." msgid "The additional account was created."
msgstr "" msgstr ""
#: src/Module/Register.php:349 #: src/Module/Register.php:347
msgid "" msgid ""
"Registration successful. Please check your email for further instructions." "Registration successful. Please check your email for further instructions."
msgstr "" msgstr ""
#: src/Module/Register.php:356 #: src/Module/Register.php:354
#, php-format #, php-format
msgid "" msgid ""
"Failed to send email message. Here your accout details:<br> login: %s<br> " "Failed to send email message. Here your accout details:<br> login: %s<br> "
"password: %s<br><br>You can change your password after login." "password: %s<br><br>You can change your password after login."
msgstr "" msgstr ""
#: src/Module/Register.php:362 #: src/Module/Register.php:360
msgid "Registration successful." msgid "Registration successful."
msgstr "" msgstr ""
#: src/Module/Register.php:371 src/Module/Register.php:378 #: src/Module/Register.php:369 src/Module/Register.php:376
#: src/Module/Register.php:388 #: src/Module/Register.php:386
msgid "Your registration can not be processed." msgid "Your registration can not be processed."
msgstr "" msgstr ""
#: src/Module/Register.php:377 #: src/Module/Register.php:375
msgid "You have to leave a request note for the admin." msgid "You have to leave a request note for the admin."
msgstr "" msgstr ""
#: src/Module/Register.php:387 #: src/Module/Register.php:385
msgid "An internal error occured." msgid "An internal error occured."
msgstr "" msgstr ""
#: src/Module/Register.php:409 #: src/Module/Register.php:407
msgid "Your registration is pending approval by the site owner." msgid "Your registration is pending approval by the site owner."
msgstr "" msgstr ""
@ -9644,8 +9644,8 @@ msgstr ""
#: src/Module/Security/TwoFactor/Verify.php:100 #: src/Module/Security/TwoFactor/Verify.php:100
#, php-format #, php-format
msgid "" msgid ""
"If you do not have access to your authentication code you can use a <a " "If you do not have access to your authentication code you can use a <a href="
"href=\"%s\">two-factor recovery code</a>." "\"%s\">two-factor recovery code</a>."
msgstr "" msgstr ""
#: src/Module/Security/TwoFactor/Verify.php:101 #: src/Module/Security/TwoFactor/Verify.php:101
@ -11344,8 +11344,8 @@ msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:152 #: src/Module/Settings/TwoFactor/Verify.php:152
#, php-format #, php-format
msgid "" msgid ""
"<p>Or you can open the following URL in your mobile device:</p><p><a " "<p>Or you can open the following URL in your mobile device:</p><p><a href="
"href=\"%s\">%s</a></p>" "\"%s\">%s</a></p>"
msgstr "" msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:159 #: src/Module/Settings/TwoFactor/Verify.php:159
@ -11454,9 +11454,9 @@ msgstr ""
msgid "" msgid ""
"At any point in time a logged in user can export their account data from the " "At any point in time a logged in user can export their account data from the "
"<a href=\"%1$s/settings/userexport\">account settings</a>. If the user wants " "<a href=\"%1$s/settings/userexport\">account settings</a>. If the user wants "
"to delete their account they can do so at <a href=\"%1$s/settings/" "to delete their account they can do so at <a href=\"%1$s/settings/removeme\">"
"removeme\">%1$s/settings/removeme</a>. The deletion of the account will be " "%1$s/settings/removeme</a>. The deletion of the account will be permanent. "
"permanent. Deletion of the data will also be requested from the nodes of the " "Deletion of the data will also be requested from the nodes of the "
"communication partners." "communication partners."
msgstr "" msgstr ""