Skip to content

WIP: Book Coverart and Grid Display - #434

Closed
AbijeetP wants to merge 70 commits into
BookStackApp:masterfrom
OsmosysSoftware:master
Closed

AbijeetP wants to merge 70 commits into
BookStackApp:masterfrom
OsmosysSoftware:master

Conversation

@AbijeetP

@AbijeetP AbijeetP commented Jul 13, 2017

Copy link
Copy Markdown
Contributor

Towards #181

@AbijeetP AbijeetP changed the title Book Coverart and Grid Display WIP: Book Coverart and Grid Display Aug 28, 2017
Comment thread app/Book.php Outdated
return baseUrl('/books/' . urlencode($this->slug));
}

public function getBookCover()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add proper comments to the function.

Comment thread app/Book.php Outdated
if ($image === 0 || $image === '0' || $image === null)
return $default;
try {
$cover = $this->cover ? baseUrl($this->cover->getThumb(120, 192, false)) : $default;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 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.

Comment thread app/Book.php
return $cover;
}

public function getHeadingExcerpt($length = 35)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Comments are missing.

Comment thread app/Book.php Outdated

public function cover()
{
return $this->belongsTo(Image::class, 'image');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Added database column as image, but it should be image_id.

Comment thread app/Http/Controllers/BookController.php Outdated
public function index()
{
$books = $this->entityRepo->getAllPaginated('book', 10);
$books = $this->entityRepo->getAllPaginated('book', 16);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/Http/Controllers/BookController.php Outdated
$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;

@ghost ghost Aug 28, 2017

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$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');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • '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');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Column name should be image_id not image.

Comment thread resources/assets/js/global.js Outdated
};
});

// Global jQuery Elements

@ghost ghost Aug 28, 2017

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this part of the code ( line number 103 to 163 ) , I guess it's related to notifications.

Comment thread resources/assets/js/global.js Outdated
});

// Popup close
$('.popup-close').click(function() {

@ghost ghost Aug 28, 2017

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove the code from line number 173 to 179.

});

// Toggle thumbnail::hide image and reduce grid size
$(document).ready(function(){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}}">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change$currentId !== '' to $currentId !== 0 ?

Bharadwaja G and others added 7 commits August 29, 2017 12:19
… 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
@ghost ghost mentioned this pull request Sep 5, 2017
@AbijeetP AbijeetP closed this Sep 5, 2017
@ghost

ghost commented Sep 5, 2017

Copy link
Copy Markdown

@Abijeet @ssddanbrown
This issue has been tracking under this pull request - #494
Here we can see the latest changes - https://gfycat.com/UncomfortableSpanishHamadryad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants