]>
BookStack Code Mirror - bookstack/commitdiff
projects
/
bookstack
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
898cedf
)
Reviewed #1688, Show parent shelves on books page
author
Dan Brown
<redacted>
Thu, 9 Apr 2020 16:29:22 +0000
(17:29 +0100)
committer
Dan Brown
<redacted>
Thu, 9 Apr 2020 16:29:22 +0000
(17:29 +0100)
- 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.
app/Entities/Repos/EntityRepo.php
[deleted file]
patch
|
blob
|
history
app/Http/Controllers/BookController.php
patch
|
blob
|
history
resources/lang/en/entities.php
patch
|
blob
|
history
resources/views/books/show.blade.php
patch
|
blob
|
history
tests/Entity/BookShelfTest.php
patch
|
blob
|
history
diff --git
a/app/Entities/Repos/EntityRepo.php
b/app/Entities/Repos/EntityRepo.php
deleted file mode 100644
(file)
index
e69de29
..0000000
diff --git
a/app/Http/Controllers/BookController.php
b/app/Http/Controllers/BookController.php
index 2213dedbadd3213227a915895d9a5c4b597ced84..1643c62f980cd151dabd3fedf0031084bd336c78 100644
(file)
--- a/
app/Http/Controllers/BookController.php
+++ b/
app/Http/Controllers/BookController.php
@@
-114,7
+114,7
@@
class BookController extends Controller
{
$book = $this->bookRepo->getBySlug($slug);
$bookChildren = (new BookContents($book))->getTree(true);
- $bookParentShelves = $book->shelves()->visible();
+ $bookParentShelves = $book->shelves()->visible()
->get()
;
Views::add($book);
if ($request->has('shelf')) {
diff --git
a/resources/lang/en/entities.php
b/resources/lang/en/entities.php
index 79e640378f350d96a44a9c21b113ff19e6e68c98..6bbc723b0abfc1e6b1f69e270bbb9d2afdbe851b 100644
(file)
--- a/
resources/lang/en/entities.php
+++ b/
resources/lang/en/entities.php
@@
-135,7
+135,6
@@
return [
'books_sort_chapters_last' => 'Chapters Last',
'books_sort_show_other' => 'Show Other Books',
'books_sort_save' => 'Save New Order',
- 'book_parent_shelves_empty' => 'Shelves that this book is on will appear here.',
// Chapters
'chapter' => 'Chapter',
diff --git
a/resources/views/books/show.blade.php
b/resources/views/books/show.blade.php
index 41581e123ca1b492597fee8e0dc990c3dd474b70..e3a536fc9cd7d8ab5931927198af77e31791af54 100644
(file)
--- a/
resources/views/books/show.blade.php
+++ b/
resources/views/books/show.blade.php
@@
-122,16
+122,6
@@
</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
@section('left')
@@
-144,6
+134,13
@@
</div>
@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)
<div class="mb-xl">
<h5>{{ trans('entities.recent_activity') }}</h5>
diff --git
a/tests/Entity/BookShelfTest.php
b/tests/Entity/BookShelfTest.php
index 8f41e83ab05b5c34fc05822bc7b87eb0ede37e5e..abee4d34a6e15e19b0f96c72f69be8f3c182e5d3 100644
(file)
--- a/
tests/Entity/BookShelfTest.php
+++ b/
tests/Entity/BookShelfTest.php
@@
-284,7
+284,7
@@
class BookShelfTest extends TestCase
$newBook = Book::query()->orderBy('id', 'desc')->first();
$resp = $this->asEditor()->get($newBook->getUrl());
- $resp->assert
See(
$shelfInfo['name']);
+ $resp->assert
ElementContains('.tri-layout-left-contents',
$shelfInfo['name']);
// Remove shelf
$this->delete($shelf->getUrl());
hide
Morty Proxy
This is a
proxified and sanitized
view of the page, visit
original site
.