Compare commits

..

4 commits

Author SHA1 Message Date
Jakobus Schürz
9c8b00e647 translations 2023-10-06 16:17:27 +02:00
Jakobus Schürz
e98dbb3366 add mention-/showgroup button also to profile/vcard.tpl
i don't know why, but $profile['id'] in src/Model/Profile.php gives the
wrong group-id. for users, the id is correct.
2023-10-06 16:17:27 +02:00
Jakobus Schürz
e28c21cc72 move mention-/posttgroup-button to navbar 2023-10-06 16:17:27 +02:00
Jakobus Schürz
3b5c128f95 put group-logic for "widget" to php-file 2023-10-06 16:17:27 +02:00
7 changed files with 157 additions and 116 deletions

View file

@ -102,8 +102,15 @@ class VCard
}
if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
$showgroup_link = 'network/group/' . $id;
$mention_label = DI::l10n()->t('Post to group');
$mention_url = 'compose/0?body=!' . $contact['addr'];
$showgroup_label = DI::l10n()->t('View group');
$showgroup_url = 'network/group/' . $id;
} else {
$mention_label = DI::l10n()->t('Mention');
$mention_url = 'compose/0?body=@' . $contact['addr'];
}
}
return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [
@ -124,10 +131,8 @@ class VCard
'$unfollow_link' => $unfollow_link,
'$wallmessage' => DI::l10n()->t('Message'),
'$wallmessage_link' => $wallmessage_link,
'$mention' => DI::l10n()->t('Mention'),
'$posttogroup' => DI::l10n()->t('Post to group'),
'$showgroup' => DI::l10n()->t('View group'),
'$showgroup_link' => $showgroup_link,
'$mention' => [$mention_label, $mention_url],
'$showgroup' => [$showgroup_label, $showgroup_url]
]);
}
}

View 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';
}

View 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];

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 2023.09-rc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-10-05 20:02+0000\n"
"POT-Creation-Date: 2023-10-06 01:28+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"
@ -1377,8 +1377,8 @@ msgstr ""
msgid "Public post"
msgstr ""
#: src/Content/Conversation.php:424 src/Content/Widget/VCard.php:125
#: src/Model/Profile.php:467 src/Module/Admin/Logs/View.php:92
#: src/Content/Conversation.php:424 src/Content/Widget/VCard.php:132
#: src/Model/Profile.php:479 src/Module/Admin/Logs/View.php:92
#: src/Module/Post/Edit.php:181
msgid "Message"
msgstr ""
@ -1784,30 +1784,31 @@ msgstr ""
msgid "Follow Thread"
msgstr ""
#: src/Content/Item.php:429 src/Model/Contact.php:1246
#: src/Content/Item.php:429 src/Model/Contact.php:1242
msgid "View Status"
msgstr ""
#: src/Content/Item.php:430 src/Content/Item.php:451 src/Model/Contact.php:1176
#: src/Model/Contact.php:1237 src/Model/Contact.php:1247
#: src/Model/Contact.php:1233 src/Model/Contact.php:1243
#: 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:1248
#: src/Content/Item.php:431 src/Model/Contact.php:1244
msgid "View Photos"
msgstr ""
#: src/Content/Item.php:432 src/Model/Contact.php:1215
#: src/Content/Item.php:432 src/Model/Contact.php:1211
#: src/Model/Profile.php:464
msgid "Network Posts"
msgstr ""
#: src/Content/Item.php:433 src/Model/Contact.php:1239
#: src/Model/Contact.php:1250
#: src/Content/Item.php:433 src/Model/Contact.php:1235
#: src/Model/Contact.php:1246
msgid "View Contact"
msgstr ""
#: src/Content/Item.php:434 src/Model/Contact.php:1251
#: src/Content/Item.php:434 src/Model/Contact.php:1247
msgid "Send PM"
msgstr ""
@ -1842,7 +1843,7 @@ msgid "Languages"
msgstr ""
#: src/Content/Item.php:448 src/Content/Widget.php:80
#: src/Model/Contact.php:1240 src/Model/Contact.php:1252
#: src/Model/Contact.php:1236 src/Model/Contact.php:1248
#: src/Module/Contact/Follow.php:167 view/theme/vier/theme.php:195
msgid "Connect/Follow"
msgstr ""
@ -2213,8 +2214,8 @@ msgstr ""
msgid "The end"
msgstr ""
#: src/Content/Text/HTML.php:859 src/Content/Widget/VCard.php:121
#: src/Model/Profile.php:461 src/Module/Contact/Profile.php:471
#: src/Content/Text/HTML.php:859 src/Content/Widget/VCard.php:128
#: src/Model/Profile.php:473 src/Module/Contact/Profile.php:471
msgid "Follow"
msgstr ""
@ -2349,7 +2350,7 @@ msgstr ""
msgid "Organisations"
msgstr ""
#: src/Content/Widget.php:536 src/Model/Contact.php:1718
#: src/Content/Widget.php:536 src/Model/Contact.php:1714
msgid "News"
msgstr ""
@ -2411,17 +2412,32 @@ msgstr[1] ""
msgid "More Trending Tags"
msgstr ""
#: src/Content/Widget/VCard.php:114 src/Model/Profile.php:376
#: src/Content/Widget/VCard.php:105 src/Model/Contact.php:1204
#: src/Model/Profile.php:457
msgid "Post to group"
msgstr ""
#: src/Content/Widget/VCard.php:107 src/Model/Contact.php:1206
#: src/Model/Profile.php:459
msgid "View group"
msgstr ""
#: src/Content/Widget/VCard.php:110 src/Model/Contact.php:1209
#: src/Model/Profile.php:462 src/Module/Moderation/Item/Source.php:85
msgid "Mention"
msgstr ""
#: src/Content/Widget/VCard.php:121 src/Model/Profile.php:376
#: src/Module/Contact/Profile.php:408 src/Module/Profile/Profile.php:199
msgid "XMPP:"
msgstr ""
#: src/Content/Widget/VCard.php:115 src/Model/Profile.php:377
#: src/Content/Widget/VCard.php:122 src/Model/Profile.php:377
#: src/Module/Contact/Profile.php:410 src/Module/Profile/Profile.php:203
msgid "Matrix:"
msgstr ""
#: src/Content/Widget/VCard.php:116 src/Model/Event.php:82
#: src/Content/Widget/VCard.php:123 src/Model/Event.php:82
#: src/Model/Event.php:109 src/Model/Event.php:471 src/Model/Event.php:963
#: src/Model/Profile.php:371 src/Module/Contact/Profile.php:406
#: src/Module/Directory.php:147 src/Module/Notifications/Introductions.php:187
@ -2429,30 +2445,17 @@ msgstr ""
msgid "Location:"
msgstr ""
#: src/Content/Widget/VCard.php:119 src/Model/Profile.php:474
#: src/Content/Widget/VCard.php:126 src/Model/Profile.php:486
#: src/Module/Notifications/Introductions.php:201
msgid "Network:"
msgstr ""
#: src/Content/Widget/VCard.php:123 src/Model/Contact.php:1241
#: src/Model/Contact.php:1253 src/Model/Profile.php:463
#: src/Content/Widget/VCard.php:130 src/Model/Contact.php:1237
#: src/Model/Contact.php:1249 src/Model/Profile.php:475
#: src/Module/Contact/Profile.php:463
msgid "Unfollow"
msgstr ""
#: src/Content/Widget/VCard.php:127 src/Model/Contact.php:1205
#: src/Module/Moderation/Item/Source.php:85
msgid "Mention"
msgstr ""
#: src/Content/Widget/VCard.php:128 src/Model/Contact.php:1202
msgid "Post to group"
msgstr ""
#: src/Content/Widget/VCard.php:129 src/Model/Contact.php:1212
msgid "View group"
msgstr ""
#: src/Core/ACL.php:166 src/Module/Profile/Profile.php:269
msgid "Yourself"
msgstr ""
@ -2713,8 +2716,8 @@ msgstr ""
#: src/Core/Installer.php:511
msgid ""
"The web installer needs to be able to create a file called \"local.config.php"
"\" in the \"config\" folder of your web server and it is unable to do so."
"The web installer needs to be able to create a file called \"local.config."
"php\" in the \"config\" folder of your web server and it is unable to do so."
msgstr ""
#: src/Core/Installer.php:512
@ -3201,82 +3204,82 @@ msgstr ""
msgid "Edit circles"
msgstr ""
#: src/Model/Contact.php:1260 src/Module/Moderation/Users/Pending.php:102
#: src/Model/Contact.php:1256 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:1714
#: src/Model/Contact.php:1710
msgid "Organisation"
msgstr ""
#: src/Model/Contact.php:1722
#: src/Model/Contact.php:1718
msgid "Group"
msgstr ""
#: src/Model/Contact.php:3025
#: src/Model/Contact.php:3021
msgid "Disallowed profile URL."
msgstr ""
#: src/Model/Contact.php:3030 src/Module/Friendica.php:101
#: src/Model/Contact.php:3026 src/Module/Friendica.php:101
msgid "Blocked domain"
msgstr ""
#: src/Model/Contact.php:3035
#: src/Model/Contact.php:3031
msgid "Connect URL missing."
msgstr ""
#: src/Model/Contact.php:3044
#: src/Model/Contact.php:3040
msgid ""
"The contact could not be added. Please check the relevant network "
"credentials in your Settings -> Social Networks page."
msgstr ""
#: src/Model/Contact.php:3062
#: src/Model/Contact.php:3058
#, php-format
msgid "Expected network %s does not match actual network %s"
msgstr ""
#: src/Model/Contact.php:3079
#: src/Model/Contact.php:3075
msgid "The profile address specified does not provide adequate information."
msgstr ""
#: src/Model/Contact.php:3081
#: src/Model/Contact.php:3077
msgid "No compatible communication protocols or feeds were discovered."
msgstr ""
#: src/Model/Contact.php:3084
#: src/Model/Contact.php:3080
msgid "An author or name was not found."
msgstr ""
#: src/Model/Contact.php:3087
#: src/Model/Contact.php:3083
msgid "No browser URL could be matched to this address."
msgstr ""
#: src/Model/Contact.php:3090
#: src/Model/Contact.php:3086
msgid ""
"Unable to match @-style Identity Address with a known protocol or email "
"contact."
msgstr ""
#: src/Model/Contact.php:3091
#: src/Model/Contact.php:3087
msgid "Use mailto: in front of address to force email check."
msgstr ""
#: src/Model/Contact.php:3097
#: src/Model/Contact.php:3093
msgid ""
"The profile address specified belongs to a network which has been disabled "
"on this site."
msgstr ""
#: src/Model/Contact.php:3102
#: src/Model/Contact.php:3098
msgid ""
"Limited profile. This person will be unable to receive direct/personal "
"notifications from you."
msgstr ""
#: src/Model/Contact.php:3168
#: src/Model/Contact.php:3164
msgid "Unable to retrieve contact information."
msgstr ""
@ -3486,130 +3489,130 @@ msgstr ""
msgid "About:"
msgstr ""
#: src/Model/Profile.php:465
#: src/Model/Profile.php:477
msgid "Atom feed"
msgstr ""
#: src/Model/Profile.php:472
#: src/Model/Profile.php:484
msgid "This website has been verified to belong to the same person."
msgstr ""
#: src/Model/Profile.php:509
#: src/Model/Profile.php:525
msgid "F d"
msgstr ""
#: src/Model/Profile.php:573 src/Model/Profile.php:662
#: src/Model/Profile.php:589 src/Model/Profile.php:678
msgid "[today]"
msgstr ""
#: src/Model/Profile.php:582
#: src/Model/Profile.php:598
msgid "Birthday Reminders"
msgstr ""
#: src/Model/Profile.php:583
#: src/Model/Profile.php:599
msgid "Birthdays this week:"
msgstr ""
#: src/Model/Profile.php:611
#: src/Model/Profile.php:627
msgid "g A l F d"
msgstr ""
#: src/Model/Profile.php:649
#: src/Model/Profile.php:665
msgid "[No description]"
msgstr ""
#: src/Model/Profile.php:675
#: src/Model/Profile.php:691
msgid "Event Reminders"
msgstr ""
#: src/Model/Profile.php:676
#: src/Model/Profile.php:692
msgid "Upcoming events the next 7 days:"
msgstr ""
#: src/Model/Profile.php:875
#: src/Model/Profile.php:891
#, php-format
msgid "OpenWebAuth: %1$s welcomes %2$s"
msgstr ""
#: src/Model/Profile.php:1015
#: src/Model/Profile.php:1031
msgid "Hometown:"
msgstr ""
#: src/Model/Profile.php:1016
#: src/Model/Profile.php:1032
msgid "Marital Status:"
msgstr ""
#: src/Model/Profile.php:1017
#: src/Model/Profile.php:1033
msgid "With:"
msgstr ""
#: src/Model/Profile.php:1018
#: src/Model/Profile.php:1034
msgid "Since:"
msgstr ""
#: src/Model/Profile.php:1019
#: src/Model/Profile.php:1035
msgid "Sexual Preference:"
msgstr ""
#: src/Model/Profile.php:1020
#: src/Model/Profile.php:1036
msgid "Political Views:"
msgstr ""
#: src/Model/Profile.php:1021
#: src/Model/Profile.php:1037
msgid "Religious Views:"
msgstr ""
#: src/Model/Profile.php:1022
#: src/Model/Profile.php:1038
msgid "Likes:"
msgstr ""
#: src/Model/Profile.php:1023
#: src/Model/Profile.php:1039
msgid "Dislikes:"
msgstr ""
#: src/Model/Profile.php:1024
#: src/Model/Profile.php:1040
msgid "Title/Description:"
msgstr ""
#: src/Model/Profile.php:1025 src/Module/Admin/Summary.php:197
#: src/Model/Profile.php:1041 src/Module/Admin/Summary.php:197
#: src/Module/Moderation/Report/Create.php:280
#: src/Module/Moderation/Summary.php:77
msgid "Summary"
msgstr ""
#: src/Model/Profile.php:1026
#: src/Model/Profile.php:1042
msgid "Musical interests"
msgstr ""
#: src/Model/Profile.php:1027
#: src/Model/Profile.php:1043
msgid "Books, literature"
msgstr ""
#: src/Model/Profile.php:1028
#: src/Model/Profile.php:1044
msgid "Television"
msgstr ""
#: src/Model/Profile.php:1029
#: src/Model/Profile.php:1045
msgid "Film/dance/culture/entertainment"
msgstr ""
#: src/Model/Profile.php:1030
#: src/Model/Profile.php:1046
msgid "Hobbies/Interests"
msgstr ""
#: src/Model/Profile.php:1031
#: src/Model/Profile.php:1047
msgid "Love/romance"
msgstr ""
#: src/Model/Profile.php:1032
#: src/Model/Profile.php:1048
msgid "Work/employment"
msgstr ""
#: src/Model/Profile.php:1033
#: src/Model/Profile.php:1049
msgid "School/education"
msgstr ""
#: src/Model/Profile.php:1034
#: src/Model/Profile.php:1050
msgid "Contact information and Social Networks"
msgstr ""
@ -5340,9 +5343,9 @@ msgstr ""
#: src/Module/Admin/Summary.php:98
msgid ""
"The last update failed. Please run \"php bin/console.php dbstructure update"
"\" from the command line and have a look at the errors that might appear. "
"(Some of the errors are possibly inside the logfile.)"
"The last update failed. Please run \"php bin/console.php dbstructure "
"update\" from the command line and have a look at the errors that might "
"appear. (Some of the errors are possibly inside the logfile.)"
msgstr ""
#: src/Module/Admin/Summary.php:102
@ -5493,8 +5496,8 @@ msgstr ""
#, php-format
msgid ""
"Show some informations regarding the needed information to operate the node "
"according e.g. to <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer"
"\">EU-GDPR</a>."
"according e.g. to <a href=\"%s\" target=\"_blank\" rel=\"noopener "
"noreferrer\">EU-GDPR</a>."
msgstr ""
#: src/Module/Admin/Tos.php:81
@ -8842,8 +8845,8 @@ msgstr ""
#: src/Module/Profile/Profile.php:158
#, php-format
msgid ""
"You're currently viewing your profile as <b>%s</b> <a href=\"%s\" class="
"\"btn btn-sm pull-right\">Cancel</a>"
"You're currently viewing your profile as <b>%s</b> <a href=\"%s\" "
"class=\"btn btn-sm pull-right\">Cancel</a>"
msgstr ""
#: src/Module/Profile/Profile.php:167
@ -9391,8 +9394,8 @@ msgstr ""
#: src/Module/Security/TwoFactor/Verify.php:100
#, php-format
msgid ""
"If you do not have access to your authentication code you can use a <a href="
"\"%s\">two-factor recovery code</a>."
"If you do not have access to your authentication code you can use a <a "
"href=\"%s\">two-factor recovery code</a>."
msgstr ""
#: src/Module/Security/TwoFactor/Verify.php:101
@ -10932,8 +10935,8 @@ msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:149
#, php-format
msgid ""
"<p>Or you can open the following URL in your mobile device:</p><p><a href="
"\"%s\">%s</a></p>"
"<p>Or you can open the following URL in your mobile device:</p><p><a "
"href=\"%s\">%s</a></p>"
msgstr ""
#: src/Module/Settings/TwoFactor/Verify.php:156
@ -11042,9 +11045,9 @@ msgstr ""
msgid ""
"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 "
"to delete their account they can do so at <a href=\"%1$s/settings/removeme\">"
"%1$s/settings/removeme</a>. The deletion of the account will be permanent. "
"Deletion of the data will also be requested from the nodes of the "
"to delete their account they can do so at <a href=\"%1$s/settings/"
"removeme\">%1$s/settings/removeme</a>. The deletion of the account will be "
"permanent. Deletion of the data will also be requested from the nodes of the "
"communication partners."
msgstr ""

View file

@ -80,6 +80,20 @@ $(document).ready(function () {
target: ".flex-target",
});
// add mention-link button to the second navbar
let $mentionButton = $("#mention-link-button");
if ($mentionButton.length) {
$mentionButton.appendTo("#topbar-second > .container > #navbar-button").css("padding", "2");
$("#mention-link").addClass("btn-sm ");
$("#mention-link > span i").addClass("fa-2x");
if ($mentionButton.hasClass("modal-open")) {
$mentionButton.on("click", function (e) {
e.preventDefault();
jotShow();
});
}
}
// add Jot button to the second navbar
let $jotButton = $("#jotOpen");
if ($jotButton.length) {

View file

@ -72,9 +72,16 @@
{{/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>

View file

@ -58,17 +58,17 @@
{{/if}}
{{if $contact.addr}}
<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('{{$mention.1}}')" titel="{{$mention.0}}" aria-label="{{$mention.0}}">
<span class=""><i class="fa fa-pencil-square-o"></i></span>
<span class="">{{if $contact.forum==1}}{{$posttogroup}}{{else}}{{$mention}}{{/if}}</span>
<span class="">{{$mention.0}}</span>
</button>
</div>
{{/if}}
{{if $contact.forum==1 || $contact.prv==1}}
<div id="show-group-button">
<button type="button" id="show-group" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="window.location.href='{{$showgroup_link}}'">
<button type="button" id="show-group" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="window.location.href='{{$showgroup.1}}'">
<span class=""><i class="fa fa-group"></i></span>
<span class="">{{$showgroup}}</span>
<span class="">{{$showgroup.0}}</span>
</button>
</div>
{{/if}}