Conversation
Bookstack grid view issue 181.
Revert "Bookstack grid view."
Getting latest changes
Revert "Revert "Bookstack grid view.""
| return baseUrl('/books/' . urlencode($this->slug)); | ||
| } | ||
|
|
||
| public function getBookCover() |
| if ($image === 0 || $image === '0' || $image === null) | ||
| return $default; | ||
| try { | ||
| $cover = $this->cover ? baseUrl($this->cover->getThumb(120, 192, false)) : $default; |
There was a problem hiding this comment.
- It's better to take width and height parameters instead of hard coding directly, so it will help us in feature to retrieve book cover in whatever size we want.
| return $cover; | ||
| } | ||
|
|
||
| public function getHeadingExcerpt($length = 35) |
|
|
||
| public function cover() | ||
| { | ||
| return $this->belongsTo(Image::class, 'image'); |
There was a problem hiding this comment.
- Added database column as image, but it should be image_id.
| public function index() | ||
| { | ||
| $books = $this->entityRepo->getAllPaginated('book', 10); | ||
| $books = $this->entityRepo->getAllPaginated('book', 16); |
There was a problem hiding this comment.
Changing of 10 to 16 books per page will effect in list grid also.
I can understand your intention to made it as 16 ( 4 grid per row ), but it should not affect the list grid.
| $recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('book', 4, 0) : false; | ||
| $popular = $this->entityRepo->getPopular('book', 4, 0); | ||
| $popular = $this->entityRepo->getPopular('book', 3, 0); | ||
| $books_display = $this->currentUser->books_display; |
There was a problem hiding this comment.
$books_display should be $booksDisplay, same for below line too.
| public function up() | ||
| { | ||
| Schema::table('users', function (Blueprint $table) { | ||
| $table->string('books_display',10)->default('grid'); |
There was a problem hiding this comment.
'books_display'can we rename it to something better like 'books_view_type'.- Is data length 10 is okay for now?
| }); | ||
|
|
||
| Schema::table('books', function (Blueprint $table) { | ||
| $table->integer('image'); |
There was a problem hiding this comment.
- Column name should be image_id not image.
| }; | ||
| }); | ||
|
|
||
| // Global jQuery Elements |
There was a problem hiding this comment.
We can remove this part of the code ( line number 103 to 163 ) , I guess it's related to notifications.
| }); | ||
|
|
||
| // Popup close | ||
| $('.popup-close').click(function() { |
There was a problem hiding this comment.
We can remove the code from line number 173 to 179.
| }); | ||
|
|
||
| // Toggle thumbnail::hide image and reduce grid size | ||
| $(document).ready(function(){ |
There was a problem hiding this comment.
We don't need $(document).ready(function(){
| @endif | ||
|
|
||
| <input type="hidden" name="{{$name}}" id="{{$name}}" value="{{ isset($currentId) && ($currentId !== '' && $currentId !== false) ? $currentId : $currentImage}}"> | ||
| <input type="hidden" name="{{$name}}" id="{{$name}}" value="{{ isset($currentId) && ($currentId !== 0 && $currentId !== false) ? $currentId : $currentImage}}"> |
There was a problem hiding this comment.
Why this change$currentId !== '' to $currentId !== 0 ?
… BookStackApp-master Conflicts: app/Http/Controllers/BookController.php resources/lang/en/common.php resources/views/books/create.blade.php resources/views/books/form.blade.php resources/views/books/index.blade.php resources/views/users/edit.blade.php tests/Entity/EntityTest.php
Book stack app master
Getting latest changes
|
@Abijeet @ssddanbrown |
Towards #181