1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2024-10-30 07:32:39 +01:00

Reorganised home and robots views

Extracted home view sidebar into own view.
Moved home and robot views into 'common' folder so that we only have
layouts in the top-level views folder.
This commit is contained in:
Dan Brown 2018-05-20 10:11:56 +01:00
parent 8df9dab80a
commit 63f96c1c6f
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
9 changed files with 71 additions and 107 deletions

View File

@ -60,7 +60,7 @@ class HomeController extends Controller
$view = 'home-custom';
}
return view($view, [
return view('common/' . $view, [
'activity' => $activity,
'recents' => $recents,
'recentlyUpdatedPages' => $recentlyUpdatedPages,
@ -150,7 +150,7 @@ class HomeController extends Controller
$allowRobots = $sitePublic;
}
return response()
->view('robots', ['allowRobots' => $allowRobots])
->view('common/robots', ['allowRobots' => $allowRobots])
->header('Content-Type', 'text/plain');
}

View File

@ -0,0 +1,18 @@
@extends('sidebar-layout')
@section('toolbar')
<div class="col-sm-6 faded">
<div class="action-buttons text-left">
<a expand-toggle=".entity-list.compact .entity-item-snippet" class="text-primary text-button">@icon('expand-text'){{ trans('common.toggle_details') }}</a>
@include('books/view-toggle', ['booksViewType' => $booksViewType])
</div>
</div>
@stop
@section('sidebar')
@include('common/home-sidebar')
@stop
@section('body')
@include('books/list', ['books' => $books, 'bookViewType' => $booksViewType])
@stop

View File

@ -0,0 +1,19 @@
@extends('sidebar-layout')
@section('toolbar')
<div class="col-sm-6 faded">
<div class="action-buttons text-left">
<a expand-toggle=".entity-list.compact .entity-item-snippet" class="text-primary text-button">@icon('expand-text'){{ trans('common.toggle_details') }}</a>
</div>
</div>
@stop
@section('sidebar')
@include('common/home-sidebar')
@stop
@section('body')
<div class="page-content" page-display="{{ $customHomepage->id }}">
@include('pages/page-display', ['page' => $customHomepage])
</div>
@stop

View File

@ -0,0 +1,31 @@
@if(count($draftPages) > 0)
<div id="recent-drafts" class="card">
<h3>@icon('edit') {{ trans('entities.my_recent_drafts') }}</h3>
@include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
</div>
@endif
<div class="card">
<h3>@icon($signedIn ? 'view' : 'star-circle') {{ trans('entities.' . ($signedIn ? 'my_recently_viewed' : 'books_recent')) }}</h3>
@include('partials/entity-list', [
'entities' => $recents,
'style' => 'compact',
'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
])
</div>
<div class="card">
<h3>@icon('file') <a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
<div id="recently-updated-pages">
@include('partials/entity-list', [
'entities' => $recentlyUpdatedPages,
'style' => 'compact',
'emptyText' => trans('entities.no_pages_recently_updated')
])
</div>
</div>
<div id="recent-activity" class="card">
<h3>@icon('time') {{ trans('entities.recent_activity') }}</h3>
@include('partials/activity-list', ['activity' => $activity])
</div>

View File

@ -1,48 +0,0 @@
@extends('sidebar-layout')
@section('toolbar')
<div class="col-sm-6 faded">
<div class="action-buttons text-left">
<a expand-toggle=".entity-list.compact .entity-item-snippet" class="text-primary text-button">@icon('expand-text'){{ trans('common.toggle_details') }}</a>
@include('books/view-toggle', ['booksViewType' => $booksViewType])
</div>
</div>
@stop
@section('sidebar')
@if(count($draftPages) > 0)
<div id="recent-drafts" class="card">
<h3>@icon('edit') {{ trans('entities.my_recent_drafts') }}</h3>
@include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
</div>
@endif
<div class="card">
<h3>@icon($signedIn ? 'view' : 'star-circle') {{ trans('entities.' . ($signedIn ? 'my_recently_viewed' : 'books_recent')) }}</h3>
@include('partials/entity-list', [
'entities' => $recents,
'style' => 'compact',
'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
])
</div>
<div class="card">
<h3>@icon('file') <a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
<div id="recently-updated-pages">
@include('partials/entity-list', [
'entities' => $recentlyUpdatedPages,
'style' => 'compact',
'emptyText' => trans('entities.no_pages_recently_updated')
])
</div>
</div>
<div id="recent-activity" class="card">
<h3>@icon('time') {{ trans('entities.recent_activity') }}</h3>
@include('partials/activity-list', ['activity' => $activity])
</div>
@stop
@section('body')
@include('books/list', ['books' => $books, 'bookViewType' => $booksViewType])
@stop

View File

@ -1,56 +0,0 @@
@extends('sidebar-layout')
@section('toolbar')
<div class="col-sm-6 faded">
<div class="action-buttons text-left">
<a expand-toggle=".entity-list.compact .entity-item-snippet" class="text-primary text-button">@icon('expand-text'){{ trans('common.toggle_details') }}</a>
</div>
</div>
@stop
@section('sidebar')
@if(count($draftPages) > 0)
<div id="recent-drafts" class="card">
<h3>@icon('edit') {{ trans('entities.my_recent_drafts') }}</h3>
@include('partials/entity-list', ['entities' => $draftPages, 'style' => 'compact'])
</div>
@endif
<div class="card">
<h3>@icon($signedIn ? 'view' : 'star-circle') {{ trans('entities.' . ($signedIn ? 'my_recently_viewed' : 'books_recent')) }}</h3>
@include('partials/entity-list', [
'entities' => $recents,
'style' => 'compact',
'emptyText' => $signedIn ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
])
</div>
<div class="card">
<h3>@icon('file') <a class="no-color" href="{{ baseUrl("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
<div id="recently-updated-pages">
@include('partials/entity-list', [
'entities' => $recentlyUpdatedPages,
'style' => 'compact',
'emptyText' => trans('entities.no_pages_recently_updated')
])
</div>
</div>
<div id="recent-activity" class="card">
<h3>@icon('time') {{ trans('entities.recent_activity') }}</h3>
@include('partials/activity-list', ['activity' => $activity])
</div>
@stop
@section('body')
<div class="page-content" ng-non-bindable>
@include('pages/page-display', ['page' => $customHomepage])
</div>
@stop
@section('scripts')
<script>
setupPageShow({{$customHomepage->id}});
</script>
@stop

View File

@ -118,7 +118,7 @@
@stop
@section('body')
<div class="page-content" page-display="{{ $page->id }}" ng-non-bindable>
<div class="page-content" page-display="{{ $page->id }}">
<div class="pointer-container" id="pointer">
<div class="pointer anim" >