mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Expanded chapters interface and improved book/page deletion
This commit is contained in:
@ -21,10 +21,21 @@
|
||||
box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.edit-area {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.page-style.editor {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.mce-tinymce {
|
||||
.mce-panel {
|
||||
background-color: #FFF;
|
||||
}
|
||||
.mce-btn {
|
||||
background-color: #FFF;
|
||||
}
|
||||
}
|
22
resources/views/books/delete.blade.php
Normal file
22
resources/views/books/delete.blade.php
Normal file
@ -0,0 +1,22 @@
|
||||
@extends('base')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="page-content">
|
||||
<h1>Delete Book</h1>
|
||||
<p>This will delete the book with the name '{{$book->name}}', All pages and chapters will be removed.</p>
|
||||
<p class="text-neg">Are you sure you want to delete this book?</p>
|
||||
|
||||
<form action="{{$book->getUrl()}}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<button type="submit" class="button neg">Confirm</button>
|
||||
<a href="{{$book->getUrl()}}" class="button">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('bottom')
|
||||
@include('pages/image-manager')
|
||||
@stop
|
@ -8,12 +8,6 @@
|
||||
<input type="hidden" name="_method" value="PUT">
|
||||
@include('books/form', ['model' => $book])
|
||||
</form>
|
||||
<hr class="margin-top large">
|
||||
<div class="margin-top large shaded padded">
|
||||
<h2 class="margin-top">Delete this book</h2>
|
||||
<p>This will delete this book and all it's pages.</p>
|
||||
@include('form/delete-button', ['url' => '/books/' . $book->id . '/destroy', 'text' => 'Delete'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
@ -5,9 +5,10 @@
|
||||
<div class="row faded-small">
|
||||
<div class="col-md-6"></div>
|
||||
<div class="col-md-6">
|
||||
<div class="action-buttons">
|
||||
<a href="{{$book->getEditUrl()}}"><i class="fa fa-pencil"></i>Edit Book</a>
|
||||
<a href="{{ $book->getUrl() }}/sort"><i class="fa fa-sort"></i>Sort Pages</a>
|
||||
<div class="action-buttons faded">
|
||||
<a href="{{$book->getEditUrl()}}"><i class="fa fa-pencil"></i>Edit</a>
|
||||
<a href="{{ $book->getUrl() }}/sort"><i class="fa fa-sort"></i>Sort</a>
|
||||
<a href="{{ $book->getUrl() }}/delete"><i class="fa fa-trash"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -24,16 +25,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-list">
|
||||
<div>
|
||||
@foreach($book->children() as $childElement)
|
||||
<div class="page-list-item">
|
||||
@if(is_a($childElement, 'Oxbow\Chapter'))
|
||||
<i class="fa fa-archive"></i>
|
||||
@else
|
||||
<i class="fa fa-file"></i>
|
||||
@endif
|
||||
{{$childElement->name}}
|
||||
<div >
|
||||
<h3>
|
||||
<a href="{{ $childElement->getUrl() }}">
|
||||
@if(is_a($childElement, 'Oxbow\Chapter'))
|
||||
<i class="fa fa-archive"></i>
|
||||
@else
|
||||
<i class="fa fa-file"></i>
|
||||
@endif
|
||||
{{ $childElement->name }}
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
<hr>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
|
23
resources/views/chapters/delete.blade.php
Normal file
23
resources/views/chapters/delete.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('base')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="page-content">
|
||||
<h1>Delete Chapter</h1>
|
||||
<p>This will delete the chapter with the name '{{$chapter->name}}', All pages will be removed
|
||||
and added directly to the book.</p>
|
||||
<p class="text-neg">Are you sure you want to delete this chapter?</p>
|
||||
|
||||
<form action="{{$chapter->getUrl()}}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<button type="submit" class="button neg">Confirm</button>
|
||||
<a href="{{$chapter->getUrl()}}" class="button">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('bottom')
|
||||
@include('pages/image-manager')
|
||||
@stop
|
13
resources/views/chapters/edit.blade.php
Normal file
13
resources/views/chapters/edit.blade.php
Normal file
@ -0,0 +1,13 @@
|
||||
@extends('base')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="page-content">
|
||||
<h1>Edit Chapter</h1>
|
||||
<form action="{{$chapter->getUrl()}}" method="POST">
|
||||
<input type="hidden" name="_method" value="PUT">
|
||||
@include('chapters/form', ['model' => $chapter])
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@stop
|
38
resources/views/chapters/show.blade.php
Normal file
38
resources/views/chapters/show.blade.php
Normal file
@ -0,0 +1,38 @@
|
||||
@extends('base')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row faded-small">
|
||||
<div class="col-md-6"></div>
|
||||
<div class="col-md-6 faded">
|
||||
<div class="action-buttons">
|
||||
<a href="{{$chapter->getUrl() . '/edit'}}" ><i class="fa fa-pencil"></i>Edit</a>
|
||||
<a href="{{$chapter->getUrl() . '/delete'}}"><i class="fa fa-trash"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="page-content">
|
||||
<h1>{{ $chapter->name }}</h1>
|
||||
<p class="text-muted">{{ $chapter->description }}</p>
|
||||
@if(count($chapter->pages) > 0)
|
||||
<h4 class="text-muted">Pages</h4>
|
||||
<div class="page-list">
|
||||
@foreach($chapter->pages as $page)
|
||||
<div >
|
||||
<h3>
|
||||
<a href="{{ $page->getUrl() }}">
|
||||
<i class="fa fa-file"></i>
|
||||
{{ $page->name }}
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
<hr>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
21
resources/views/pages/delete.blade.php
Normal file
21
resources/views/pages/delete.blade.php
Normal file
@ -0,0 +1,21 @@
|
||||
@extends('base')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="page-content">
|
||||
<h1>Delete Page</h1>
|
||||
<p>Are you sure you want to delete this page?</p>
|
||||
|
||||
<form action="{{$page->getUrl()}}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<button type="submit" class="button neg">Confirm</button>
|
||||
<a href="{{$page->getUrl()}}" class="button">Cancel</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('bottom')
|
||||
@include('pages/image-manager')
|
||||
@stop
|
@ -31,9 +31,10 @@
|
||||
body_class: 'page-content',
|
||||
relative_urls: false,
|
||||
statusbar: false,
|
||||
height: 600,
|
||||
plugins: "image table textcolor paste link imagetools",
|
||||
toolbar: "undo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image link | fontsizeselect full",
|
||||
menubar: false,
|
||||
height: 700,
|
||||
plugins: "image table textcolor paste link imagetools fullscreen",
|
||||
toolbar: "undo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table image link | fontsizeselect fullscreen",
|
||||
content_style: "body {padding-left: 15px !important; padding-right: 15px !important; margin:0!important; margin-left:auto!important;margin-right:auto!important;}",
|
||||
file_browser_callback: function(field_name, url, type, win) {
|
||||
ImageManager.show('#image-manager', function(image) {
|
||||
@ -46,20 +47,20 @@
|
||||
win.document.getElementById(field_name).fireEvent("onchange");
|
||||
}
|
||||
});
|
||||
},
|
||||
setup: function(editor) {
|
||||
editor.addButton('full', {
|
||||
title: 'Expand Editor',
|
||||
icon: 'fullscreen',
|
||||
onclick: function() {
|
||||
var container = $(editor.getContainer()).toggleClass('fullscreen');
|
||||
var isFull = container.hasClass('fullscreen');
|
||||
var iframe = container.find('iframe').first();
|
||||
var height = isFull ? $(window).height()-110 : 600;
|
||||
iframe.css('height', height + 'px');
|
||||
}
|
||||
});
|
||||
}
|
||||
// setup: function(editor) {
|
||||
// editor.addButton('full', {
|
||||
// title: 'Expand Editor',
|
||||
// icon: 'fullscreen',
|
||||
// onclick: function() {
|
||||
// var container = $(editor.getContainer()).toggleClass('fullscreen');
|
||||
// var isFull = container.hasClass('fullscreen');
|
||||
// var iframe = container.find('iframe').first();
|
||||
// var height = isFull ? $(window).height()-110 : 600;
|
||||
// iframe.css('height', height + 'px');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
});
|
||||
|
||||
|
||||
|
@ -2,10 +2,8 @@
|
||||
|
||||
@section('sidebar')
|
||||
<div class="book-tree">
|
||||
<h4><a href="/books/{{$sidebarBookTree['slug']}}"><i class="fa fa-book"></i>{{$sidebarBookTree['name']}}</a></h4>
|
||||
@if($sidebarBookTree['hasChildren'])
|
||||
@include('pages/sidebar-tree-list', ['pageTree' => $sidebarBookTree['pages']])
|
||||
@endif
|
||||
<h4><a href="{{$book->getUrl()}}"><i class="fa fa-book"></i>{{$book->name}}</a></h4>
|
||||
@include('pages/sidebar-tree-list', ['book' => $book])
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@ -25,8 +23,8 @@
|
||||
</div>
|
||||
<div class="col-md-6 faded">
|
||||
<div class="action-buttons">
|
||||
<a href="{{$page->getUrl() . '/edit'}}" ><i class="fa fa-pencil"></i>Edit this page</a>
|
||||
<a href="{{$page->getUrl() . '/create'}}"><i class="fa fa-file-o"></i>Create Sub-page</a>
|
||||
<a href="{{$page->getUrl() . '/edit'}}" ><i class="fa fa-pencil"></i>Edit</a>
|
||||
<a href="{{$page->getUrl() . '/delete'}}"><i class="fa fa-trash"></i>Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,11 +1,15 @@
|
||||
{{--Requires an array of pages to be passed as $pageTree--}}
|
||||
|
||||
<ul class="sidebar-page-list">
|
||||
@foreach($pageTree as $subPage)
|
||||
<li @if($subPage['hasChildren'])class="has-children"@endif>
|
||||
<a href="{{$subPage['url']}}" @if($subPage['current'])class="bold"@endif>{{$subPage['name']}}</a>
|
||||
@if($subPage['hasChildren'])
|
||||
@include('pages/sidebar-tree-list', ['pageTree' => $subPage['pages']])
|
||||
@foreach($book->children() as $bookChild)
|
||||
<li>
|
||||
{{ $bookChild->name }}
|
||||
@if(is_a($bookChild, 'Oxbow\Chapter') && count($bookChild->pages) > 0)
|
||||
<ul>
|
||||
@foreach($pages as $page)
|
||||
<li>{{ $page->name }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
|
Reference in New Issue
Block a user