Merge pull request #9833 from MrPetovan/task/9719-frio-block-author-more

[frio] Add block author in post more dropdown
This commit is contained in:
Michael Vogel 2021-01-23 12:50:44 +01:00 committed by GitHub
commit b7e43d3a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 275 additions and 184 deletions

View File

@ -819,24 +819,50 @@ function item_post_return($baseurl, $api_source, $return_path)
function item_content(App $a) function item_content(App $a)
{ {
if (!Session::isAuthenticated()) { if (!Session::isAuthenticated()) {
return; throw new HTTPException\UnauthorizedException();
}
$args = DI::args();
if (!$args->has(3)) {
throw new HTTPException\BadRequestException();
} }
$o = ''; $o = '';
switch ($args->get(1)) {
case 'drop':
if (DI::mode()->isAjax()) {
Item::deleteForUser(['id' => $args->get(2)], local_user());
// ajax return: [<item id>, 0 (no perm) | <owner id>]
System::jsonExit([intval($args->get(2)), local_user()]);
} else {
if (!empty($args->get(3))) {
$o = drop_item($args->get(2), $args->get(3));
} else {
$o = drop_item($args->get(2));
}
}
break;
case 'block':
$item = Post::selectFirstForUser(local_user(), ['guid', 'author-id', 'parent', 'gravity'], ['id' => $args->get(2)]);
if (empty($item['author-id'])) {
throw new HTTPException\NotFoundException('Item not found');
}
if (($a->argc >= 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) { $cdata = Contact::getPublicAndUserContacID($item['author-id'], local_user());
if (DI::mode()->isAjax()) { if (empty($cdata['user'])) {
Item::deleteForUser(['id' => $a->argv[2]], local_user()); throw new HTTPException\NotFoundException('Contact not found');
// ajax return: [<item id>, 0 (no perm) | <owner id>]
System::jsonExit([intval($a->argv[2]), local_user()]);
} else {
if (!empty($a->argv[3])) {
$o = drop_item($a->argv[2], $a->argv[3]);
} }
else {
$o = drop_item($a->argv[2]); Contact::block($cdata['user'], DI::l10n()->t('Blocked on item with guid %s', $item['guid']));
if (DI::mode()->isAjax()) {
// ajax return: [<item id>, 0 (no perm) | <owner id>]
System::jsonExit([intval($args->get(2)), local_user()]);
} else {
item_redirect_after_action($item, $args->get(3));
} }
} break;
} }
return $o; return $o;
@ -871,39 +897,10 @@ function drop_item(int $id, string $return = '')
} }
if ((local_user() == $item['uid']) || $contact_id) { if ((local_user() == $item['uid']) || $contact_id) {
if (!empty($item['parent'])) {
$parentitem = Post::selectFirstForUser(local_user(), ['guid'], ['id' => $item['parent']]);
}
// delete the item // delete the item
Item::deleteForUser(['id' => $item['id']], local_user()); Item::deleteForUser(['id' => $item['id']], local_user());
$return_url = hex2bin($return); item_redirect_after_action($item, $return);
// removes update_* from return_url to ignore Ajax refresh
$return_url = str_replace("update_", "", $return_url);
// Check if delete a comment
if ($item['gravity'] == GRAVITY_COMMENT) {
// Return to parent guid
if (!empty($parentitem)) {
DI::baseUrl()->redirect('display/' . $parentitem['guid']);
//NOTREACHED
} // In case something goes wrong
else {
DI::baseUrl()->redirect('network');
//NOTREACHED
}
} else {
// if unknown location or deleting top level post called from display
if (empty($return_url) || strpos($return_url, 'display') !== false) {
DI::baseUrl()->redirect('network');
//NOTREACHED
} else {
DI::baseUrl()->redirect($return_url);
//NOTREACHED
}
}
} else { } else {
notice(DI::l10n()->t('Permission denied.')); notice(DI::l10n()->t('Permission denied.'));
DI::baseUrl()->redirect('display/' . $item['guid']); DI::baseUrl()->redirect('display/' . $item['guid']);
@ -912,3 +909,37 @@ function drop_item(int $id, string $return = '')
return ''; return '';
} }
function item_redirect_after_action($item, $returnUrlHex)
{
$return_url = hex2bin($returnUrlHex);
// removes update_* from return_url to ignore Ajax refresh
$return_url = str_replace("update_", "", $return_url);
// Check if delete a comment
if ($item['gravity'] == GRAVITY_COMMENT) {
if (!empty($item['parent'])) {
$parentitem = Post::selectFirstForUser(local_user(), ['guid'], ['id' => $item['parent']]);
}
// Return to parent guid
if (!empty($parentitem)) {
DI::baseUrl()->redirect('display/' . $parentitem['guid']);
//NOTREACHED
} // In case something goes wrong
else {
DI::baseUrl()->redirect('network');
//NOTREACHED
}
} else {
// if unknown location or deleting top level post called from display
if (empty($return_url) || strpos($return_url, 'display') !== false) {
DI::baseUrl()->redirect('network');
//NOTREACHED
} else {
DI::baseUrl()->redirect($return_url);
//NOTREACHED
}
}
}

View File

@ -248,6 +248,7 @@ class Page implements ArrayAccess
'$local_user' => local_user(), '$local_user' => local_user(),
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION, '$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION,
'$delitem' => $l10n->t('Delete this item?'), '$delitem' => $l10n->t('Delete this item?'),
'$blockAuthor' => $l10n->t('Block this author? They won\'t be able to follow you nor see your public posts, and you won\'t be able to see their posts and their notifications.'),
'$update_interval' => $interval, '$update_interval' => $interval,
'$shortcut_icon' => $shortcut_icon, '$shortcut_icon' => $shortcut_icon,
'$touch_icon' => $touch_icon, '$touch_icon' => $touch_icon,

View File

@ -230,6 +230,7 @@ class Post
} }
$drop = false; $drop = false;
$block = false;
if (local_user()) { if (local_user()) {
$drop = [ $drop = [
'dropping' => $dropping, 'dropping' => $dropping,
@ -237,6 +238,11 @@ class Post
'select' => DI::l10n()->t('Select'), 'select' => DI::l10n()->t('Select'),
'delete' => $delete, 'delete' => $delete,
]; ];
$block = [
'blocking' => true,
'block' => DI::l10n()->t('Block %s', $item['author-name']),
'author_id' => $item['author-id'],
];
} }
$filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? DI::l10n()->t("save to folder") : false); $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? DI::l10n()->t("save to folder") : false);
@ -485,6 +491,7 @@ class Post
'filer' => $filer, 'filer' => $filer,
'language' => $languages, 'language' => $languages,
'drop' => $drop, 'drop' => $drop,
'block' => $block,
'vote' => $buttons, 'vote' => $buttons,
'like_html' => $responses['like']['output'], 'like_html' => $responses['like']['output'],
'dislike_html' => $responses['dislike']['output'], 'dislike_html' => $responses['dislike']['output'],

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2021.03-dev\n" "Project-Id-Version: 2021.03-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-21 10:38-0500\n" "POT-Creation-Date: 2021-01-23 05:36-0500\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"
@ -54,7 +54,7 @@ msgstr ""
msgid "%1$s poked %2$s" msgid "%1$s poked %2$s"
msgstr "" msgstr ""
#: include/conversation.php:222 src/Model/Item.php:2789 #: include/conversation.php:222 src/Model/Item.php:2763
msgid "event" msgid "event"
msgstr "" msgstr ""
@ -62,7 +62,7 @@ msgstr ""
msgid "status" msgid "status"
msgstr "" msgstr ""
#: include/conversation.php:230 mod/tagger.php:90 src/Model/Item.php:2791 #: include/conversation.php:230 mod/tagger.php:90 src/Model/Item.php:2765
msgid "photo" msgid "photo"
msgstr "" msgstr ""
@ -71,7 +71,7 @@ msgstr ""
msgid "%1$s tagged %2$s's %3$s with %4$s" msgid "%1$s tagged %2$s's %3$s with %4$s"
msgstr "" msgstr ""
#: include/conversation.php:560 mod/photos.php:1468 src/Object/Post.php:237 #: include/conversation.php:560 mod/photos.php:1468 src/Object/Post.php:238
msgid "Select" msgid "Select"
msgstr "" msgstr ""
@ -82,20 +82,20 @@ msgstr ""
msgid "Delete" msgid "Delete"
msgstr "" msgstr ""
#: include/conversation.php:596 src/Object/Post.php:451 src/Object/Post.php:452 #: include/conversation.php:596 src/Object/Post.php:457 src/Object/Post.php:458
#, php-format #, php-format
msgid "View %s's profile @ %s" msgid "View %s's profile @ %s"
msgstr "" msgstr ""
#: include/conversation.php:609 src/Object/Post.php:439 #: include/conversation.php:609 src/Object/Post.php:445
msgid "Categories:" msgid "Categories:"
msgstr "" msgstr ""
#: include/conversation.php:610 src/Object/Post.php:440 #: include/conversation.php:610 src/Object/Post.php:446
msgid "Filed under:" msgid "Filed under:"
msgstr "" msgstr ""
#: include/conversation.php:617 src/Object/Post.php:465 #: include/conversation.php:617 src/Object/Post.php:471
#, php-format #, php-format
msgid "%s from %s" msgid "%s from %s"
msgstr "" msgstr ""
@ -105,9 +105,9 @@ msgid "View in context"
msgstr "" msgstr ""
#: include/conversation.php:634 include/conversation.php:1216 #: include/conversation.php:634 include/conversation.php:1216
#: mod/editpost.php:106 mod/message.php:205 mod/message.php:375 #: mod/editpost.php:104 mod/message.php:205 mod/message.php:375
#: mod/photos.php:1534 mod/wallmessage.php:155 src/Module/Item/Compose.php:159 #: mod/photos.php:1534 mod/wallmessage.php:155 src/Module/Item/Compose.php:159
#: src/Object/Post.php:498 #: src/Object/Post.php:505
msgid "Please wait" msgid "Please wait"
msgstr "" msgstr ""
@ -228,7 +228,7 @@ msgstr ""
msgid "Ignore" msgid "Ignore"
msgstr "" msgstr ""
#: include/conversation.php:954 src/Object/Post.php:428 #: include/conversation.php:954 src/Object/Post.php:434
msgid "Languages" msgid "Languages"
msgstr "" msgstr ""
@ -336,7 +336,7 @@ msgid "Visible to <strong>everybody</strong>"
msgstr "" msgstr ""
#: include/conversation.php:1177 src/Module/Item/Compose.php:153 #: include/conversation.php:1177 src/Module/Item/Compose.php:153
#: src/Object/Post.php:965 #: src/Object/Post.php:972
msgid "Please enter a image/video/audio/webpage URL:" msgid "Please enter a image/video/audio/webpage URL:"
msgstr "" msgstr ""
@ -344,7 +344,7 @@ msgstr ""
msgid "Tag term:" msgid "Tag term:"
msgstr "" msgstr ""
#: include/conversation.php:1179 src/Module/Filer/SaveTag.php:65 #: include/conversation.php:1179 src/Module/Filer/SaveTag.php:69
msgid "Save to Folder:" msgid "Save to Folder:"
msgstr "" msgstr ""
@ -364,115 +364,115 @@ msgstr ""
msgid "Share" msgid "Share"
msgstr "" msgstr ""
#: include/conversation.php:1195 mod/editpost.php:91 mod/photos.php:1382 #: include/conversation.php:1195 mod/editpost.php:89 mod/photos.php:1382
#: src/Module/Contact/Poke.php:154 src/Object/Post.php:956 #: src/Module/Contact/Poke.php:154 src/Object/Post.php:963
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: include/conversation.php:1196 mod/editpost.php:92 mod/message.php:203 #: include/conversation.php:1196 mod/editpost.php:90 mod/message.php:203
#: mod/message.php:372 mod/wallmessage.php:153 #: mod/message.php:372 mod/wallmessage.php:153
msgid "Upload photo" msgid "Upload photo"
msgstr "" msgstr ""
#: include/conversation.php:1197 mod/editpost.php:93 #: include/conversation.php:1197 mod/editpost.php:91
msgid "upload photo" msgid "upload photo"
msgstr "" msgstr ""
#: include/conversation.php:1198 mod/editpost.php:94 #: include/conversation.php:1198 mod/editpost.php:92
msgid "Attach file" msgid "Attach file"
msgstr "" msgstr ""
#: include/conversation.php:1199 mod/editpost.php:95 #: include/conversation.php:1199 mod/editpost.php:93
msgid "attach file" msgid "attach file"
msgstr "" msgstr ""
#: include/conversation.php:1200 src/Module/Item/Compose.php:145 #: include/conversation.php:1200 src/Module/Item/Compose.php:145
#: src/Object/Post.php:957 #: src/Object/Post.php:964
msgid "Bold" msgid "Bold"
msgstr "" msgstr ""
#: include/conversation.php:1201 src/Module/Item/Compose.php:146 #: include/conversation.php:1201 src/Module/Item/Compose.php:146
#: src/Object/Post.php:958 #: src/Object/Post.php:965
msgid "Italic" msgid "Italic"
msgstr "" msgstr ""
#: include/conversation.php:1202 src/Module/Item/Compose.php:147 #: include/conversation.php:1202 src/Module/Item/Compose.php:147
#: src/Object/Post.php:959 #: src/Object/Post.php:966
msgid "Underline" msgid "Underline"
msgstr "" msgstr ""
#: include/conversation.php:1203 src/Module/Item/Compose.php:148 #: include/conversation.php:1203 src/Module/Item/Compose.php:148
#: src/Object/Post.php:960 #: src/Object/Post.php:967
msgid "Quote" msgid "Quote"
msgstr "" msgstr ""
#: include/conversation.php:1204 src/Module/Item/Compose.php:149 #: include/conversation.php:1204 src/Module/Item/Compose.php:149
#: src/Object/Post.php:961 #: src/Object/Post.php:968
msgid "Code" msgid "Code"
msgstr "" msgstr ""
#: include/conversation.php:1205 src/Module/Item/Compose.php:150 #: include/conversation.php:1205 src/Module/Item/Compose.php:150
#: src/Object/Post.php:962 #: src/Object/Post.php:969
msgid "Image" msgid "Image"
msgstr "" msgstr ""
#: include/conversation.php:1206 src/Module/Item/Compose.php:151 #: include/conversation.php:1206 src/Module/Item/Compose.php:151
#: src/Object/Post.php:963 #: src/Object/Post.php:970
msgid "Link" msgid "Link"
msgstr "" msgstr ""
#: include/conversation.php:1207 src/Module/Item/Compose.php:152 #: include/conversation.php:1207 src/Module/Item/Compose.php:152
#: src/Object/Post.php:964 #: src/Object/Post.php:971
msgid "Link or Media" msgid "Link or Media"
msgstr "" msgstr ""
#: include/conversation.php:1208 mod/editpost.php:102 #: include/conversation.php:1208 mod/editpost.php:100
#: src/Module/Item/Compose.php:155 #: src/Module/Item/Compose.php:155
msgid "Set your location" msgid "Set your location"
msgstr "" msgstr ""
#: include/conversation.php:1209 mod/editpost.php:103 #: include/conversation.php:1209 mod/editpost.php:101
msgid "set location" msgid "set location"
msgstr "" msgstr ""
#: include/conversation.php:1210 mod/editpost.php:104 #: include/conversation.php:1210 mod/editpost.php:102
msgid "Clear browser location" msgid "Clear browser location"
msgstr "" msgstr ""
#: include/conversation.php:1211 mod/editpost.php:105 #: include/conversation.php:1211 mod/editpost.php:103
msgid "clear location" msgid "clear location"
msgstr "" msgstr ""
#: include/conversation.php:1213 mod/editpost.php:119 #: include/conversation.php:1213 mod/editpost.php:117
#: src/Module/Item/Compose.php:160 #: src/Module/Item/Compose.php:160
msgid "Set title" msgid "Set title"
msgstr "" msgstr ""
#: include/conversation.php:1215 mod/editpost.php:121 #: include/conversation.php:1215 mod/editpost.php:119
#: src/Module/Item/Compose.php:161 #: src/Module/Item/Compose.php:161
msgid "Categories (comma-separated list)" msgid "Categories (comma-separated list)"
msgstr "" msgstr ""
#: include/conversation.php:1217 mod/editpost.php:107 #: include/conversation.php:1217 mod/editpost.php:105
msgid "Permission settings" msgid "Permission settings"
msgstr "" msgstr ""
#: include/conversation.php:1218 mod/editpost.php:136 mod/events.php:578 #: include/conversation.php:1218 mod/editpost.php:134 mod/events.php:578
#: mod/photos.php:969 mod/photos.php:1335 #: mod/photos.php:969 mod/photos.php:1335
msgid "Permissions" msgid "Permissions"
msgstr "" msgstr ""
#: include/conversation.php:1227 mod/editpost.php:116 #: include/conversation.php:1227 mod/editpost.php:114
msgid "Public post" msgid "Public post"
msgstr "" msgstr ""
#: include/conversation.php:1231 mod/editpost.php:127 mod/events.php:573 #: include/conversation.php:1231 mod/editpost.php:125 mod/events.php:573
#: mod/photos.php:1381 mod/photos.php:1438 mod/photos.php:1511 #: mod/photos.php:1381 mod/photos.php:1438 mod/photos.php:1511
#: src/Module/Item/Compose.php:154 src/Object/Post.php:966 #: src/Module/Item/Compose.php:154 src/Object/Post.php:973
msgid "Preview" msgid "Preview"
msgstr "" msgstr ""
#: include/conversation.php:1235 mod/dfrn_request.php:643 mod/editpost.php:130 #: include/conversation.php:1235 mod/dfrn_request.php:643 mod/editpost.php:128
#: mod/fbrowser.php:105 mod/fbrowser.php:134 mod/follow.php:152 #: mod/fbrowser.php:105 mod/fbrowser.php:134 mod/follow.php:152
#: mod/photos.php:1037 mod/photos.php:1143 mod/settings.php:504 #: mod/photos.php:1037 mod/photos.php:1143 mod/settings.php:504
#: mod/settings.php:530 mod/tagrm.php:37 mod/tagrm.php:127 mod/unfollow.php:100 #: mod/settings.php:530 mod/tagrm.php:37 mod/tagrm.php:127 mod/unfollow.php:100
@ -480,16 +480,16 @@ msgstr ""
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: include/conversation.php:1242 mod/editpost.php:134 src/Model/Profile.php:445 #: include/conversation.php:1242 mod/editpost.php:132 src/Model/Profile.php:445
#: src/Module/Contact.php:344 #: src/Module/Contact.php:344
msgid "Message" msgid "Message"
msgstr "" msgstr ""
#: include/conversation.php:1243 mod/editpost.php:135 #: include/conversation.php:1243 mod/editpost.php:133
msgid "Browser" msgid "Browser"
msgstr "" msgstr ""
#: include/conversation.php:1245 mod/editpost.php:138 #: include/conversation.php:1245 mod/editpost.php:136
msgid "Open Compose page" msgid "Open Compose page"
msgstr "" msgstr ""
@ -818,9 +818,9 @@ msgstr ""
msgid "Please visit %s to approve or reject the request." msgid "Please visit %s to approve or reject the request."
msgstr "" msgstr ""
#: mod/api.php:52 mod/api.php:57 mod/dfrn_confirm.php:79 mod/editpost.php:39 #: mod/api.php:52 mod/api.php:57 mod/dfrn_confirm.php:79 mod/editpost.php:37
#: mod/events.php:231 mod/follow.php:55 mod/follow.php:135 mod/item.php:183 #: mod/events.php:231 mod/follow.php:55 mod/follow.php:135 mod/item.php:183
#: mod/item.php:188 mod/item.php:917 mod/message.php:70 mod/message.php:113 #: mod/item.php:188 mod/item.php:905 mod/message.php:70 mod/message.php:113
#: mod/notes.php:44 mod/ostatus_subscribe.php:30 mod/photos.php:176 #: mod/notes.php:44 mod/ostatus_subscribe.php:30 mod/photos.php:176
#: mod/photos.php:922 mod/repair_ostatus.php:31 mod/settings.php:47 #: mod/photos.php:922 mod/repair_ostatus.php:31 mod/settings.php:47
#: mod/settings.php:65 mod/settings.php:493 mod/suggest.php:34 #: mod/settings.php:65 mod/settings.php:493 mod/suggest.php:34
@ -1211,49 +1211,49 @@ msgstr ""
msgid "The feed for this item is unavailable." msgid "The feed for this item is unavailable."
msgstr "" msgstr ""
#: mod/editpost.php:46 mod/editpost.php:56 #: mod/editpost.php:44 mod/editpost.php:54
msgid "Item not found" msgid "Item not found"
msgstr "" msgstr ""
#: mod/editpost.php:63 #: mod/editpost.php:61
msgid "Edit post" msgid "Edit post"
msgstr "" msgstr ""
#: mod/editpost.php:90 mod/notes.php:63 src/Content/Text/HTML.php:881 #: mod/editpost.php:88 mod/notes.php:63 src/Content/Text/HTML.php:881
#: src/Module/Filer/SaveTag.php:66 #: src/Module/Filer/SaveTag.php:70
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: mod/editpost.php:96 mod/message.php:204 mod/message.php:373 #: mod/editpost.php:94 mod/message.php:204 mod/message.php:373
#: mod/wallmessage.php:154 #: mod/wallmessage.php:154
msgid "Insert web link" msgid "Insert web link"
msgstr "" msgstr ""
#: mod/editpost.php:97 #: mod/editpost.php:95
msgid "web link" msgid "web link"
msgstr "" msgstr ""
#: mod/editpost.php:98 #: mod/editpost.php:96
msgid "Insert video link" msgid "Insert video link"
msgstr "" msgstr ""
#: mod/editpost.php:99 #: mod/editpost.php:97
msgid "video link" msgid "video link"
msgstr "" msgstr ""
#: mod/editpost.php:100 #: mod/editpost.php:98
msgid "Insert audio link" msgid "Insert audio link"
msgstr "" msgstr ""
#: mod/editpost.php:101 #: mod/editpost.php:99
msgid "audio link" msgid "audio link"
msgstr "" msgstr ""
#: mod/editpost.php:115 src/Core/ACL.php:312 #: mod/editpost.php:113 src/Core/ACL.php:312
msgid "CC: email addresses" msgid "CC: email addresses"
msgstr "" msgstr ""
#: mod/editpost.php:122 src/Core/ACL.php:313 #: mod/editpost.php:120 src/Core/ACL.php:313
msgid "Example: bob@example.com, mary@example.com" msgid "Example: bob@example.com, mary@example.com"
msgstr "" msgstr ""
@ -1341,7 +1341,7 @@ msgstr ""
#: src/Module/Install.php:234 src/Module/Install.php:276 #: src/Module/Install.php:234 src/Module/Install.php:276
#: src/Module/Install.php:313 src/Module/Invite.php:175 #: src/Module/Install.php:313 src/Module/Invite.php:175
#: src/Module/Item/Compose.php:144 src/Module/Profile/Profile.php:242 #: src/Module/Item/Compose.php:144 src/Module/Profile/Profile.php:242
#: src/Module/Settings/Profile/Index.php:237 src/Object/Post.php:955 #: src/Module/Settings/Profile/Index.php:237 src/Object/Post.php:962
#: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:160 #: view/theme/duepuntozero/config.php:69 view/theme/frio/config.php:160
#: view/theme/quattro/config.php:71 view/theme/vier/config.php:119 #: view/theme/quattro/config.php:71 view/theme/vier/config.php:119
msgid "Submit" msgid "Submit"
@ -1424,19 +1424,24 @@ msgstr ""
msgid "Empty post discarded." msgid "Empty post discarded."
msgstr "" msgstr ""
#: mod/item.php:706 #: mod/item.php:700
msgid "Post updated." msgid "Post updated."
msgstr "" msgstr ""
#: mod/item.php:723 mod/item.php:728 #: mod/item.php:717 mod/item.php:722
msgid "Item wasn't stored." msgid "Item wasn't stored."
msgstr "" msgstr ""
#: mod/item.php:739 #: mod/item.php:733
msgid "Item couldn't be fetched." msgid "Item couldn't be fetched."
msgstr "" msgstr ""
#: mod/item.php:867 src/Module/Admin/Themes/Details.php:39 #: mod/item.php:857
#, php-format
msgid "Blocked on item with guid %s"
msgstr ""
#: mod/item.php:884 src/Module/Admin/Themes/Details.php:39
#: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:47 #: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:47
#: src/Module/Debug/ItemBody.php:60 #: src/Module/Debug/ItemBody.php:60
msgid "Item not found." msgid "Item not found."
@ -1751,7 +1756,7 @@ msgstr ""
msgid "failed" msgid "failed"
msgstr "" msgstr ""
#: mod/ostatus_subscribe.php:98 src/Object/Post.php:312 #: mod/ostatus_subscribe.php:98 src/Object/Post.php:318
msgid "ignored" msgid "ignored"
msgstr "" msgstr ""
@ -1968,12 +1973,12 @@ msgstr ""
#: mod/photos.php:1377 mod/photos.php:1434 mod/photos.php:1507 #: mod/photos.php:1377 mod/photos.php:1434 mod/photos.php:1507
#: src/Module/Contact.php:1096 src/Module/Item/Compose.php:142 #: src/Module/Contact.php:1096 src/Module/Item/Compose.php:142
#: src/Object/Post.php:952 #: src/Object/Post.php:959
msgid "This is you" msgid "This is you"
msgstr "" msgstr ""
#: mod/photos.php:1379 mod/photos.php:1436 mod/photos.php:1509 #: mod/photos.php:1379 mod/photos.php:1436 mod/photos.php:1509
#: src/Object/Post.php:492 src/Object/Post.php:954 #: src/Object/Post.php:499 src/Object/Post.php:961
msgid "Comment" msgid "Comment"
msgstr "" msgstr ""
@ -1981,7 +1986,7 @@ msgstr ""
msgid "Like" msgid "Like"
msgstr "" msgstr ""
#: mod/photos.php:1532 src/Object/Post.php:352 #: mod/photos.php:1532 src/Object/Post.php:358
msgid "I like this (toggle)" msgid "I like this (toggle)"
msgstr "" msgstr ""
@ -1989,7 +1994,7 @@ msgstr ""
msgid "Dislike" msgid "Dislike"
msgstr "" msgstr ""
#: mod/photos.php:1535 src/Object/Post.php:353 #: mod/photos.php:1535 src/Object/Post.php:359
msgid "I don't like this (toggle)" msgid "I don't like this (toggle)"
msgstr "" msgstr ""
@ -2380,7 +2385,7 @@ msgstr ""
msgid "Unable to find your profile. Please contact your admin." msgid "Unable to find your profile. Please contact your admin."
msgstr "" msgstr ""
#: mod/settings.php:757 src/Content/Widget.php:543 #: mod/settings.php:757 src/Content/Widget.php:529
msgid "Account Types" msgid "Account Types"
msgstr "" msgstr ""
@ -2932,7 +2937,7 @@ msgstr ""
msgid "No videos selected" msgid "No videos selected"
msgstr "" msgstr ""
#: mod/videos.php:252 src/Model/Item.php:2978 #: mod/videos.php:252 src/Model/Item.php:2952
msgid "View Video" msgid "View Video"
msgstr "" msgstr ""
@ -2999,7 +3004,13 @@ msgstr ""
msgid "Delete this item?" msgid "Delete this item?"
msgstr "" msgstr ""
#: src/App/Page.php:298 #: src/App/Page.php:251
msgid ""
"Block this author? They won't be able to follow you nor see your public "
"posts, and you won't be able to see their posts and their notifications."
msgstr ""
#: src/App/Page.php:299
msgid "toggle mobile" msgid "toggle mobile"
msgstr "" msgstr ""
@ -3319,7 +3330,7 @@ msgid "Display membership date in profile"
msgstr "" msgstr ""
#: src/Content/ForumManager.php:145 src/Content/Nav.php:229 #: src/Content/ForumManager.php:145 src/Content/Nav.php:229
#: src/Content/Text/HTML.php:902 src/Content/Widget.php:540 #: src/Content/Text/HTML.php:902 src/Content/Widget.php:526
msgid "Forums" msgid "Forums"
msgstr "" msgstr ""
@ -3327,12 +3338,12 @@ msgstr ""
msgid "External link to forum" msgid "External link to forum"
msgstr "" msgstr ""
#: src/Content/ForumManager.php:150 src/Content/Widget.php:519 #: src/Content/ForumManager.php:150 src/Content/Widget.php:505
msgid "show less" msgid "show less"
msgstr "" msgstr ""
#: src/Content/ForumManager.php:151 src/Content/Widget.php:424 #: src/Content/ForumManager.php:151 src/Content/Widget.php:410
#: src/Content/Widget.php:520 #: src/Content/Widget.php:506
msgid "show more" msgid "show more"
msgstr "" msgstr ""
@ -3623,8 +3634,8 @@ msgid ""
"<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s" "<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:1088 src/Model/Item.php:3046 #: src/Content/Text/BBCode.php:1088 src/Model/Item.php:3020
#: src/Model/Item.php:3052 #: src/Model/Item.php:3026
msgid "link to source" msgid "link to source"
msgstr "" msgstr ""
@ -3794,42 +3805,42 @@ msgstr ""
msgid "All Protocols" msgid "All Protocols"
msgstr "" msgstr ""
#: src/Content/Widget.php:324 #: src/Content/Widget.php:315
msgid "Saved Folders" msgid "Saved Folders"
msgstr "" msgstr ""
#: src/Content/Widget.php:326 src/Content/Widget.php:365 #: src/Content/Widget.php:317 src/Content/Widget.php:351
msgid "Everything" msgid "Everything"
msgstr "" msgstr ""
#: src/Content/Widget.php:363 #: src/Content/Widget.php:349
msgid "Categories" msgid "Categories"
msgstr "" msgstr ""
#: src/Content/Widget.php:420 #: src/Content/Widget.php:406
#, php-format #, php-format
msgid "%d contact in common" msgid "%d contact in common"
msgid_plural "%d contacts in common" msgid_plural "%d contacts in common"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Content/Widget.php:513 #: src/Content/Widget.php:499
msgid "Archives" msgid "Archives"
msgstr "" msgstr ""
#: src/Content/Widget.php:537 #: src/Content/Widget.php:523
msgid "Persons" msgid "Persons"
msgstr "" msgstr ""
#: src/Content/Widget.php:538 #: src/Content/Widget.php:524
msgid "Organisations" msgid "Organisations"
msgstr "" msgstr ""
#: src/Content/Widget.php:539 src/Model/Contact.php:1402 #: src/Content/Widget.php:525 src/Model/Contact.php:1402
msgid "News" msgid "News"
msgstr "" msgstr ""
#: src/Content/Widget.php:544 src/Module/Admin/BaseUsers.php:50 #: src/Content/Widget.php:530 src/Module/Admin/BaseUsers.php:50
msgid "All" msgid "All"
msgstr "" msgstr ""
@ -4748,39 +4759,39 @@ msgstr ""
msgid "Edit groups" msgid "Edit groups"
msgstr "" msgstr ""
#: src/Model/Item.php:1785 #: src/Model/Item.php:1760
#, php-format #, php-format
msgid "Detected languages in this post:\\n%s" msgid "Detected languages in this post:\\n%s"
msgstr "" msgstr ""
#: src/Model/Item.php:2793 #: src/Model/Item.php:2767
msgid "activity" msgid "activity"
msgstr "" msgstr ""
#: src/Model/Item.php:2795 src/Object/Post.php:551 #: src/Model/Item.php:2769 src/Object/Post.php:558
msgid "comment" msgid "comment"
msgid_plural "comments" msgid_plural "comments"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Model/Item.php:2798 #: src/Model/Item.php:2772
msgid "post" msgid "post"
msgstr "" msgstr ""
#: src/Model/Item.php:2922 #: src/Model/Item.php:2896
#, php-format #, php-format
msgid "Content warning: %s" msgid "Content warning: %s"
msgstr "" msgstr ""
#: src/Model/Item.php:2995 #: src/Model/Item.php:2969
msgid "bytes" msgid "bytes"
msgstr "" msgstr ""
#: src/Model/Item.php:3040 #: src/Model/Item.php:3014
msgid "View on separate page" msgid "View on separate page"
msgstr "" msgstr ""
#: src/Model/Item.php:3041 #: src/Model/Item.php:3015
msgid "view on separate page" msgid "view on separate page"
msgstr "" msgstr ""
@ -8069,7 +8080,7 @@ msgstr ""
msgid "Twitter Source" msgid "Twitter Source"
msgstr "" msgstr ""
#: src/Module/Debug/Feed.php:38 src/Module/Filer/SaveTag.php:38 #: src/Module/Debug/Feed.php:38 src/Module/Filer/SaveTag.php:40
#: src/Module/Settings/Profile/Index.php:158 #: src/Module/Settings/Profile/Index.php:158
msgid "You must be logged in to use this module" msgid "You must be logged in to use this module"
msgstr "" msgstr ""
@ -8149,15 +8160,15 @@ msgstr ""
msgid "Site Directory" msgid "Site Directory"
msgstr "" msgstr ""
#: src/Module/Filer/RemoveTag.php:63 #: src/Module/Filer/RemoveTag.php:69
msgid "Item was not removed" msgid "Item was not removed"
msgstr "" msgstr ""
#: src/Module/Filer/RemoveTag.php:66 #: src/Module/Filer/RemoveTag.php:72
msgid "Item was not deleted" msgid "Item was not deleted"
msgstr "" msgstr ""
#: src/Module/Filer/SaveTag.php:65 #: src/Module/Filer/SaveTag.php:69
msgid "- select -" msgid "- select -"
msgstr "" msgstr ""
@ -10096,180 +10107,185 @@ msgstr ""
msgid "Remove locally" msgid "Remove locally"
msgstr "" msgstr ""
#: src/Object/Post.php:242 #: src/Object/Post.php:243
#, php-format
msgid "Block %s"
msgstr ""
#: src/Object/Post.php:248
msgid "save to folder" msgid "save to folder"
msgstr "" msgstr ""
#: src/Object/Post.php:277 #: src/Object/Post.php:283
msgid "I will attend" msgid "I will attend"
msgstr "" msgstr ""
#: src/Object/Post.php:277 #: src/Object/Post.php:283
msgid "I will not attend" msgid "I will not attend"
msgstr "" msgstr ""
#: src/Object/Post.php:277 #: src/Object/Post.php:283
msgid "I might attend" msgid "I might attend"
msgstr "" msgstr ""
#: src/Object/Post.php:307 #: src/Object/Post.php:313
msgid "ignore thread" msgid "ignore thread"
msgstr "" msgstr ""
#: src/Object/Post.php:308 #: src/Object/Post.php:314
msgid "unignore thread" msgid "unignore thread"
msgstr "" msgstr ""
#: src/Object/Post.php:309 #: src/Object/Post.php:315
msgid "toggle ignore status" msgid "toggle ignore status"
msgstr "" msgstr ""
#: src/Object/Post.php:321 #: src/Object/Post.php:327
msgid "pin" msgid "pin"
msgstr "" msgstr ""
#: src/Object/Post.php:322 #: src/Object/Post.php:328
msgid "unpin" msgid "unpin"
msgstr "" msgstr ""
#: src/Object/Post.php:323 #: src/Object/Post.php:329
msgid "toggle pin status" msgid "toggle pin status"
msgstr "" msgstr ""
#: src/Object/Post.php:326 #: src/Object/Post.php:332
msgid "pinned" msgid "pinned"
msgstr "" msgstr ""
#: src/Object/Post.php:333 #: src/Object/Post.php:339
msgid "add star" msgid "add star"
msgstr "" msgstr ""
#: src/Object/Post.php:334 #: src/Object/Post.php:340
msgid "remove star" msgid "remove star"
msgstr "" msgstr ""
#: src/Object/Post.php:335 #: src/Object/Post.php:341
msgid "toggle star status" msgid "toggle star status"
msgstr "" msgstr ""
#: src/Object/Post.php:338 #: src/Object/Post.php:344
msgid "starred" msgid "starred"
msgstr "" msgstr ""
#: src/Object/Post.php:342 #: src/Object/Post.php:348
msgid "add tag" msgid "add tag"
msgstr "" msgstr ""
#: src/Object/Post.php:352 #: src/Object/Post.php:358
msgid "like" msgid "like"
msgstr "" msgstr ""
#: src/Object/Post.php:353 #: src/Object/Post.php:359
msgid "dislike" msgid "dislike"
msgstr "" msgstr ""
#: src/Object/Post.php:355 #: src/Object/Post.php:361
msgid "Quote share this" msgid "Quote share this"
msgstr "" msgstr ""
#: src/Object/Post.php:355 #: src/Object/Post.php:361
msgid "Quote Share" msgid "Quote Share"
msgstr "" msgstr ""
#: src/Object/Post.php:358 #: src/Object/Post.php:364
msgid "Reshare this" msgid "Reshare this"
msgstr "" msgstr ""
#: src/Object/Post.php:358 #: src/Object/Post.php:364
msgid "Reshare" msgid "Reshare"
msgstr "" msgstr ""
#: src/Object/Post.php:359 #: src/Object/Post.php:365
msgid "Cancel your Reshare" msgid "Cancel your Reshare"
msgstr "" msgstr ""
#: src/Object/Post.php:359 #: src/Object/Post.php:365
msgid "Unshare" msgid "Unshare"
msgstr "" msgstr ""
#: src/Object/Post.php:404 #: src/Object/Post.php:410
#, php-format #, php-format
msgid "%s (Received %s)" msgid "%s (Received %s)"
msgstr "" msgstr ""
#: src/Object/Post.php:409 #: src/Object/Post.php:415
msgid "Comment this item on your system" msgid "Comment this item on your system"
msgstr "" msgstr ""
#: src/Object/Post.php:409 #: src/Object/Post.php:415
msgid "remote comment" msgid "remote comment"
msgstr "" msgstr ""
#: src/Object/Post.php:421 #: src/Object/Post.php:427
msgid "Pushed" msgid "Pushed"
msgstr "" msgstr ""
#: src/Object/Post.php:421 #: src/Object/Post.php:427
msgid "Pulled" msgid "Pulled"
msgstr "" msgstr ""
#: src/Object/Post.php:453 #: src/Object/Post.php:459
msgid "to" msgid "to"
msgstr "" msgstr ""
#: src/Object/Post.php:454 #: src/Object/Post.php:460
msgid "via" msgid "via"
msgstr "" msgstr ""
#: src/Object/Post.php:455 #: src/Object/Post.php:461
msgid "Wall-to-Wall" msgid "Wall-to-Wall"
msgstr "" msgstr ""
#: src/Object/Post.php:456 #: src/Object/Post.php:462
msgid "via Wall-To-Wall:" msgid "via Wall-To-Wall:"
msgstr "" msgstr ""
#: src/Object/Post.php:493 #: src/Object/Post.php:500
#, php-format #, php-format
msgid "Reply to %s" msgid "Reply to %s"
msgstr "" msgstr ""
#: src/Object/Post.php:496 #: src/Object/Post.php:503
msgid "More" msgid "More"
msgstr "" msgstr ""
#: src/Object/Post.php:514 #: src/Object/Post.php:521
msgid "Notifier task is pending" msgid "Notifier task is pending"
msgstr "" msgstr ""
#: src/Object/Post.php:515 #: src/Object/Post.php:522
msgid "Delivery to remote servers is pending" msgid "Delivery to remote servers is pending"
msgstr "" msgstr ""
#: src/Object/Post.php:516 #: src/Object/Post.php:523
msgid "Delivery to remote servers is underway" msgid "Delivery to remote servers is underway"
msgstr "" msgstr ""
#: src/Object/Post.php:517 #: src/Object/Post.php:524
msgid "Delivery to remote servers is mostly done" msgid "Delivery to remote servers is mostly done"
msgstr "" msgstr ""
#: src/Object/Post.php:518 #: src/Object/Post.php:525
msgid "Delivery to remote servers is done" msgid "Delivery to remote servers is done"
msgstr "" msgstr ""
#: src/Object/Post.php:538 #: src/Object/Post.php:545
#, php-format #, php-format
msgid "%d comment" msgid "%d comment"
msgid_plural "%d comments" msgid_plural "%d comments"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: src/Object/Post.php:539 #: src/Object/Post.php:546
msgid "Show more" msgid "Show more"
msgstr "" msgstr ""
#: src/Object/Post.php:540 #: src/Object/Post.php:547
msgid "Show fewer" msgid "Show fewer"
msgstr "" msgstr ""

View File

@ -198,6 +198,10 @@ function confirmDelete() {
return confirm(aStr.delitem); return confirm(aStr.delitem);
} }
function confirmBlock() {
return confirm(aStr.blockAuthor);
}
/** /**
* Hide and removes an item element from the DOM after the deletion url is * Hide and removes an item element from the DOM after the deletion url is
* successful, restore it else. * successful, restore it else.
@ -207,9 +211,34 @@ function confirmDelete() {
* @returns {undefined} * @returns {undefined}
*/ */
function dropItem(url, elementId) { function dropItem(url, elementId) {
var confirm = confirmDelete(); if (confirmDelete()) {
$("body").css("cursor", "wait");
if (confirm) { var $el = $(document.getElementById(elementId));
$el.fadeTo('fast', 0.33, function () {
$.get(url).then(function() {
$el.remove();
}).fail(function() {
// @todo Show related error message
$el.show();
}).always(function() {
$("body").css('cursor', 'auto');
});
});
}
}
/**
* Blocks an author and hide and removes an item element from the DOM after the block is
* successful, restore it else.
*
* @param {string} url The item removal URL
* @param {string} elementId The DOM id of the item element
* @returns {undefined}
*/
function blockAuthor(url, elementId) {
if (confirmBlock()) {
$("body").css("cursor", "wait"); $("body").css("cursor", "wait");
var $el = $(document.getElementById(elementId)); var $el = $(document.getElementById(elementId));

View File

@ -6,6 +6,7 @@ They are loaded into the html <head> so that js functions can use them *}}
var localUser = {{if $local_user}}{{$local_user}}{{else}}false{{/if}}; var localUser = {{if $local_user}}{{$local_user}}{{else}}false{{/if}};
var aStr = { var aStr = {
'delitem' : "{{$delitem}}", 'delitem' : "{{$delitem|escape:'javascript' nofilter}}",
'blockAuthor' : "{{$blockAuthor|escape:'javascript' nofilter}}",
}; };
</script> </script>

View File

@ -393,6 +393,12 @@ as the value of $top_child_total (this is done at the end of this file)
<a class="btn-link navicon delete" href="javascript:dropItem('item/drop/{{$item.id}}/{{$item.return}}', 'item-{{$item.guid}}');" title="{{$item.drop.delete}}"><i class="fa fa-trash" aria-hidden="true"></i> {{$item.drop.delete}}</a> <a class="btn-link navicon delete" href="javascript:dropItem('item/drop/{{$item.id}}/{{$item.return}}', 'item-{{$item.guid}}');" title="{{$item.drop.delete}}"><i class="fa fa-trash" aria-hidden="true"></i> {{$item.drop.delete}}</a>
</li> </li>
{{/if}} {{/if}}
{{if $item.block}}
<li role="menuitem">
<a class="btn-link navicon block" href="javascript:blockAuthor('item/block/{{$item.id}}/{{$item.return}}', 'item-{{$item.guid}}');" title="{{$item.block.block}}"><i class="fa fa-ban" aria-hidden="true"></i> {{$item.block.block}}</a>
</li>
{{/if}}
</ul> </ul>
<img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" /> <img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" />
</span> </span>