1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Comments: Started archive display, created mode for tree node

This commit is contained in:
Dan Brown
2025-04-28 20:09:18 +01:00
parent 8bdf948743
commit 099f6104d0
10 changed files with 110 additions and 28 deletions

View File

@@ -4,6 +4,8 @@ namespace BookStack\Activity;
use BookStack\Activity\Models\Comment;
use BookStack\Entities\Models\Entity;
use BookStack\Exceptions\NotifyException;
use BookStack\Exceptions\PrettyException;
use BookStack\Facades\Activity as ActivityService;
use BookStack\Util\HtmlDescriptionFilter;
@@ -59,6 +61,10 @@ class CommentRepo
*/
public function archive(Comment $comment): Comment
{
if ($comment->parent_id) {
throw new NotifyException('Only top-level comments can be archived.');
}
$comment->archived = true;
$comment->save();
@@ -72,6 +78,10 @@ class CommentRepo
*/
public function unarchive(Comment $comment): Comment
{
if ($comment->parent_id) {
throw new NotifyException('Only top-level comments can be un-archived.');
}
$comment->archived = false;
$comment->save();