1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Default Templates: Started review and updates from PR code

This commit is contained in:
Dan Brown
2023-12-11 12:33:20 +00:00
parent 968bc8cdf3
commit d61f42a377
11 changed files with 39 additions and 51 deletions

View File

@ -27,10 +27,9 @@
<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">
<form action="{{ $bookshelf?->getUrl('/create-book') ?? url('/books') }}" method="POST" enctype="multipart/form-data">
@include('books.parts.form', [
'templates' => $templates,
'returnLocation' => isset($bookshelf) ? $bookshelf->getUrl() : url('/books')
'returnLocation' => $bookshelf?->getUrl() ?? url('/books')
])
</form>
</main>

View File

@ -19,8 +19,7 @@
<form action="{{ $book->getUrl() }}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="_method" value="PUT">
@include('books.parts.form', [
'model' => $book,
'templates' => $templates,
'model' => $book,
'returnLocation' => $book->getUrl()
])
</form>

View File

@ -37,10 +37,10 @@
<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>
<label for="template-manager">{{ trans('entities.books_default_template') }}</label>
</button>
<div refs="collapsible@content" class="collapse-content">
@include('entities.template-manager', ['entity' => $book ?? null, 'templates' => $templates])
@include('books.parts.template-selector', ['entity' => $book ?? null, 'templates' => []])
</div>
</div>

View File

@ -1,5 +1,5 @@
<p class="text-muted small">
{!! nl2br(e(trans('entities.default_template_explain'))) !!}
{{ trans('entities.books_default_template_explain') }}
</p>
<select name="default_template" id="default_template">
@ -7,4 +7,7 @@
@foreach ($templates as $template)
<option @if(isset($entity) && $entity->default_template === $template->id) selected @endif value="{{ $template->id }}">{{ $template->name }}</option>
@endforeach
</select>
</select>
@include('settings.parts.page-picker', ['name' => 'setting-app-homepage', 'placeholder' => trans('settings.app_homepage_select'), 'value' => setting('app-homepage')])

View File

@ -19,8 +19,8 @@
<div class="card content-wrap auto-height">
<h1 class="list-heading">{{ $page->draft ? trans('entities.pages_delete_draft') : trans('entities.pages_delete') }}</h1>
@if ($times_used_as_template > 0)
<p>{{ trans_choice('entities.pages_delete_warning_template', $times_used_as_template) }}</p>
@if($usedAsTemplate)
<p>{{ trans('entities.pages_delete_warning_template') }}</p>
@endif
<div class="grid half v-center">