diff --git a/app/Actions/ActivityService.php b/app/Actions/ActivityService.php index 11f8b8732..f4f82a6f4 100644 --- a/app/Actions/ActivityService.php +++ b/app/Actions/ActivityService.php @@ -108,13 +108,17 @@ class ActivityService if ($entity->isA('book')) { $query = $this->activity->where('book_id', '=', $entity->id); } else { - $query = $this->activity->where('entity_type', '=', get_class($entity)) + $query = $this->activity->where('entity_type', '=', $entity->getMorphClass()) ->where('entity_id', '=', $entity->id); } $activity = $this->permissionService ->filterRestrictedEntityRelations($query, 'activities', 'entity_id', 'entity_type') - ->orderBy('created_at', 'desc')->with(['entity', 'user.avatar'])->skip($count * ($page - 1))->take($count)->get(); + ->orderBy('created_at', 'desc') + ->with(['entity', 'user.avatar']) + ->skip($count * ($page - 1)) + ->take($count) + ->get(); return $this->filterSimilar($activity); } diff --git a/app/Http/Controllers/BookController.php b/app/Http/Controllers/BookController.php index 7c8ad5c2f..a990eed9a 100644 --- a/app/Http/Controllers/BookController.php +++ b/app/Http/Controllers/BookController.php @@ -415,6 +415,7 @@ class BookController extends Controller { // Update the cover image if in request if ($request->has('image')) { + $this->imageRepo->destroyImage($book->cover); $newImage = $request->file('image'); $image = $this->imageRepo->saveNew($newImage, 'cover_book', $book->id, 512, 512, true); $book->image_id = $image->id; diff --git a/app/Http/Controllers/BookshelfController.php b/app/Http/Controllers/BookshelfController.php index dba2503ef..bcf2e12df 100644 --- a/app/Http/Controllers/BookshelfController.php +++ b/app/Http/Controllers/BookshelfController.php @@ -124,6 +124,7 @@ class BookshelfController extends Controller $this->entityContextManager->setShelfContext($shelf->id); $this->setPageTitle($shelf->getShortName()); + return view('shelves.show', [ 'shelf' => $shelf, 'books' => $books, @@ -287,6 +288,7 @@ class BookshelfController extends Controller // Update the cover image if in request if ($request->has('image')) { $newImage = $request->file('image'); + $this->imageRepo->destroyImage($shelf->cover); $image = $this->imageRepo->saveNew($newImage, 'cover_shelf', $shelf->id, 512, 512, true); $shelf->image_id = $image->id; $shelf->save(); diff --git a/resources/assets/sass/_lists.scss b/resources/assets/sass/_lists.scss index 565c3f0f8..9c141232e 100644 --- a/resources/assets/sass/_lists.scss +++ b/resources/assets/sass/_lists.scss @@ -456,6 +456,10 @@ ul.pagination { position: relative; margin-right: $-l; + &.entity-list-item-image-wide { + width: 220px; + } + .svg-icon { color: #FFF; fill: #FFF; diff --git a/resources/assets/sass/styles.scss b/resources/assets/sass/styles.scss index 424074a0d..3fbbcf1da 100644 --- a/resources/assets/sass/styles.scss +++ b/resources/assets/sass/styles.scss @@ -222,18 +222,6 @@ $btt-size: 40px; } } -.center-box { - margin: $-xxl auto 0 auto; - width: 420px; - max-width: 100%; - display: inline-block; - text-align: left; - vertical-align: top; - input { - width: 100%; - } -} - .fullscreen { border:0; position:fixed; diff --git a/resources/views/books/sort.blade.php b/resources/views/books/sort.blade.php index cde37de4d..23259a593 100644 --- a/resources/views/books/sort.blade.php +++ b/resources/views/books/sort.blade.php @@ -150,8 +150,8 @@ return bTime - aTime; }, updated: function(a, b) { - const aTime = Number(a.getAttribute('data-update')); - const bTime = Number(b.getAttribute('data-update')); + const aTime = Number(a.getAttribute('data-updated')); + const bTime = Number(b.getAttribute('data-updated')); return bTime - aTime; }, chaptersFirst: function(a, b) {