Skip to content

Commit 64c783c

Browse files
authored
extraded template form to own file and changed translations
1 parent 2a84989 commit 64c783c

File tree

4 files changed

+21
-38
lines changed

4 files changed

+21
-38
lines changed

lang/en/entities.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
'export_pdf' => 'PDF File',
4040
'export_text' => 'Plain Text File',
4141
'export_md' => 'Markdown File',
42+
'default_template' => 'Default Page Template',
43+
'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.',
44+
'default_template_select' => 'Select a template page',
4245

4346
// Permissions and restrictions
4447
'permissions' => 'Permissions',
@@ -132,9 +135,6 @@
132135
'books_edit_named' => 'Edit Book :bookName',
133136
'books_form_book_name' => 'Book Name',
134137
'books_save' => 'Save Book',
135-
'books_default_template' => 'Default Page Template',
136-
'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.',
137-
'books_default_template_select' => 'Select a template page',
138138
'books_permissions' => 'Book Permissions',
139139
'books_permissions_updated' => 'Book Permissions Updated',
140140
'books_empty_contents' => 'No pages or chapters have been created for this book.',
@@ -192,9 +192,6 @@
192192
'chapters_permissions_success' => 'Chapter Permissions Updated',
193193
'chapters_search_this' => 'Search this chapter',
194194
'chapter_sort_book' => 'Sort Book',
195-
'chapter_default_template' => 'Default Page Template',
196-
'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.',
197-
'chapter_default_template_select' => 'Select a template page',
198195

199196
// Pages
200197
'page' => 'Page',

resources/views/books/parts/form.blade.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,10 @@
4040

4141
<div class="form-group collapsible" component="collapsible" id="template-control">
4242
<button refs="collapsible@trigger" type="button" class="collapse-title text-link" aria-expanded="false">
43-
<label for="template-manager">{{ trans('entities.books_default_template') }}</label>
43+
<label for="template-manager">{{ trans('entities.default_template') }}</label>
4444
</button>
4545
<div refs="collapsible@content" class="collapse-content">
46-
<div class="flex-container-row gap-l justify-space-between pb-xs wrap">
47-
<p class="text-muted small my-none min-width-xs flex">
48-
{{ trans('entities.books_default_template_explain') }}
49-
</p>
50-
51-
<div class="min-width-m">
52-
@include('form.page-picker', [
53-
'name' => 'default_template_id',
54-
'placeholder' => trans('entities.books_default_template_select'),
55-
'value' => $book->default_template_id ?? null,
56-
'selectorEndpoint' => '/search/entity-selector-templates',
57-
])
58-
</div>
59-
</div>
60-
46+
@include('entities.template-selector', ['entity' => $book ?? null])
6147
</div>
6248
</div>
6349

resources/views/chapters/parts/form.blade.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,10 @@
2424

2525
<div class="form-group collapsible" component="collapsible" id="template-control">
2626
<button refs="collapsible@trigger" type="button" class="collapse-title text-link" aria-expanded="false">
27-
<label for="template-manager">{{ trans('entities.chapter_default_template') }}</label>
27+
<label for="template-manager">{{ trans('entities.default_template') }}</label>
2828
</button>
2929
<div refs="collapsible@content" class="collapse-content">
30-
<div class="flex-container-row gap-l justify-space-between pb-xs wrap">
31-
<p class="text-muted small my-none min-width-xs flex">
32-
{{ trans('entities.chapter_default_template_explain') }}
33-
</p>
34-
35-
<div class="min-width-m">
36-
@include('form.page-picker', [
37-
'name' => 'default_template_id',
38-
'placeholder' => trans('entities.chapter_default_template_select'),
39-
'value' => $chapter->default_template_id ?? null,
40-
'selectorEndpoint' => '/search/entity-selector-templates',
41-
])
42-
</div>
43-
</div>
44-
30+
@include('entities.template-selector', ['entity' => $chapter ?? null])
4531
</div>
4632
</div>
4733

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div class="flex-container-row gap-l justify-space-between pb-xs wrap">
2+
<p class="text-muted small my-none min-width-xs flex">
3+
{{ trans('entities.default_template_explain') }}
4+
</p>
5+
6+
<div class="min-width-m">
7+
@include('form.page-picker', [
8+
'name' => 'default_template_id',
9+
'placeholder' => trans('entities.default_template_select'),
10+
'value' => $entity->default_template_id ?? null,
11+
'selectorEndpoint' => '/search/entity-selector-templates',
12+
])
13+
</div>
14+
</div>

0 commit comments

Comments
 (0)