mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-04 17:04:32 +08:00
Expanded chapters interface and improved book/page deletion
This commit is contained in:
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