mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Converted books view setting to user setting
Also cleaned up/moved new CSS and removed redundant new book methods.
This commit is contained in:
@@ -119,19 +119,6 @@ jQuery.expr[":"].contains = $.expr.createPseudo(function (arg) {
|
||||
};
|
||||
});
|
||||
|
||||
// Common jQuery actions
|
||||
$('[data-action="expand-entity-list-details"]').click(function() {
|
||||
$('.entity-list.compact').find('p').not('.empty-text').slideToggle(240);
|
||||
});
|
||||
|
||||
// Toggle thumbnail::hide image and reduce grid size
|
||||
$(document).ready(function(){
|
||||
$('[data-action="expand-thumbnail"]').click(function(){
|
||||
$('.gallery-item').toggleClass("collapse").find('img').slideToggle(50);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Detect IE for css
|
||||
if(navigator.userAgent.indexOf('MSIE')!==-1
|
||||
|| navigator.appVersion.indexOf('Trident/') > 0
|
||||
|
@@ -195,6 +195,14 @@ div[class^="col-"] img {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@include larger-than(991px) {
|
||||
.row.auto-clear .col-md-4:nth-child(3n+1){clear:left;}
|
||||
}
|
||||
|
||||
@include smaller-than(992px) {
|
||||
.row.auto-clear .col-xs-6:nth-child(2n+1){clear:left;}
|
||||
}
|
||||
|
||||
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
|
||||
position: relative;
|
||||
min-height: 1px;
|
||||
|
@@ -373,3 +373,51 @@ ul.pagination {
|
||||
border-bottom: 1px solid #DDD;
|
||||
}
|
||||
}
|
||||
|
||||
// Books grid view
|
||||
.featured-image-container {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: #F2F2F2;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom: 0;
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
transition: all .5s ease;
|
||||
}
|
||||
img:hover {
|
||||
transform: scale(1.15);
|
||||
opacity: .5;
|
||||
}
|
||||
}
|
||||
|
||||
.book-grid-content {
|
||||
padding: 30px;
|
||||
border: 1px solid #ddd;
|
||||
border-top: 0;
|
||||
border-bottom-width: 2px;
|
||||
h2 {
|
||||
font-size: 1.5em;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
h2 a {
|
||||
display: block;
|
||||
line-height: 1.2;
|
||||
color: #009688;;
|
||||
text-decoration: none;
|
||||
}
|
||||
p {
|
||||
font-size: .85em;
|
||||
margin: 0 0 10px;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
p.small {
|
||||
font-size: .8em;
|
||||
}
|
||||
}
|
||||
|
||||
.book-grid-item {
|
||||
margin-bottom : 20px;
|
||||
}
|
||||
|
@@ -231,75 +231,4 @@ $btt-size: 40px;
|
||||
input {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
// styles for Books grid view
|
||||
.cover {
|
||||
width: 290px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.featured-image-container {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: #F2F2F2;
|
||||
border: 1px solid #ddd;
|
||||
border-bottom: 0px;
|
||||
}
|
||||
|
||||
.featured-image-container img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
-webkit-transition: all .5s ease;
|
||||
-moz-transition: all .5s ease;
|
||||
-ms-transition: all .5s ease;
|
||||
-o-transition: all .5s ease;
|
||||
transition: all .5s ease;
|
||||
}
|
||||
|
||||
.book-content {
|
||||
padding: 30px;
|
||||
border: 1px solid #ddd;
|
||||
border-top: 0px;
|
||||
border-bottom-width: 2px;
|
||||
}
|
||||
.book-content h2 {
|
||||
font-size: 1.5em;
|
||||
line-height: 1.2;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.book-content h2 a {
|
||||
display: block;
|
||||
color: #009688;;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.book-content p {
|
||||
font-size: .85em;
|
||||
margin: 0 0 10px;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
||||
.featured-image-container img:hover {
|
||||
-webkit-transform: scale(1.15);
|
||||
-moz-transform: scale(1.15);
|
||||
-ms-transform: scale(1.15);
|
||||
-o-transform: scale(1.15);
|
||||
transform: scale(1.15);
|
||||
opacity: .5;
|
||||
}
|
||||
.books-grid-div {
|
||||
margin-bottom : 20px;
|
||||
}
|
||||
|
||||
@media (min-width:992px){
|
||||
.row.auto-clear .col-md-4:nth-child(3n+1){clear:left;}
|
||||
}
|
||||
@media (min-width:992px){
|
||||
.row.auto-clear .col-md-4:nth-child(3n+1){clear:left;}
|
||||
}
|
||||
@media (max-width:991px){
|
||||
.row.auto-clear .col-xs-6:nth-child(2n+1){clear:left;}
|
||||
}
|
@@ -1,13 +1,13 @@
|
||||
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 books-grid-div" data-entity-type="book" data-entity-id="{{$book->id}}">
|
||||
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4 book-grid-item" data-entity-type="book" data-entity-id="{{$book->id}}">
|
||||
<div class="featured-image-container">
|
||||
<a href="{{$book->getUrl()}}" title="{{$book->name}}">
|
||||
<img width="1600" height="900" src="{{$book->getBookCover()}}" alt="{{$book->name}}">
|
||||
</a>
|
||||
</div>
|
||||
<div class="book-content">
|
||||
<h2><a href="{{$book->getUrl()}}" title="{{$book->name}}" > {{$book->getHeadingExcerpt()}} </a></h2>
|
||||
<div class="book-grid-content">
|
||||
<h2><a href="{{$book->getUrl()}}" title="{{$book->name}}" > {{$book->getShortName(35)}} </a></h2>
|
||||
@if(isset($book->searchSnippet))
|
||||
<p >{{!! $book->searchSnippet !!}}</p>
|
||||
<p >{!! $book->searchSnippet !!}</p>
|
||||
@else
|
||||
<p >{{ $book->getExcerpt(130) }}</p>
|
||||
@endif
|
||||
|
@@ -45,9 +45,9 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="books-view-type">{{ trans('settings.users_books_view_type') }}</label>
|
||||
<select name="books_view_type" id="books-view-type">
|
||||
<option @if($user->books_view_type === 'grid') selected @endif value="grid">Grid</option>
|
||||
<option @if($user->books_view_type === 'list') selected @endif value="list">List</option>
|
||||
<select name="setting[books_view_type]" id="books-view-type">
|
||||
<option @if(setting()->getUser($user, 'books_view_type', 'list') === 'list') selected @endif value="list">List</option>
|
||||
<option @if(setting()->getUser($user, 'books_view_type', 'list') === 'grid') selected @endif value="grid">Grid</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user