diff --git a/app/Http/Controllers/BookController.php b/app/Http/Controllers/BookController.php index 8996ae64a..6283ac8d1 100644 --- a/app/Http/Controllers/BookController.php +++ b/app/Http/Controllers/BookController.php @@ -36,7 +36,7 @@ class BookController extends Controller */ public function index() { - $books = $this->entityRepo->getAllPaginated('book', 10); + $books = $this->entityRepo->getAllPaginated('book', 20); $recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('book', 4, 0) : false; $popular = $this->entityRepo->getPopular('book', 4, 0); $this->setPageTitle('Books'); @@ -84,7 +84,12 @@ class BookController extends Controller $bookChildren = $this->entityRepo->getBookChildren($book); Views::add($book); $this->setPageTitle($book->getShortName()); - return view('books/show', ['book' => $book, 'current' => $book, 'bookChildren' => $bookChildren]); + return view('books/show', [ + 'book' => $book, + 'current' => $book, + 'bookChildren' => $bookChildren, + 'activity' => Activity::entityActivity($book, 20, 0) + ]); } /** diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 7f60d7009..ad3b41655 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -29,13 +29,11 @@ class HomeController extends Controller $activity = Activity::latest(10); $draftPages = $this->signedIn ? $this->entityRepo->getUserDraftPages(6) : []; $recentFactor = count($draftPages) > 0 ? 0.5 : 1; - $recents = $this->signedIn ? Views::getUserRecentlyViewed(12*$recentFactor, 0) : $this->entityRepo->getRecentlyCreated('book', 10*$recentFactor); - $recentlyCreatedPages = $this->entityRepo->getRecentlyCreated('page', 5); - $recentlyUpdatedPages = $this->entityRepo->getRecentlyUpdated('page', 5); + $recents = $this->signedIn ? Views::getUserRecentlyViewed(12*$recentFactor, 0) : $this->entityRepo->getRecentlyCreated('book', 12*$recentFactor); + $recentlyUpdatedPages = $this->entityRepo->getRecentlyUpdated('page', 12); return view('home', [ 'activity' => $activity, 'recents' => $recents, - 'recentlyCreatedPages' => $recentlyCreatedPages, 'recentlyUpdatedPages' => $recentlyUpdatedPages, 'draftPages' => $draftPages ]); diff --git a/resources/assets/sass/_header.scss b/resources/assets/sass/_header.scss index 49bd74b07..3e92ce828 100644 --- a/resources/assets/sass/_header.scss +++ b/resources/assets/sass/_header.scss @@ -171,6 +171,10 @@ header .search-box { background-color: $primary-faded; } +.toolbar-container { + background-color: #FFF; +} + .breadcrumbs .text-button, .action-buttons .text-button { display: inline-block; padding: $-s; diff --git a/resources/assets/sass/_html.scss b/resources/assets/sass/_html.scss index 27ca04eb7..9e47f4387 100644 --- a/resources/assets/sass/_html.scss +++ b/resources/assets/sass/_html.scss @@ -16,6 +16,9 @@ body { line-height: 1.6; color: #616161; -webkit-font-smoothing: antialiased; + &.shaded { + background-color: #F2F2F2; + } } button { diff --git a/resources/assets/sass/_lists.scss b/resources/assets/sass/_lists.scss index 61b2aa858..0cb58432c 100644 --- a/resources/assets/sass/_lists.scss +++ b/resources/assets/sass/_lists.scss @@ -310,6 +310,11 @@ ul.pagination { } } +.card .entity-list-item { + padding-left: $-m; + padding-right: $-m; +} + .entity-list.compact { font-size: 0.6em; h4, a { diff --git a/resources/lang/en/common.php b/resources/lang/en/common.php index e1d74c95e..06b980970 100644 --- a/resources/lang/en/common.php +++ b/resources/lang/en/common.php @@ -10,6 +10,7 @@ return [ 'save' => 'Save', 'continue' => 'Continue', 'select' => 'Select', + 'more' => 'More', /** * Form Labels @@ -35,7 +36,6 @@ return [ 'remove' => 'Remove', 'add' => 'Add', - /** * Misc */ @@ -44,6 +44,7 @@ return [ 'no_items' => 'No items available', 'back_to_top' => 'Back to top', 'toggle_details' => 'Toggle Details', + 'details' => 'Details', /** * Header diff --git a/resources/views/books/index.blade.php b/resources/views/books/index.blade.php index c090a127e..3c05f32a5 100644 --- a/resources/views/books/index.blade.php +++ b/resources/views/books/index.blade.php @@ -1,59 +1,50 @@ -@extends('base') +@extends('sidebar-layout') -@section('content') - -
{{ trans('entities.books_empty') }}
- @if(userCan('books-create-all')) - {{ trans('entities.create_one_now') }} - @endif - @endif -{{ trans('entities.books_popular_empty') }}
- @endif -{{ trans('entities.books_empty') }}
+ @if(userCan('books-create-all')) + {{ trans('entities.create_one_now') }} + @endif + @endif{!! nl2br(e($book->description)) !!}
- -{{ trans('entities.books_empty_contents') }}
-- @if(userCan('page-create', $book)) - {{ trans('entities.books_empty_create_page') }} - @endif - @if(userCan('page-create', $book) && userCan('chapter-create', $book)) - -{{ trans('entities.books_empty_or') }}- - @endif - @if(userCan('chapter-create', $book)) - {{ trans('entities.books_empty_add_chapter') }} - @endif -
-+ @if(userCan('restrictions-manage', $book)) + {{ trans('entities.books_permissions_active') }} + @else + {{ trans('entities.books_permissions_active') }} + @endif +
- @if(userCan('restrictions-manage', $book)) - {{ trans('entities.books_permissions_active') }} +
{!! nl2br(e($book->description)) !!}
+ +{{ trans('entities.books_empty_contents') }}
++ @if(userCan('page-create', $book)) + {{ trans('entities.books_empty_create_page') }} + @endif + @if(userCan('page-create', $book) && userCan('chapter-create', $book)) + -{{ trans('entities.books_empty_or') }}- + @endif + @if(userCan('chapter-create', $book)) + {{ trans('entities.books_empty_add_chapter') }} @endif
+{!! nl2br(e($chapter->description)) !!}
- - @if(count($pages) > 0) -{{ trans('entities.chapters_empty') }}
-- @if(userCan('page-create', $chapter)) - {{ trans('entities.books_empty_create_page') }} - @endif - @if(userCan('page-create', $chapter) && userCan('book-update', $book)) - -{{ trans('entities.books_empty_or') }}- - @endif - @if(userCan('book-update', $book)) - {{ trans('entities.books_empty_sort_current_book') }} - @endif -
-- @if(userCan('restrictions-manage', $book)) - {{ trans('entities.books_permissions_active') }} - @else - {{ trans('entities.books_permissions_active') }} - @endif -
+ @if($book->restricted || $chapter->restricted) ++ @if(userCan('restrictions-manage', $book)) + {{ trans('entities.books_permissions_active') }} + @else + {{ trans('entities.books_permissions_active') }} @endif - - @if($chapter->restricted) - @if(userCan('restrictions-manage', $chapter)) - {{ trans('entities.chapters_permissions_active') }} - @else - {{ trans('entities.chapters_permissions_active') }} - @endif - @endif -
+ @if(userCan('restrictions-manage', $chapter)) + {{ trans('entities.chapters_permissions_active') }} + @else + {{ trans('entities.chapters_permissions_active') }} + @endif +
+ @endif{!! nl2br(e($chapter->description)) !!}
+ + @if(count($pages) > 0) +{{ trans('entities.chapters_empty') }}
++ @if(userCan('page-create', $chapter)) + {{ trans('entities.books_empty_create_page') }} + @endif + @if(userCan('page-create', $chapter) && userCan('book-update', $book)) + -{{ trans('entities.books_empty_or') }}- + @endif + @if(userCan('book-update', $book)) + {{ trans('entities.books_empty_sort_current_book') }} + @endif +
+