]> BookStack Code Mirror - bookstack/commitdiff
Made default books view configurable in .env
authorDan Brown <redacted>
Sun, 4 Feb 2018 11:36:58 +0000 (11:36 +0000)
committerDan Brown <redacted>
Sun, 4 Feb 2018 11:36:58 +0000 (11:36 +0000)
Under 'APP_VIEWS_BOOKS' key.
Closes #675

app/Http/Controllers/BookController.php
config/app.php

index 7a98bd49ec1b67119c7aa151c0cb874964505a94..decdfda49afe13182a7f6053917354af7225eb61 100644 (file)
@@ -40,7 +40,7 @@ class BookController extends Controller
         $recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('book', 4, 0) : false;
         $popular = $this->entityRepo->getPopular('book', 4, 0);
         $new = $this->entityRepo->getRecentlyCreated('book', 4, 0);
-        $booksViewType = setting()->getUser($this->currentUser, 'books_view_type', 'list');
+        $booksViewType = setting()->getUser($this->currentUser, 'books_view_type', config('app.views.books', 'list'));
         $this->setPageTitle(trans('entities.books'));
         return view('books/index', [
             'books' => $books,
index e408fb3a5b867680c70dda20f5aac18a24a7e9c9..b40389bed1751276d4fb551ddae7384898f5484e 100755 (executable)
@@ -2,11 +2,14 @@
 
 return [
 
-
     'env' => env('APP_ENV', 'production'),
 
     'editor' => env('APP_EDITOR', 'html'),
 
+    'views' => [
+        'books' => env('APP_VIEWS_BOOKS', 'list')
+    ],
+
     /*
     |--------------------------------------------------------------------------
     | Application Debug Mode