NOW MANAGED ON CODEBERG
extraded template form to own file and changed translations
Sascha64c783c6f8ef
diff --git a/lang/en/entities.php b/lang/en/entities.phpindex 21ef93fed..8860e243e 100644--- a/lang/en/entities.php+++ b/lang/en/entities.php@@ -39,6 +39,9 @@ return ['export_pdf' => 'PDF File','export_text' => 'Plain Text File','export_md' => 'Markdown File',+ 'default_template' => 'Default Page Template',+ 'default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this book/chapter. Keep in mind this will only be used if the page creator has view access to those chosen template page.',+ 'default_template_select' => 'Select a template page',// Permissions and restrictions'permissions' => 'Permissions',@@ -132,9 +135,6 @@ return ['books_edit_named' => 'Edit Book :bookName','books_form_book_name' => 'Book Name','books_save' => 'Save Book',- 'books_default_template' => 'Default Page Template',- 'books_default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this book. Keep in mind this will only be used if the page creator has view access to those chosen template page.',- 'books_default_template_select' => 'Select a template page','books_permissions' => 'Book Permissions','books_permissions_updated' => 'Book Permissions Updated','books_empty_contents' => 'No pages or chapters have been created for this book.',@@ -192,9 +192,6 @@ return ['chapters_permissions_success' => 'Chapter Permissions Updated','chapters_search_this' => 'Search this chapter','chapter_sort_book' => 'Sort Book',- 'chapter_default_template' => 'Default Page Template',- 'chapter_default_template_explain' => 'Assign a page template that will be used as the default content for all new pages in this chapter. Keep in mind this will only be used if the page creator has view access to those chosen template page.',- 'chapter_default_template_select' => 'Select a template page',// Pages'page' => 'Page',diff --git a/resources/views/books/parts/form.blade.php b/resources/views/books/parts/form.blade.phpindex fa8f16e52..ee261e72d 100644--- a/resources/views/books/parts/form.blade.php+++ b/resources/views/books/parts/form.blade.php@@ -40,24 +40,10 @@<div class="form-group collapsible" component="collapsible" id="template-control"><button refs="collapsible@trigger" type="button" class="collapse-title text-link" aria-expanded="false">- <label for="template-manager">{{ trans('entities.books_default_template') }}</label>+ <label for="template-manager">{{ trans('entities.default_template') }}</label></button><div refs="collapsible@content" class="collapse-content">- <div class="flex-container-row gap-l justify-space-between pb-xs wrap">- <p class="text-muted small my-none min-width-xs flex">- {{ trans('entities.books_default_template_explain') }}- </p>-- <div class="min-width-m">- @include('form.page-picker', [- 'name' => 'default_template_id',- 'placeholder' => trans('entities.books_default_template_select'),- 'value' => $book->default_template_id ?? null,- 'selectorEndpoint' => '/search/entity-selector-templates',- ])- </div>- </div>-+ @include('entities.template-selector', ['entity' => $book ?? null])</div></div>diff --git a/resources/views/chapters/parts/form.blade.php b/resources/views/chapters/parts/form.blade.phpindex ea7f84bc8..602693916 100644--- a/resources/views/chapters/parts/form.blade.php+++ b/resources/views/chapters/parts/form.blade.php@@ -24,24 +24,10 @@<div class="form-group collapsible" component="collapsible" id="template-control"><button refs="collapsible@trigger" type="button" class="collapse-title text-link" aria-expanded="false">- <label for="template-manager">{{ trans('entities.chapter_default_template') }}</label>+ <label for="template-manager">{{ trans('entities.default_template') }}</label></button><div refs="collapsible@content" class="collapse-content">- <div class="flex-container-row gap-l justify-space-between pb-xs wrap">- <p class="text-muted small my-none min-width-xs flex">- {{ trans('entities.chapter_default_template_explain') }}- </p>-- <div class="min-width-m">- @include('form.page-picker', [- 'name' => 'default_template_id',- 'placeholder' => trans('entities.chapter_default_template_select'),- 'value' => $chapter->default_template_id ?? null,- 'selectorEndpoint' => '/search/entity-selector-templates',- ])- </div>- </div>-+ @include('entities.template-selector', ['entity' => $chapter ?? null])</div></div>diff --git a/resources/views/entities/template-selector.blade.php b/resources/views/entities/template-selector.blade.phpnew file mode 100644index 000000000..80b2f49b2--- /dev/null+++ b/resources/views/entities/template-selector.blade.php@@ -0,0 +1,14 @@+<div class="flex-container-row gap-l justify-space-between pb-xs wrap">+ <p class="text-muted small my-none min-width-xs flex">+ {{ trans('entities.default_template_explain') }}+ </p>++ <div class="min-width-m">+ @include('form.page-picker', [+ 'name' => 'default_template_id',+ 'placeholder' => trans('entities.default_template_select'),+ 'value' => $entity->default_template_id ?? null,+ 'selectorEndpoint' => '/search/entity-selector-templates',+ ])+ </div>+</div>\ No newline at end of file