.bg-chapter {
background-color: var(--color-chapter);
}
-.bg-shelf {
+.bg-bookshelf {
background-color: var(--color-bookshelf);
}
overflow-wrap: break-word;
}
-.limit-text {
+.text-limit-lines-1 {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
+.text-limit-lines-2 {
+ // -webkit use here is actually standardised cross-browser:
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-line-clamp
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ overflow: hidden;
+}
+
/**
* Grouping
*/
+++ /dev/null
-<a href="{{$book->getUrl()}}" class="grid-card" data-entity-type="book" data-entity-id="{{$book->id}}">
- <div class="bg-book featured-image-container-wrap">
- <div class="featured-image-container" @if($book->cover) style="background-image: url('{{ $book->getBookCover() }}')"@endif>
- </div>
- @icon('book')
- </div>
- <div class="grid-card-content">
- <h2>{{$book->getShortName(35)}}</h2>
- @if(isset($book->searchSnippet))
- <p class="text-muted">{!! $book->searchSnippet !!}</p>
- @else
- <p class="text-muted">{{ $book->getExcerpt(130) }}</p>
- @endif
- </div>
- <div class="grid-card-footer text-muted ">
- <p>@icon('star')<span title="{{$book->created_at->toDayDateTimeString()}}">{{ trans('entities.meta_created', ['timeLength' => $book->created_at->diffForHumans()]) }}</span></p>
- <p>@icon('edit')<span title="{{ $book->updated_at->toDayDateTimeString() }}">{{ trans('entities.meta_updated', ['timeLength' => $book->updated_at->diffForHumans()]) }}</span></p>
- </div>
-</a>
\ No newline at end of file
-
<main class="content-wrap mt-m card">
<div class="grid half v-center no-row-gap">
<h1 class="list-heading">{{ trans('entities.books') }}</h1>
@else
<div class="grid third">
@foreach($books as $key => $book)
- @include('books.grid-item', ['book' => $book])
+ @include('partials.entity-grid-item', ['entity' => $book])
@endforeach
</div>
@endif
<div class="sidebar-page-nav menu">
@foreach($pageNav as $navItem)
<li class="page-nav-item h{{ $navItem['level'] }}">
- <a href="{{ $navItem['link'] }}" class="limit-text block">{{ $navItem['text'] }}</a>
+ <a href="{{ $navItem['link'] }}" class="text-limit-lines-1 block">{{ $navItem['text'] }}</a>
<div class="primary-background sidebar-page-nav-bullet"></div>
</li>
@endforeach
--- /dev/null
+<a href="{{ $entity->getUrl() }}" class="grid-card"
+ data-entity-type="{{ $entity->getType() }}" data-entity-id="{{ $entity->id }}">
+ <div class="bg-{{ $entity->getType() }} featured-image-container-wrap">
+ <div class="featured-image-container" @if($entity->cover) style="background-image: url('{{ $entity->getBookCover() }}')"@endif>
+ </div>
+ @icon($entity->getType())
+ </div>
+ <div class="grid-card-content">
+ <h2 class="text-limit-lines-2">{{ $entity->name }}</h2>
+ <p class="text-muted">{{ $entity->getExcerpt(130) }}</p>
+ </div>
+ <div class="grid-card-footer text-muted ">
+ <p>@icon('star')<span title="{{ $entity->created_at->toDayDateTimeString() }}">{{ trans('entities.meta_created', ['timeLength' => $entity->created_at->diffForHumans()]) }}</span></p>
+ <p>@icon('edit')<span title="{{ $entity->updated_at->toDayDateTimeString() }}">{{ trans('entities.meta_updated', ['timeLength' => $entity->updated_at->diffForHumans()]) }}</span></p>
+ </div>
+</a>
\ No newline at end of file
+++ /dev/null
-<a href="{{$shelf->getUrl()}}" class="bookshelf-grid-item grid-card"
- data-entity-type="bookshelf" data-entity-id="{{$shelf->id}}">
- <div class="bg-shelf featured-image-container-wrap">
- <div class="featured-image-container" @if($shelf->cover) style="background-image: url('{{ $shelf->getBookCover() }}')"@endif>
- </div>
- @icon('bookshelf')
- </div>
- <div class="grid-card-content">
- <h2>{{$shelf->getShortName(35)}}</h2>
- @if(isset($shelf->searchSnippet))
- <p class="text-muted">{!! $shelf->searchSnippet !!}</p>
- @else
- <p class="text-muted">{{ $shelf->getExcerpt(130) }}</p>
- @endif
- </div>
- <div class="grid-card-footer text-muted text-small">
- @icon('star')<span title="{{$shelf->created_at->toDayDateTimeString()}}">{{ trans('entities.meta_created', ['timeLength' => $shelf->created_at->diffForHumans()]) }}</span>
- <br>
- @icon('edit')<span title="{{ $shelf->updated_at->toDayDateTimeString() }}">{{ trans('entities.meta_updated', ['timeLength' => $shelf->updated_at->diffForHumans()]) }}</span>
- </div>
-</a>
\ No newline at end of file
<a href="{{ $shelf->getUrl() }}" class="shelf entity-list-item" data-entity-type="bookshelf" data-entity-id="{{$shelf->id}}">
- <div class="entity-list-item-image bg-shelf @if($shelf->image_id) has-image @endif" style="background-image: url('{{ $shelf->getBookCover() }}')">
+ <div class="entity-list-item-image bg-bookshelf @if($shelf->image_id) has-image @endif" style="background-image: url('{{ $shelf->getBookCover() }}')">
@icon('bookshelf')
</div>
<div class="content py-xs">
@else
<div class="grid third">
@foreach($shelves as $key => $shelf)
- @include('shelves.grid-item', ['shelf' => $shelf])
+ @include('partials.entity-grid-item', ['entity' => $shelf])
@endforeach
</div>
@endif
@else
<div class="grid third">
@foreach($shelf->visibleBooks as $key => $book)
- @include('books.grid-item', ['book' => $book])
+ @include('partials.entity-grid-item', ['entity' => $book])
@endforeach
</div>
@endif