mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Add default_template as Book setting
This commit is contained in:
@@ -28,7 +28,10 @@
|
||||
<main class="content-wrap card">
|
||||
<h1 class="list-heading">{{ trans('entities.books_create') }}</h1>
|
||||
<form action="{{ isset($bookshelf) ? $bookshelf->getUrl('/create-book') : url('/books') }}" method="POST" enctype="multipart/form-data">
|
||||
@include('books.parts.form', ['returnLocation' => isset($bookshelf) ? $bookshelf->getUrl() : url('/books')])
|
||||
@include('books.parts.form', [
|
||||
'templates' => $templates,
|
||||
'returnLocation' => isset($bookshelf) ? $bookshelf->getUrl() : url('/books')
|
||||
])
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
|
@@ -18,7 +18,11 @@
|
||||
<h1 class="list-heading">{{ trans('entities.books_edit') }}</h1>
|
||||
<form action="{{ $book->getUrl() }}" method="POST" enctype="multipart/form-data">
|
||||
<input type="hidden" name="_method" value="PUT">
|
||||
@include('books.parts.form', ['model' => $book, 'returnLocation' => $book->getUrl()])
|
||||
@include('books.parts.form', [
|
||||
'model' => $book,
|
||||
'templates' => $templates,
|
||||
'returnLocation' => $book->getUrl()
|
||||
])
|
||||
</form>
|
||||
</main>
|
||||
|
||||
|
@@ -35,6 +35,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group collapsible" component="collapsible" id="template-control">
|
||||
<button refs="collapsible@trigger" type="button" class="collapse-title text-primary" aria-expanded="false">
|
||||
<label for="template-manager">{{ trans('entities.default_template') }}</label>
|
||||
</button>
|
||||
<div refs="collapsible@content" class="collapse-content">
|
||||
@include('entities.template-manager', ['entity' => $book ?? null, 'templates' => $templates])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right">
|
||||
<a href="{{ $returnLocation }}" class="button outline">{{ trans('common.cancel') }}</a>
|
||||
<button type="submit" class="button">{{ trans('entities.books_save') }}</button>
|
||||
|
10
resources/views/entities/template-manager.blade.php
Normal file
10
resources/views/entities/template-manager.blade.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<p class="text-muted small">
|
||||
{!! nl2br(e(trans('entities.default_template_explain'))) !!}
|
||||
</p>
|
||||
|
||||
<select name="default_template" id="default_template">
|
||||
<option value="">---</option>
|
||||
@foreach ($templates as $template)
|
||||
<option @if(isset($entity) && $entity->default_template === $template->id) selected @endif value="{{ $template->id }}">{{ $template->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
Reference in New Issue
Block a user