Add menu entry to directly collapse posts

This commit is contained in:
Michael 2023-05-20 12:24:19 +00:00
parent 28185c12fc
commit 1744f6b2c3
7 changed files with 182 additions and 110 deletions

View file

@ -247,9 +247,10 @@ class Post
// Showing the one or the other text, depending upon if we can only hide it or really delete it.
$delete = $origin ? DI::l10n()->t('Delete globally') : DI::l10n()->t('Remove locally');
$drop = false;
$block = false;
$ignore = false;
$drop = false;
$block = false;
$ignore = false;
$collapse = false;
if (DI::userSession()->getLocalUserId()) {
$drop = [
'dropping' => $dropping,
@ -270,6 +271,11 @@ class Post
'ignore' => DI::l10n()->t('Ignore %s', $item['author-name']),
'author_id' => $item['author-id'],
];
$collapse = [
'collapsing' => true,
'collapse' => DI::l10n()->t('Collapse %s', $item['author-name']),
'author_id' => $item['author-id'],
];
}
$filer = DI::userSession()->getLocalUserId() ? DI::l10n()->t('Save to folder') : false;
@ -536,6 +542,7 @@ class Post
'drop' => $drop,
'block' => $block,
'ignore_author' => $ignore,
'collapse' => $collapse,
'vote' => $buttons,
'like_html' => $responses['like']['output'],
'dislike_html' => $responses['dislike']['output'],