mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-01 06:59:52 +00:00
Reviewed #1688, Show parent shelves on books page
- Moved list to the left of the page to align with other navigational items. - Hid list of no shelves, to help hide shelf references if not in use. - Tweaked test to ensure it wasn't finding shelf name in breadcrumb rather than list being tested.
This commit is contained in:
parent
898cedf536
commit
47e645909e
5 changed files with 9 additions and 13 deletions
app
resources
tests/Entity
|
@ -114,7 +114,7 @@ class BookController extends Controller
|
||||||
{
|
{
|
||||||
$book = $this->bookRepo->getBySlug($slug);
|
$book = $this->bookRepo->getBySlug($slug);
|
||||||
$bookChildren = (new BookContents($book))->getTree(true);
|
$bookChildren = (new BookContents($book))->getTree(true);
|
||||||
$bookParentShelves = $book->shelves()->visible();
|
$bookParentShelves = $book->shelves()->visible()->get();
|
||||||
|
|
||||||
Views::add($book);
|
Views::add($book);
|
||||||
if ($request->has('shelf')) {
|
if ($request->has('shelf')) {
|
||||||
|
|
|
@ -135,7 +135,6 @@ return [
|
||||||
'books_sort_chapters_last' => 'Chapters Last',
|
'books_sort_chapters_last' => 'Chapters Last',
|
||||||
'books_sort_show_other' => 'Show Other Books',
|
'books_sort_show_other' => 'Show Other Books',
|
||||||
'books_sort_save' => 'Save New Order',
|
'books_sort_save' => 'Save New Order',
|
||||||
'book_parent_shelves_empty' => 'Shelves that this book is on will appear here.',
|
|
||||||
|
|
||||||
// Chapters
|
// Chapters
|
||||||
'chapter' => 'Chapter',
|
'chapter' => 'Chapter',
|
||||||
|
|
|
@ -122,16 +122,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions mb-xl">
|
|
||||||
<h5>{{ trans('entities.shelves_long') }}</h5>
|
|
||||||
|
|
||||||
@if(count($bookParentShelves) > 0)
|
|
||||||
@include('partials.entity-list', ['entities' => $bookParentShelves, 'style' => 'compact'])
|
|
||||||
@else
|
|
||||||
<div class="body text-muted">{{ trans('entities.book_parent_shelves_empty') }}</div>
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
@section('left')
|
@section('left')
|
||||||
|
@ -144,6 +134,13 @@
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if(count($bookParentShelves) > 0)
|
||||||
|
<div class="actions mb-xl">
|
||||||
|
<h5>{{ trans('entities.shelves_long') }}</h5>
|
||||||
|
@include('partials.entity-list', ['entities' => $bookParentShelves, 'style' => 'compact'])
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
@if(count($activity) > 0)
|
@if(count($activity) > 0)
|
||||||
<div class="mb-xl">
|
<div class="mb-xl">
|
||||||
<h5>{{ trans('entities.recent_activity') }}</h5>
|
<h5>{{ trans('entities.recent_activity') }}</h5>
|
||||||
|
|
|
@ -284,7 +284,7 @@ class BookShelfTest extends TestCase
|
||||||
$newBook = Book::query()->orderBy('id', 'desc')->first();
|
$newBook = Book::query()->orderBy('id', 'desc')->first();
|
||||||
|
|
||||||
$resp = $this->asEditor()->get($newBook->getUrl());
|
$resp = $this->asEditor()->get($newBook->getUrl());
|
||||||
$resp->assertSee($shelfInfo['name']);
|
$resp->assertElementContains('.tri-layout-left-contents', $shelfInfo['name']);
|
||||||
|
|
||||||
// Remove shelf
|
// Remove shelf
|
||||||
$this->delete($shelf->getUrl());
|
$this->delete($shelf->getUrl());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue