mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Reorgranised blade view files to form a convention
- Primarily moved and re-organised view files. - Included readme within views to document the convention. - Fixed some issues with page field select list in previous commit. - Tweaked some route names while going through. - Split some views out further. Closes #2805
This commit is contained in:
26
resources/views/home/books.blade.php
Normal file
26
resources/views/home/books.blade.php
Normal file
@@ -0,0 +1,26 @@
|
||||
@extends('layouts.tri')
|
||||
|
||||
@section('body')
|
||||
@include('books.parts.list', ['books' => $books, 'view' => $view])
|
||||
@stop
|
||||
|
||||
@section('left')
|
||||
@include('home.parts.sidebar')
|
||||
@stop
|
||||
|
||||
@section('right')
|
||||
<div class="actions mb-xl">
|
||||
<h5>{{ trans('common.actions') }}</h5>
|
||||
<div class="icon-list text-primary">
|
||||
@if(user()->can('book-create-all'))
|
||||
<a href="{{ url("/create-book") }}" class="icon-list-item">
|
||||
<span>@icon('add')</span>
|
||||
<span>{{ trans('entities.books_create') }}</span>
|
||||
</a>
|
||||
@endif
|
||||
@include('entities.view-toggle', ['view' => $view, 'type' => 'books'])
|
||||
@include('home.parts.expand-toggle', ['classes' => 'text-primary', 'target' => '.entity-list.compact .entity-item-snippet', 'key' => 'home-details'])
|
||||
@include('common.dark-mode-toggle', ['classes' => 'icon-list-item text-primary'])
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
83
resources/views/home/default.blade.php
Normal file
83
resources/views/home/default.blade.php
Normal file
@@ -0,0 +1,83 @@
|
||||
@extends('layouts.simple')
|
||||
|
||||
@section('body')
|
||||
|
||||
<div class="container px-xl py-s">
|
||||
<div class="grid half">
|
||||
<div>
|
||||
<div class="icon-list inline block">
|
||||
@include('home.parts.expand-toggle', ['classes' => 'text-muted text-primary', 'target' => '.entity-list.compact .entity-item-snippet', 'key' => 'home-details'])
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-m-right">
|
||||
<div class="icon-list inline block">
|
||||
@include('common.dark-mode-toggle', ['classes' => 'text-muted icon-list-item text-primary'])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container" id="home-default">
|
||||
<div class="grid third gap-xxl no-row-gap" >
|
||||
<div>
|
||||
@if(count($draftPages) > 0)
|
||||
<div id="recent-drafts" class="card mb-xl">
|
||||
<h3 class="card-title">{{ trans('entities.my_recent_drafts') }}</h3>
|
||||
<div class="px-m">
|
||||
@include('entities.list', ['entities' => $draftPages, 'style' => 'compact'])
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div id="{{ auth()->check() ? 'recently-viewed' : 'recent-books' }}" class="card mb-xl">
|
||||
<h3 class="card-title">{{ trans('entities.' . (auth()->check() ? 'my_recently_viewed' : 'books_recent')) }}</h3>
|
||||
<div class="px-m">
|
||||
@include('entities.list', [
|
||||
'entities' => $recents,
|
||||
'style' => 'compact',
|
||||
'emptyText' => auth()->check() ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@if(count($favourites) > 0)
|
||||
<div id="top-favourites" class="card mb-xl">
|
||||
<h3 class="card-title">
|
||||
<a href="{{ url('/favourites') }}" class="no-color">{{ trans('entities.my_most_viewed_favourites') }}</a>
|
||||
</h3>
|
||||
<div class="px-m">
|
||||
@include('entities.list', [
|
||||
'entities' => $favourites,
|
||||
'style' => 'compact',
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div id="recent-pages" class="card mb-xl">
|
||||
<h3 class="card-title"><a class="no-color" href="{{ url("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h3>
|
||||
<div id="recently-updated-pages" class="px-m">
|
||||
@include('entities.list', [
|
||||
'entities' => $recentlyUpdatedPages,
|
||||
'style' => 'compact',
|
||||
'emptyText' => trans('entities.no_pages_recently_updated')
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div id="recent-activity">
|
||||
<div class="card mb-xl">
|
||||
<h3 class="card-title">{{ trans('entities.recent_activity') }}</h3>
|
||||
@include('common.activity-list', ['activity' => $activity])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
19
resources/views/home/parts/expand-toggle.blade.php
Normal file
19
resources/views/home/parts/expand-toggle.blade.php
Normal file
@@ -0,0 +1,19 @@
|
||||
{{--
|
||||
$target - CSS selector of items to expand
|
||||
$key - Unique key for checking existing stored state.
|
||||
--}}
|
||||
<?php $isOpen = setting()->getForCurrentUser('section_expansion#'. $key); ?>
|
||||
<button type="button" expand-toggle="{{ $target }}"
|
||||
expand-toggle-update-endpoint="{{ url('/settings/users/'. user()->id .'/update-expansion-preference/' . $key) }}"
|
||||
expand-toggle-is-open="{{ $isOpen ? 'yes' : 'no' }}"
|
||||
class="icon-list-item {{ $classes ?? '' }}">
|
||||
<span>@icon('expand-text')</span>
|
||||
<span>{{ trans('common.toggle_details') }}</span>
|
||||
</button>
|
||||
@if($isOpen)
|
||||
@push('head')
|
||||
<style>
|
||||
{{ $target }} {display: block;}
|
||||
</style>
|
||||
@endpush
|
||||
@endif
|
43
resources/views/home/parts/sidebar.blade.php
Normal file
43
resources/views/home/parts/sidebar.blade.php
Normal file
@@ -0,0 +1,43 @@
|
||||
@if(count($draftPages) > 0)
|
||||
<div id="recent-drafts" class="mb-xl">
|
||||
<h5>{{ trans('entities.my_recent_drafts') }}</h5>
|
||||
@include('entities.list', ['entities' => $draftPages, 'style' => 'compact'])
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(count($favourites) > 0)
|
||||
<div id="top-favourites" class="mb-xl">
|
||||
<h5>
|
||||
<a href="{{ url('/favourites') }}" class="no-color">{{ trans('entities.my_most_viewed_favourites') }}</a>
|
||||
</h5>
|
||||
@include('entities.list', [
|
||||
'entities' => $favourites,
|
||||
'style' => 'compact',
|
||||
])
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="mb-xl">
|
||||
<h5>{{ trans('entities.' . (auth()->check() ? 'my_recently_viewed' : 'books_recent')) }}</h5>
|
||||
@include('entities.list', [
|
||||
'entities' => $recents,
|
||||
'style' => 'compact',
|
||||
'emptyText' => auth()->check() ? trans('entities.no_pages_viewed') : trans('entities.books_empty')
|
||||
])
|
||||
</div>
|
||||
|
||||
<div class="mb-xl">
|
||||
<h5><a class="no-color" href="{{ url("/pages/recently-updated") }}">{{ trans('entities.recently_updated_pages') }}</a></h5>
|
||||
<div id="recently-updated-pages">
|
||||
@include('entities.list', [
|
||||
'entities' => $recentlyUpdatedPages,
|
||||
'style' => 'compact',
|
||||
'emptyText' => trans('entities.no_pages_recently_updated')
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="recent-activity" class="mb-xl">
|
||||
<h5>{{ trans('entities.recent_activity') }}</h5>
|
||||
@include('common.activity-list', ['activity' => $activity])
|
||||
</div>
|
26
resources/views/home/shelves.blade.php
Normal file
26
resources/views/home/shelves.blade.php
Normal file
@@ -0,0 +1,26 @@
|
||||
@extends('layouts.tri')
|
||||
|
||||
@section('body')
|
||||
@include('shelves.parts.list', ['shelves' => $shelves, 'view' => $view])
|
||||
@stop
|
||||
|
||||
@section('left')
|
||||
@include('home.parts.sidebar')
|
||||
@stop
|
||||
|
||||
@section('right')
|
||||
<div class="actions mb-xl">
|
||||
<h5>{{ trans('common.actions') }}</h5>
|
||||
<div class="icon-list text-primary">
|
||||
@if(user()->can('bookshelf-create-all'))
|
||||
<a href="{{ url("/create-shelf") }}" class="icon-list-item">
|
||||
<span>@icon('add')</span>
|
||||
<span>{{ trans('entities.shelves_new_action') }}</span>
|
||||
</a>
|
||||
@endif
|
||||
@include('entities.view-toggle', ['view' => $view, 'type' => 'shelves'])
|
||||
@include('home.parts.expand-toggle', ['classes' => 'text-primary', 'target' => '.entity-list.compact .entity-item-snippet', 'key' => 'home-details'])
|
||||
@include('common.dark-mode-toggle', ['classes' => 'icon-list-item text-primary'])
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
25
resources/views/home/specific-page.blade.php
Normal file
25
resources/views/home/specific-page.blade.php
Normal file
@@ -0,0 +1,25 @@
|
||||
@extends('layouts.tri')
|
||||
|
||||
@section('body')
|
||||
<div class="mt-m">
|
||||
<main class="content-wrap card">
|
||||
<div class="page-content" page-display="{{ $customHomepage->id }}">
|
||||
@include('pages.parts.page-display', ['page' => $customHomepage])
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('left')
|
||||
@include('home.parts.sidebar')
|
||||
@stop
|
||||
|
||||
@section('right')
|
||||
<div class="actions mb-xl">
|
||||
<h5>{{ trans('common.actions') }}</h5>
|
||||
<div class="icon-list text-primary">
|
||||
@include('home.parts.expand-toggle', ['classes' => 'text-primary', 'target' => '.entity-list.compact .entity-item-snippet', 'key' => 'home-details'])
|
||||
@include('common.dark-mode-toggle', ['classes' => 'icon-list-item text-primary'])
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
Reference in New Issue
Block a user