mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-12 03:41:54 +00:00
Updated books listing to three column layout design
This commit is contained in:
parent
aabd4c0412
commit
2a882a43ff
9 changed files with 108 additions and 40 deletions
resources
|
@ -64,12 +64,10 @@ body.flexbox {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
.flex.sidebar + .flex .content-wrap {
|
.flex.sidebar + .flex .content-wrap {
|
||||||
background-color: #FFFFFF;
|
|
||||||
padding: $-l $-xxl;
|
padding: $-l $-xxl;
|
||||||
box-shadow: $bs-card;
|
|
||||||
border-radius: 4px;
|
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
|
margin-bottom: $-xl;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
&.thin {
|
&.thin {
|
||||||
width: 940px;
|
width: 940px;
|
||||||
|
@ -156,6 +154,13 @@ body.flexbox {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tri-layout-left, .tri-layout-right {
|
||||||
|
opacity: 0.8;
|
||||||
|
transition: opacity ease-in-out 120ms;
|
||||||
|
&:hover {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Rules for all columns */
|
/** Rules for all columns */
|
||||||
div[class^="col-"] img {
|
div[class^="col-"] img {
|
||||||
|
|
|
@ -251,7 +251,8 @@ ul.pagination {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entity-list {
|
.entity-list, .icon-list {
|
||||||
|
margin: 0 (-$-m);
|
||||||
h4 {
|
h4 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
@ -272,7 +273,7 @@ ul.pagination {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.entity-list-item {
|
.entity-list-item, .icon-list-item {
|
||||||
padding: $-s $-m;
|
padding: $-s $-m;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: min-content 1fr;
|
grid-template-columns: min-content 1fr;
|
||||||
|
@ -287,9 +288,14 @@ ul.pagination {
|
||||||
h4 a {
|
h4 a {
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
background-color: #DDD;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
a.entity-list-item:hover {
|
|
||||||
text-decoration: none;
|
.card a.entity-list-item:hover {
|
||||||
background-color: #F2F2F2;
|
background-color: #F2F2F2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,3 +415,13 @@ a.entity-list-item:hover {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.action-link-list {
|
||||||
|
//padding: $-s 0;
|
||||||
|
}
|
||||||
|
.action-link {
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
color: currentColor;
|
||||||
|
padding: $-m 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -364,8 +364,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.entity-icon {
|
.entity-list-item > .icon, .icon-list-item > .icon {
|
||||||
font-size: 1.3em;
|
font-size: 0.8rem;
|
||||||
width: 1.88em;
|
width: 1.88em;
|
||||||
height: 1.88em;
|
height: 1.88em;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -1,19 +1,6 @@
|
||||||
@extends('sidebar-layout')
|
@extends('tri-layout')
|
||||||
|
|
||||||
@section('toolbar')
|
@section('left')
|
||||||
<div class="grid halves">
|
|
||||||
<div class="action-buttons text-left">
|
|
||||||
@include('books.view-toggle', ['booksViewType' => $booksViewType])
|
|
||||||
</div>
|
|
||||||
<div class="action-buttons">
|
|
||||||
@if($currentUser->can('book-create-all'))
|
|
||||||
<a href="{{ baseUrl("/create-book") }}" class="text-pos text-button">@icon('add'){{ trans('entities.books_create') }}</a>
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@stop
|
|
||||||
|
|
||||||
@section('sidebar')
|
|
||||||
@if($recents)
|
@if($recents)
|
||||||
<div id="recents" class="mb-xl">
|
<div id="recents" class="mb-xl">
|
||||||
<h5>{{ trans('entities.recently_viewed') }}</h5>
|
<h5>{{ trans('entities.recently_viewed') }}</h5>
|
||||||
|
@ -42,4 +29,21 @@
|
||||||
|
|
||||||
@section('body')
|
@section('body')
|
||||||
@include('books.list', ['books' => $books, 'bookViewType' => $booksViewType])
|
@include('books.list', ['books' => $books, 'bookViewType' => $booksViewType])
|
||||||
|
@stop
|
||||||
|
|
||||||
|
@section('right')
|
||||||
|
|
||||||
|
<div class="actions mb-xl px-xl">
|
||||||
|
<h5>Actions</h5>
|
||||||
|
<div class="icon-list text-primary">
|
||||||
|
@if($currentUser->can('book-create-all'))
|
||||||
|
<a href="{{ baseUrl("/create-book") }}" class="icon-list-item">
|
||||||
|
<span class="icon">@icon('add')</span>
|
||||||
|
<span>{{ trans('entities.books_create') }}</span>
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
|
@include('books.view-toggle', ['booksViewType' => $booksViewType])
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@stop
|
@stop
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
<div class="content-wrap {{ $booksViewType === 'list' ? 'thin' : '' }}">
|
<div class="content-wrap card {{ $booksViewType === 'list' ? 'thin' : '' }}">
|
||||||
<h1 class="list-heading px-m">{{ trans('entities.books') }}</h1>
|
<h1 class="list-heading">{{ trans('entities.books') }}</h1>
|
||||||
@if(count($books) > 0)
|
@if(count($books) > 0)
|
||||||
@if($booksViewType === 'list')
|
@if($booksViewType === 'list')
|
||||||
<div class="entity-list">
|
<div class="entity-list">
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
<form action="{{ baseUrl("/settings/users/{$currentUser->id}/switch-book-view") }}" method="POST" class="inline">
|
<div>
|
||||||
{!! csrf_field() !!}
|
<form action="{{ baseUrl("/settings/users/{$currentUser->id}/switch-book-view") }}" method="POST" class="inline">
|
||||||
{!! method_field('PATCH') !!}
|
{!! csrf_field() !!}
|
||||||
<input type="hidden" value="{{ $booksViewType === 'list'? 'grid' : 'list' }}" name="view_type">
|
{!! method_field('PATCH') !!}
|
||||||
@if ($booksViewType === 'list')
|
<input type="hidden" value="{{ $booksViewType === 'list'? 'grid' : 'list' }}" name="view_type">
|
||||||
<button type="submit" class="text-pos text-button">@icon('grid'){{ trans('common.grid_view') }}</button>
|
@if ($booksViewType === 'list')
|
||||||
@else
|
<a onclick="this.closest('form').submit()" type="submit" class="icon-list-item">
|
||||||
<button type="submit" class="text-pos text-button">@icon('list'){{ trans('common.list_view') }}</button>
|
<span class="icon">@icon('grid')</span>
|
||||||
@endif
|
<span>{{ trans('common.grid_view') }}</span>
|
||||||
</form>
|
</a>
|
||||||
|
@else
|
||||||
|
<a onclick="this.closest('form').submit()" type="submit" class="icon-list-item">
|
||||||
|
<span class="icon">@icon('list')</span>
|
||||||
|
<span>{{ trans('common.list_view') }}</span>
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
|
</form>
|
||||||
|
</div>
|
|
@ -12,24 +12,28 @@
|
||||||
@if(count($draftPages) > 0)
|
@if(count($draftPages) > 0)
|
||||||
<div id="recent-drafts" class="card mb-xl">
|
<div id="recent-drafts" class="card mb-xl">
|
||||||
<h3>{{ trans('entities.my_recent_drafts') }}</h3>
|
<h3>{{ trans('entities.my_recent_drafts') }}</h3>
|
||||||
@include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
|
<div class="px-m">
|
||||||
|
@include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div id="{{ $signedIn ? 'recently-viewed' : 'recent-books' }}" class="card mb-xl">
|
<div id="{{ $signedIn ? 'recently-viewed' : 'recent-books' }}" class="card mb-xl">
|
||||||
<h3>{{ trans('entities.' . ($signedIn ? 'my_recently_viewed' : 'books_recent')) }}</h3>
|
<h3>{{ trans('entities.' . ($signedIn ? 'my_recently_viewed' : 'books_recent')) }}</h3>
|
||||||
@include('partials/entity-list', [
|
<div class="px-m">
|
||||||
|
@include('partials/entity-list', [
|
||||||
'entities' => $recents,
|
'entities' => $recents,
|
||||||
'style' => 'compact',
|
'style' => 'compact',
|
||||||
'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
|
'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
|
||||||
])
|
])
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div id="recent-pages" class="card mb-xl">
|
<div id="recent-pages" class="card mb-xl">
|
||||||
<h3><a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
|
<h3><a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
|
||||||
<div id="recently-updated-pages">
|
<div id="recently-updated-pages" class="px-m">
|
||||||
@include('partials/entity-list', [
|
@include('partials/entity-list', [
|
||||||
'entities' => $recentlyUpdatedPages,
|
'entities' => $recentlyUpdatedPages,
|
||||||
'style' => 'compact',
|
'style' => 'compact',
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php $type = $entity->getType(); ?>
|
<?php $type = $entity->getType(); ?>
|
||||||
<a href="{{ $entity->getUrl() }}" class="{{$type}} {{$type === 'page' && $entity->draft ? 'draft' : ''}} {{$classes ?? ''}} entity-list-item" data-entity-type="{{$type}}" data-entity-id="{{$entity->id}}">
|
<a href="{{ $entity->getUrl() }}" class="{{$type}} {{$type === 'page' && $entity->draft ? 'draft' : ''}} {{$classes ?? ''}} entity-list-item" data-entity-type="{{$type}}" data-entity-id="{{$entity->id}}">
|
||||||
<div class="entity-icon text-{{$type}}">@icon($type)</div>
|
<div class="icon text-{{$type}}">@icon($type)</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h4 class="entity-list-item-name break-text">{{ $entity->name }}</h4>
|
<h4 class="entity-list-item-name break-text">{{ $entity->name }}</h4>
|
||||||
{{ $slot ?? '' }}
|
{{ $slot ?? '' }}
|
||||||
|
|
31
resources/views/tri-layout.blade.php
Normal file
31
resources/views/tri-layout.blade.php
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
@extends('base')
|
||||||
|
|
||||||
|
@section('body-class', 'tri-layout')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<div class="toolbar px-xl py-m">
|
||||||
|
@yield('toolbar')
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex-fill flex" @yield('container-attrs') >
|
||||||
|
|
||||||
|
<div sidebar class="sidebar flex print-hidden tri-layout-left" id="sidebar">
|
||||||
|
<div class="sidebar-toggle primary-background-light">@icon('caret-right-circle')
|
||||||
|
</div>
|
||||||
|
<div class="scroll-body px-xl">
|
||||||
|
@yield('left')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex @yield('body-wrap-classes')">
|
||||||
|
@yield('body')
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex tri-layout-right">
|
||||||
|
@yield('right')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@stop
|
Loading…
Add table
Add a link
Reference in a new issue