diff --git a/app/Book.php b/app/Book.php index b4cafd65b..06c00945d 100644 --- a/app/Book.php +++ b/app/Book.php @@ -3,7 +3,7 @@ class Book extends Entity { - protected $fillable = ['name', 'description', 'image']; + protected $fillable = ['name', 'description']; /** * Get the url for this book. @@ -18,24 +18,6 @@ class Book extends Entity return baseUrl('/books/' . urlencode($this->slug)); } - public function getBookCover($size = 120) - { - $default = baseUrl('/default.png'); - $image = $this->image; - if ($image === 0 || $image === '0' || $image === null) - return $default; - try { - $cover = $this->cover ? baseUrl($this->cover->getThumb(120, 192, false)) : $default; - } catch (\Exception $err) { - $cover = $default; - } - return $cover; - } - - public function cover() - { - return $this->belongsTo(Image::class, 'image'); - } /* * Get the edit url for this book. * @return string diff --git a/app/Http/Controllers/BookController.php b/app/Http/Controllers/BookController.php index eecb7839f..4313a4e20 100644 --- a/app/Http/Controllers/BookController.php +++ b/app/Http/Controllers/BookController.php @@ -39,9 +39,9 @@ class BookController extends Controller $books = $this->entityRepo->getAllPaginated('book', 16); $recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('book', 4, 0) : false; $popular = $this->entityRepo->getPopular('book', 3, 0); - $books_display = $this->currentUser->books_display; + $display = $this->currentUser->display; $this->setPageTitle('Books'); - return view('books/index', ['books' => $books, 'recents' => $recents, 'popular' => $popular, 'books_display' => $books_display] ); + return view('books/index', ['books' => $books, 'recents' => $recents, 'popular' => $popular, 'display' => $display]); //added displaly to access user display } /** @@ -115,9 +115,9 @@ class BookController extends Controller 'name' => 'required|string|max:255', 'description' => 'string|max:1000' ]); - $book = $this->entityRepo->updateFromInput('book', $book, $request->all()); - Activity::add($book, 'book_update', $book->id); - return redirect($book->getUrl()); + $book = $this->entityRepo->updateFromInput('book', $book, $request->all()); + Activity::add($book, 'book_update', $book->id); + return redirect($book->getUrl()); } /** diff --git a/app/User.php b/app/User.php index 703322cbd..8033557e4 100644 --- a/app/User.php +++ b/app/User.php @@ -22,7 +22,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon * The attributes that are mass assignable. * @var array */ - protected $fillable = ['name', 'email', 'image_id', 'books_display' ]; + protected $fillable = ['name', 'email', 'image_id']; /** * The attributes excluded from the model's JSON form. diff --git a/database/migrations/2017_07_05_102650_add_cover_image_display.php b/database/migrations/2017_07_05_102650_add_cover_image_display.php deleted file mode 100644 index 396112744..000000000 --- a/database/migrations/2017_07_05_102650_add_cover_image_display.php +++ /dev/null @@ -1,40 +0,0 @@ -string('books_display',10)->default('grid'); - }); - - Schema::table('books', function (Blueprint $table) { - $table->integer('image'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('users', function (Blueprint $table) { - $table->dropColumn('books_display'); - }); - - Schema::table('books', function (Blueprint $table) { - $table->dropColumn('image'); - }); - } -} diff --git a/public/default.png b/public/default.png deleted file mode 100644 index 1d7b737e7..000000000 Binary files a/public/default.png and /dev/null differ diff --git a/resources/assets/js/global.js b/resources/assets/js/global.js index 3a288f791..dc6802e12 100644 --- a/resources/assets/js/global.js +++ b/resources/assets/js/global.js @@ -153,13 +153,6 @@ $('[data-action="expand-entity-list-details"]').click(function() { $('.entity-list.compact').find('p').not('.empty-text').slideToggle(240); }); -// Toggle thumbnails -$(document).ready(function(){ - $('[data-action="expand-thumbnail"]').click(function(){ - $('.galleryItem').toggleClass("collapse").find('img').slideToggle(50); - }); -}); - // Popup close $('.popup-close').click(function() { $(this).closest('.overlay').fadeOut(240); diff --git a/resources/assets/sass/styles.scss b/resources/assets/sass/styles.scss index aa3ac1069..afb9d531b 100644 --- a/resources/assets/sass/styles.scss +++ b/resources/assets/sass/styles.scss @@ -63,11 +63,6 @@ body.dragging, body.dragging * { &.square { border-radius: 3px; } - &.cover { - height: 192px; - width: 120px; - border-radius: 3px; - } } // System wide notifications @@ -279,25 +274,5 @@ $btt-size: 40px; } } -.galleryItem { - margin-bottom: 32px; - height: 330px; - overflow: hidden; - border: 1px solid #9e9e9e; - h3 { - font-size: 1.2em; - text-align: center; - } - p { - font-size: 0.8em; - text-align: center; - } - img { - height: 192px; - width: 120px; - margin-top: 5%; - } - &.collapse { - height: 130px; - } -} + + diff --git a/resources/lang/de/common.php b/resources/lang/de/common.php index c3ee51abb..7ad1743a0 100644 --- a/resources/lang/de/common.php +++ b/resources/lang/de/common.php @@ -17,7 +17,6 @@ return [ 'name' => 'Name', 'description' => 'Beschreibung', 'role' => 'Rolle', - 'cover_image' => 'Titelbild', /** * Actions @@ -44,7 +43,7 @@ return [ 'no_items' => 'Keine Einträge gefunden.', 'back_to_top' => 'nach oben', 'toggle_details' => 'Details zeigen/verstecken', - 'toggle_thumbnails' => 'Thumbnails zeigen/verstecken', + /** * Header */ diff --git a/resources/lang/de/settings.php b/resources/lang/de/settings.php index 21d65321f..668eecf33 100644 --- a/resources/lang/de/settings.php +++ b/resources/lang/de/settings.php @@ -91,7 +91,6 @@ return [ 'users_external_auth_id' => 'Externe Authentifizierungs-ID', 'users_password_warning' => 'Füllen Sie die folgenden Felder nur aus, wenn Sie Ihr Passwort ändern möchten:', 'users_system_public' => 'Dieser Benutzer repräsentiert alle Gast-Benutzer, die diese Seite betrachten. Er kann nicht zum Anmelden benutzt werden, sondern wird automatisch zugeordnet.', - 'users_books_display_type' => 'Wählen Sie die Art der Ansicht aus', 'users_delete' => 'Benutzer löschen', 'users_delete_named' => 'Benutzer :userName löschen', 'users_delete_warning' => 'Sie möchten den Benutzer \':userName\' gänzlich aus dem System löschen.', diff --git a/resources/lang/en/common.php b/resources/lang/en/common.php index c05cfa56c..e1d74c95e 100644 --- a/resources/lang/en/common.php +++ b/resources/lang/en/common.php @@ -17,7 +17,6 @@ return [ 'name' => 'Name', 'description' => 'Description', 'role' => 'Role', - 'cover_image' => 'Cover image', /** * Actions @@ -45,7 +44,6 @@ return [ 'no_items' => 'No items available', 'back_to_top' => 'Back to top', 'toggle_details' => 'Toggle Details', - 'toggle_thumbnails' => 'Toggle Thumbnails', /** * Header diff --git a/resources/lang/en/settings.php b/resources/lang/en/settings.php index e95bf35a3..31163e87e 100644 --- a/resources/lang/en/settings.php +++ b/resources/lang/en/settings.php @@ -91,7 +91,6 @@ return [ 'users_external_auth_id' => 'External Authentication ID', 'users_password_warning' => 'Only fill the below if you would like to change your password:', 'users_system_public' => 'This user represents any guest users that visit your instance. It cannot be used to log in but is assigned automatically.', - 'users_books_display_type' => 'Select the type of view', 'users_delete' => 'Delete User', 'users_delete_named' => 'Delete user :userName', 'users_delete_warning' => 'This will fully delete this user with the name \':userName\' from the system.', diff --git a/resources/lang/es/common.php b/resources/lang/es/common.php index 9a8fafc95..3a62a2177 100644 --- a/resources/lang/es/common.php +++ b/resources/lang/es/common.php @@ -17,7 +17,7 @@ return [ 'name' => 'Nombre', 'description' => 'Descripción', 'role' => 'Rol', - 'cover_image' => 'Imagen de portada', + /** * Actions */ @@ -43,7 +43,6 @@ return [ 'no_items' => 'No hay items disponibles', 'back_to_top' => 'Volver arriba', 'toggle_details' => 'Alternar detalles', - 'toggle_thumbnails' => 'Alternar miniaturas', /** * Header diff --git a/resources/lang/es/settings.php b/resources/lang/es/settings.php index 90bb0db2c..cd6a8b8d9 100644 --- a/resources/lang/es/settings.php +++ b/resources/lang/es/settings.php @@ -91,7 +91,6 @@ return [ 'users_external_auth_id' => 'ID externo de autenticación', 'users_password_warning' => 'Solo rellene a continuación si desea cambiar su password:', 'users_system_public' => 'Este usuario representa cualquier usuario invitado que visita la aplicación. No puede utilizarse para hacer login sio que es asignado automáticamente.', - 'users_books_display_type' => 'Seleccione el tipo de vista', 'users_delete' => 'Borrar usuario', 'users_delete_named' => 'Borrar usuario :userName', 'users_delete_warning' => 'Se borrará completamente el usuario con el nombre \':userName\' del sistema.', diff --git a/resources/lang/fr/common.php b/resources/lang/fr/common.php index fe8bb761a..5eb4b8fa8 100644 --- a/resources/lang/fr/common.php +++ b/resources/lang/fr/common.php @@ -17,7 +17,7 @@ return [ 'name' => 'Nom', 'description' => 'Description', 'role' => 'Rôle', - 'cover_image' => 'Image de couverture', + /** * Actions */ @@ -43,7 +43,6 @@ return [ 'no_items' => 'Aucun élément', 'back_to_top' => 'Retour en haut', 'toggle_details' => 'Afficher les détails', - 'toggle_thumbnails' => 'Afficher les vignettes', /** * Header diff --git a/resources/lang/fr/settings.php b/resources/lang/fr/settings.php index 288c56d5a..8a3756527 100644 --- a/resources/lang/fr/settings.php +++ b/resources/lang/fr/settings.php @@ -91,7 +91,6 @@ return [ 'users_external_auth_id' => 'Identifiant d\'authentification externe', 'users_password_warning' => 'Remplissez ce fomulaire uniquement si vous souhaitez changer de mot de passe:', 'users_system_public' => 'Cet utilisateur représente les invités visitant votre instance. Il est assigné automatiquement aux invités.', - 'users_books_display_type' => 'Sélectionnez le type de vue', 'users_delete' => 'Supprimer un utilisateur', 'users_delete_named' => 'Supprimer l\'utilisateur :userName', 'users_delete_warning' => 'Ceci va supprimer \':userName\' du système.', diff --git a/resources/lang/nl/common.php b/resources/lang/nl/common.php index a096c1d22..bdde9eb95 100644 --- a/resources/lang/nl/common.php +++ b/resources/lang/nl/common.php @@ -17,7 +17,7 @@ return [ 'name' => 'Naam', 'description' => 'Beschrijving', 'role' => 'Rol', - 'cover_image' => 'Omslagfoto', + /** * Actions */ @@ -43,7 +43,6 @@ return [ 'no_items' => 'Geen items beschikbaar', 'back_to_top' => 'Terug naar boven', 'toggle_details' => 'Details Weergeven', - 'toggle_thumbnails' => 'Thumbnails Weergeven', /** * Header diff --git a/resources/lang/nl/settings.php b/resources/lang/nl/settings.php index 7b2f94530..7408a2dc3 100644 --- a/resources/lang/nl/settings.php +++ b/resources/lang/nl/settings.php @@ -91,7 +91,6 @@ return [ 'users_external_auth_id' => 'External Authentication ID', 'users_password_warning' => 'Vul onderstaande formulier alleen in als je het wachtwoord wilt aanpassen:', 'users_system_public' => 'De eigenschappen van deze gebruiker worden voor elke gastbezoeker gebruikt. Er kan niet mee ingelogd worden en wordt automatisch toegewezen.', - 'users_books_display_type' => 'Selecteer het type weergave', 'users_delete' => 'Verwijder gebruiker', 'users_delete_named' => 'Verwijder gebruiker :userName', 'users_delete_warning' => 'Dit zal de gebruiker \':userName\' volledig uit het systeem verwijderen.', diff --git a/resources/lang/pt_BR/common.php b/resources/lang/pt_BR/common.php index eba301929..820ba219c 100644 --- a/resources/lang/pt_BR/common.php +++ b/resources/lang/pt_BR/common.php @@ -17,7 +17,7 @@ return [ 'name' => 'Nome', 'description' => 'Descrição', 'role' => 'Regra', - 'cover_image' => 'Imagem de capa', + /** * Actions */ @@ -43,7 +43,6 @@ return [ 'no_items' => 'Nenhum item disponível', 'back_to_top' => 'Voltar ao topo', 'toggle_details' => 'Alternar Detalhes', - 'toggle_thumbnails' => 'Alternar Miniaturas', /** * Header diff --git a/resources/lang/pt_BR/settings.php b/resources/lang/pt_BR/settings.php index b46eda8df..b8d062b5f 100644 --- a/resources/lang/pt_BR/settings.php +++ b/resources/lang/pt_BR/settings.php @@ -91,7 +91,6 @@ return [ 'users_external_auth_id' => 'ID de Autenticação Externa', 'users_password_warning' => 'Preencha os dados abaixo caso queira modificar a sua senha:', 'users_system_public' => 'Esse usuário representa quaisquer convidados que visitam o aplicativo. Ele não pode ser usado para login.', - 'users_books_display_type' => 'Selecione o tipo de exibição', 'users_delete' => 'Excluir Usuário', 'users_delete_named' => 'Excluir :userName', 'users_delete_warning' => 'A ação vai excluir completamente o usuário de nome \':userName\' do sistema.', diff --git a/resources/lang/sk/common.php b/resources/lang/sk/common.php index 19ba665b5..100981597 100644 --- a/resources/lang/sk/common.php +++ b/resources/lang/sk/common.php @@ -17,7 +17,7 @@ return [ 'name' => 'Meno', 'description' => 'Popis', 'role' => 'Rola', - 'cover_image' => 'Obal knihy', + /** * Actions */ @@ -43,7 +43,6 @@ return [ 'no_items' => 'Žiadne položky nie sú dostupné', 'back_to_top' => 'Späť nahor', 'toggle_details' => 'Prepnúť detaily', - 'toggle_thumbnails' => 'Prepnúť náhľady', /** * Header diff --git a/resources/lang/sk/settings.php b/resources/lang/sk/settings.php index 1c745fcf8..643b4b8ff 100644 --- a/resources/lang/sk/settings.php +++ b/resources/lang/sk/settings.php @@ -91,7 +91,6 @@ return [ 'users_external_auth_id' => 'Externé autentifikačné ID', 'users_password_warning' => 'Pole nižšie vyplňte iba ak chcete zmeniť heslo:', 'users_system_public' => 'Tento účet reprezentuje každého hosťovského používateľa, ktorý navštívi Vašu inštanciu. Nedá sa pomocou neho prihlásiť a je priradený automaticky.', - 'users_books_display_type' => 'Vyberte typ zobrazenia', 'users_delete' => 'Zmazať používateľa', 'users_delete_named' => 'Zmazať používateľa :userName', 'users_delete_warning' => ' Toto úplne odstráni používateľa menom \':userName\' zo systému.', diff --git a/resources/views/books/create.blade.php b/resources/views/books/create.blade.php index 4d1edf78b..2c629e699 100644 --- a/resources/views/books/create.blade.php +++ b/resources/views/books/create.blade.php @@ -4,10 +4,9 @@

{{ trans('entities.books_create') }}

-
+ @include('books/form')
-


- @include('components.image-manager', ['imageType' => 'cover']) + @stop \ No newline at end of file diff --git a/resources/views/books/edit.blade.php b/resources/views/books/edit.blade.php index 322f3d700..2419b68da 100644 --- a/resources/views/books/edit.blade.php +++ b/resources/views/books/edit.blade.php @@ -19,5 +19,5 @@ @include('books/form', ['model' => $book]) -@include('components.image-manager', ['imageType' => 'cover']) + @stop \ No newline at end of file diff --git a/resources/views/books/form.blade.php b/resources/views/books/form.blade.php index 34f5fd842..b1484d129 100644 --- a/resources/views/books/form.blade.php +++ b/resources/views/books/form.blade.php @@ -9,21 +9,7 @@ @include('form/textarea', ['name' => 'description']) -
- -

{{ trans('common.cover_image_description') }}

- @include('components.image-picker', [ - 'resizeHeight' => '192', - 'resizeWidth' => '120', - 'showRemove' => true, - 'defaultImage' => baseUrl('/default.png'), - 'currentImage' => @isset($model) ? $model->getBookCover(80) : baseUrl('/default.png') , - 'currentId' => @isset($model) ? $model->image : 0, - 'name' => 'image', - 'imageClass' => 'avatar cover' - ]) -
{{ trans('common.cancel') }} diff --git a/resources/views/books/grid-item.blade.php b/resources/views/books/grid-item.blade.php deleted file mode 100644 index d11a66eac..000000000 --- a/resources/views/books/grid-item.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -
-
-

- {{$book->name}} -
- {{$book->name}} -
-

- @if(isset($book->searchSnippet)) -

{!! $book->searchSnippet !!}

- @else -

{{ $book->getExcerpt() }}

- @endif -
-
\ No newline at end of file diff --git a/resources/views/books/index.blade.php b/resources/views/books/index.blade.php index c5dd38a87..c090a127e 100644 --- a/resources/views/books/index.blade.php +++ b/resources/views/books/index.blade.php @@ -5,13 +5,13 @@
-
-
- {{ trans('common.toggle_thumbnails') }} +
+
+
@if($currentUser->can('book-create-all')) {{ trans('entities.books_create') }} @endif -
+
@@ -20,22 +20,14 @@
-
+

{{ trans('entities.books') }}

@if(count($books) > 0) - @if($books_display=='grid') - @foreach($books as $book) - @include('books/grid-item', ['book' => $book]) - @endforeach -
- {!! $books->render() !!} -
- @else - @foreach($books as $book) - @include('books/list-item', ['book' => $book]) - @endforeach - {!! $books->render() !!} - @endif + @foreach($books as $book) + @include('books/list-item', ['book' => $book]) +
+ @endforeach + {!! $books->render() !!} @else

{{ trans('entities.books_empty') }}

@if(userCan('books-create-all')) @@ -43,7 +35,7 @@ @endif @endif
-
+
@if($recents)
 
diff --git a/resources/views/users/edit.blade.php b/resources/views/users/edit.blade.php index c15e34974..ff3475194 100644 --- a/resources/views/users/edit.blade.php +++ b/resources/views/users/edit.blade.php @@ -49,13 +49,6 @@ @endforeach
-
- - -