1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-27 06:01:54 +03:00

Refactored notification showing and global view data

This commit is contained in:
Dan Brown
2019-09-19 15:12:10 +01:00
parent 60d0f96cd7
commit 2a2cc858f0
15 changed files with 102 additions and 58 deletions

View File

@ -197,13 +197,13 @@ class ChapterController extends Controller
}
if ($parent === false || $parent === null) {
session()->flash('error', trans('errors.selected_book_not_found'));
$this->showErrorNotification( trans('errors.selected_book_not_found'));
return redirect()->back();
}
$this->entityRepo->changeBook('chapter', $parent->id, $chapter, true);
Activity::add($chapter, 'chapter_move', $chapter->book->id);
session()->flash('success', trans('entities.chapter_move_success', ['bookName' => $parent->name]));
$this->showSuccessNotification( trans('entities.chapter_move_success', ['bookName' => $parent->name]));
return redirect($chapter->getUrl());
}
@ -240,7 +240,7 @@ class ChapterController extends Controller
$chapter = $this->entityRepo->getEntityBySlug('chapter', $chapterSlug, $bookSlug);
$this->checkOwnablePermission('restrictions-manage', $chapter);
$this->entityRepo->updateEntityPermissionsFromRequest($request, $chapter);
session()->flash('success', trans('entities.chapters_permissions_success'));
$this->showSuccessNotification( trans('entities.chapters_permissions_success'));
return redirect($chapter->getUrl());
}
}