]> BookStack Code Mirror - bookstack/blob - resources/views/settings/index.blade.php
Started playing with new settings view layout
[bookstack] / resources / views / settings / index.blade.php
1 @extends('layouts.simple')
2
3 @section('body')
4     <div class="container medium">
5
6         @include('settings.parts.navbar', ['selected' => 'settings'])
7
8         <div class="grid gap-xxl right-focus">
9
10             <div>
11                 <h5>Categories</h5>
12                 <div class="active-link-list in-sidebar">
13                     <a href="#" class=" active">@icon('star') Features & Security</a>
14                     <a href="#">@icon('palette') Customization</a>
15                     <a href="#">@icon('lock') Registration</a>
16                 </div>
17
18                 <h5>Version</h5>
19                 <div class="">
20                     <a target="_blank" rel="noopener noreferrer" href="https://github.com/BookStackApp/BookStack/releases">
21                         BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
22                     </a>
23                 </div>
24             </div>
25
26             <div>
27                 <div class="card content-wrap auto-height">
28                     <h2 id="features" class="list-heading">{{ trans('settings.app_features_security') }}</h2>
29                     <form action="{{ url("/settings") }}" method="POST">
30                         {!! csrf_field() !!}
31                         <input type="hidden" name="section" value="features">
32
33                         <div class="setting-list">
34
35
36                             <div class="grid half gap-xl">
37                                 <div>
38                                     <label for="setting-app-public" class="setting-list-label">{{ trans('settings.app_public_access') }}</label>
39                                     <p class="small">{!! trans('settings.app_public_access_desc') !!}</p>
40                                     @if(userCan('users-manage'))
41                                         <p class="small mb-none">
42                                             <a href="{{ url($guestUser->getEditUrl()) }}">{!! trans('settings.app_public_access_desc_guest') !!}</a>
43                                         </p>
44                                     @endif
45                                 </div>
46                                 <div>
47                                     @include('form.toggle-switch', [
48                                         'name' => 'setting-app-public',
49                                         'value' => setting('app-public'),
50                                         'label' => trans('settings.app_public_access_toggle'),
51                                     ])
52                                 </div>
53                             </div>
54
55                             <div class="grid half gap-xl">
56                                 <div>
57                                     <label class="setting-list-label">{{ trans('settings.app_secure_images') }}</label>
58                                     <p class="small">{{ trans('settings.app_secure_images_desc') }}</p>
59                                 </div>
60                                 <div>
61                                     @include('form.toggle-switch', [
62                                         'name' => 'setting-app-secure-images',
63                                         'value' => setting('app-secure-images'),
64                                         'label' => trans('settings.app_secure_images_toggle'),
65                                     ])
66                                 </div>
67                             </div>
68
69                             <div class="grid half gap-xl">
70                                 <div>
71                                     <label class="setting-list-label">{{ trans('settings.app_disable_comments') }}</label>
72                                     <p class="small">{!! trans('settings.app_disable_comments_desc') !!}</p>
73                                 </div>
74                                 <div>
75                                     @include('form.toggle-switch', [
76                                         'name' => 'setting-app-disable-comments',
77                                         'value' => setting('app-disable-comments'),
78                                         'label' => trans('settings.app_disable_comments_toggle'),
79                                     ])
80                                 </div>
81                             </div>
82
83
84                         </div>
85
86                         <div class="form-group text-right">
87                             <button type="submit" class="button">{{ trans('settings.settings_save') }}</button>
88                         </div>
89                     </form>
90                 </div>
91
92                 <div class="card content-wrap auto-height">
93                     <h2 id="customization" class="list-heading">{{ trans('settings.app_customization') }}</h2>
94                     <form action="{{ url("/settings") }}" method="POST" enctype="multipart/form-data">
95                         {!! csrf_field() !!}
96                         <input type="hidden" name="section" value="customization">
97
98                         <div class="setting-list">
99
100                             <div class="grid half gap-xl">
101                                 <div>
102                                     <label for="setting-app-name" class="setting-list-label">{{ trans('settings.app_name') }}</label>
103                                     <p class="small">{{ trans('settings.app_name_desc') }}</p>
104                                 </div>
105                                 <div class="pt-xs">
106                                     <input type="text" value="{{ setting('app-name', 'BookStack') }}" name="setting-app-name" id="setting-app-name">
107                                     @include('form.toggle-switch', [
108                                         'name' => 'setting-app-name-header',
109                                         'value' => setting('app-name-header'),
110                                         'label' => trans('settings.app_name_header'),
111                                     ])
112                                 </div>
113                             </div>
114
115                             <div class="grid half gap-xl">
116                                 <div>
117                                     <label class="setting-list-label">{{ trans('settings.app_editor') }}</label>
118                                     <p class="small">{{ trans('settings.app_editor_desc') }}</p>
119                                 </div>
120                                 <div class="pt-xs">
121                                     <select name="setting-app-editor" id="setting-app-editor">
122                                         <option @if(setting('app-editor') === 'wysiwyg') selected @endif value="wysiwyg">WYSIWYG</option>
123                                         <option @if(setting('app-editor') === 'markdown') selected @endif value="markdown">Markdown</option>
124                                     </select>
125                                 </div>
126                             </div>
127
128                             <div class="grid half gap-xl">
129                                 <div>
130                                     <label class="setting-list-label">{{ trans('settings.app_logo') }}</label>
131                                     <p class="small">{!! trans('settings.app_logo_desc') !!}</p>
132                                 </div>
133                                 <div class="pt-xs">
134                                     @include('form.image-picker', [
135                                              'removeName' => 'setting-app-logo',
136                                              'removeValue' => 'none',
137                                              'defaultImage' => url('/logo.png'),
138                                              'currentImage' => setting('app-logo'),
139                                              'name' => 'app_logo',
140                                              'imageClass' => 'logo-image',
141                                          ])
142                                 </div>
143                             </div>
144
145                             <!-- Primary Color -->
146                             <div class="grid half gap-xl">
147                                 <div>
148                                     <label class="setting-list-label">{{ trans('settings.app_primary_color') }}</label>
149                                     <p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>
150                                 </div>
151                                 <div setting-app-color-picker class="text-m-right pt-xs">
152                                     <input type="color" data-default="#206ea7" data-current="{{ setting('app-color') }}" value="{{ setting('app-color') }}" name="setting-app-color" id="setting-app-color" placeholder="#206ea7">
153                                     <input type="hidden" value="{{ setting('app-color-light') }}" name="setting-app-color-light" id="setting-app-color-light">
154                                     <div class="pr-s">
155                                         <button type="button" class="text-button text-muted mt-s" setting-app-color-picker-default>{{ trans('common.default') }}</button>
156                                         <span class="sep">|</span>
157                                         <button type="button" class="text-button text-muted mt-s" setting-app-color-picker-reset>{{ trans('common.reset') }}</button>
158                                     </div>
159
160                                 </div>
161                             </div>
162
163                             <!-- Entity Color -->
164                             <div class="pb-l">
165                                 <div>
166                                     <label class="setting-list-label">{{ trans('settings.content_colors') }}</label>
167                                     <p class="small">{!! trans('settings.content_colors_desc') !!}</p>
168                                 </div>
169                                 <div class="grid half pt-m">
170                                     <div>
171                                         @include('settings.parts.setting-entity-color-picker', ['type' => 'bookshelf'])
172                                         @include('settings.parts.setting-entity-color-picker', ['type' => 'book'])
173                                         @include('settings.parts.setting-entity-color-picker', ['type' => 'chapter'])
174                                     </div>
175                                     <div>
176                                         @include('settings.parts.setting-entity-color-picker', ['type' => 'page'])
177                                         @include('settings.parts.setting-entity-color-picker', ['type' => 'page-draft'])
178                                     </div>
179                                 </div>
180                             </div>
181
182                             <div homepage-control id="homepage-control" class="grid half gap-xl">
183                                 <div>
184                                     <label for="setting-app-homepage" class="setting-list-label">{{ trans('settings.app_homepage') }}</label>
185                                     <p class="small">{{ trans('settings.app_homepage_desc') }}</p>
186                                 </div>
187                                 <div class="pt-xs">
188                                     <select name="setting-app-homepage-type" id="setting-app-homepage-type">
189                                         <option @if(setting('app-homepage-type') === 'default') selected @endif value="default">{{ trans('common.default') }}</option>
190                                         <option @if(setting('app-homepage-type') === 'books') selected @endif value="books">{{ trans('entities.books') }}</option>
191                                         <option @if(setting('app-homepage-type') === 'bookshelves') selected @endif value="bookshelves">{{ trans('entities.shelves') }}</option>
192                                         <option @if(setting('app-homepage-type') === 'page') selected @endif value="page">{{ trans('entities.pages_specific') }}</option>
193                                     </select>
194
195                                     <div page-picker-container style="display: none;" class="mt-m">
196                                         @include('settings.parts.page-picker', ['name' => 'setting-app-homepage', 'placeholder' => trans('settings.app_homepage_select'), 'value' => setting('app-homepage')])
197                                     </div>
198                                 </div>
199                             </div>
200
201                             <div>
202                                 <label for="setting-app-privacy-link" class="setting-list-label">{{ trans('settings.app_footer_links') }}</label>
203                                 <p class="small mb-m">{{ trans('settings.app_footer_links_desc') }}</p>
204                                 @include('settings.parts.footer-links', ['name' => 'setting-app-footer-links', 'value' => setting('app-footer-links', [])])
205                             </div>
206
207
208                             <div>
209                                 <label for="setting-app-custom-head" class="setting-list-label">{{ trans('settings.app_custom_html') }}</label>
210                                 <p class="small">{{ trans('settings.app_custom_html_desc') }}</p>
211                                 <textarea name="setting-app-custom-head" id="setting-app-custom-head" class="simple-code-input mt-m">{{ setting('app-custom-head', '') }}</textarea>
212                                 <p class="small text-right">{{ trans('settings.app_custom_html_disabled_notice') }}</p>
213                             </div>
214
215
216                         </div>
217
218                         <div class="form-group text-right">
219                             <button type="submit" class="button">{{ trans('settings.settings_save') }}</button>
220                         </div>
221                     </form>
222                 </div>
223
224                 <div class="card content-wrap auto-height">
225                     <h2 id="registration" class="list-heading">{{ trans('settings.reg_settings') }}</h2>
226                     <form action="{{ url("/settings") }}" method="POST">
227                         {!! csrf_field() !!}
228                         <input type="hidden" name="section" value="registration">
229
230                         <div class="setting-list">
231                             <div class="grid half gap-xl">
232                                 <div>
233                                     <label class="setting-list-label">{{ trans('settings.reg_enable') }}</label>
234                                     <p class="small">{!! trans('settings.reg_enable_desc') !!}</p>
235                                 </div>
236                                 <div>
237                                     @include('form.toggle-switch', [
238                                         'name' => 'setting-registration-enabled',
239                                         'value' => setting('registration-enabled'),
240                                         'label' => trans('settings.reg_enable_toggle')
241                                     ])
242
243                                     @if(in_array(config('auth.method'), ['ldap', 'saml2', 'oidc']))
244                                         <div class="text-warn text-small mb-l">{{ trans('settings.reg_enable_external_warning') }}</div>
245                                     @endif
246
247                                     <label for="setting-registration-role">{{ trans('settings.reg_default_role') }}</label>
248                                     <select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
249                                         <option value="0" @if(intval(setting('registration-role', '0')) === 0) selected @endif>-- {{ trans('common.none') }} --</option>
250                                         @foreach(\BookStack\Auth\Role::all() as $role)
251                                             <option value="{{$role->id}}"
252                                                     data-system-role-name="{{ $role->system_name ?? '' }}"
253                                                     @if(intval(setting('registration-role', '0')) === $role->id) selected @endif
254                                             >
255                                                 {{ $role->display_name }}
256                                             </option>
257                                         @endforeach
258                                     </select>
259                                 </div>
260                             </div>
261
262                             <div class="grid half gap-xl">
263                                 <div>
264                                     <label for="setting-registration-restrict" class="setting-list-label">{{ trans('settings.reg_confirm_restrict_domain') }}</label>
265                                     <p class="small">{!! trans('settings.reg_confirm_restrict_domain_desc') !!}</p>
266                                 </div>
267                                 <div class="pt-xs">
268                                     <input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="{{ trans('settings.reg_confirm_restrict_domain_placeholder') }}" value="{{ setting('registration-restrict', '') }}">
269                                 </div>
270                             </div>
271
272                             <div class="grid half gap-xl">
273                                 <div>
274                                     <label class="setting-list-label">{{ trans('settings.reg_email_confirmation') }}</label>
275                                     <p class="small">{{ trans('settings.reg_confirm_email_desc') }}</p>
276                                 </div>
277                                 <div>
278                                     @include('form.toggle-switch', [
279                                         'name' => 'setting-registration-confirmation',
280                                         'value' => setting('registration-confirmation'),
281                                         'label' => trans('settings.reg_email_confirmation_toggle')
282                                     ])
283                                 </div>
284                             </div>
285
286                         </div>
287
288                         <div class="form-group text-right">
289                             <button type="submit" class="button">{{ trans('settings.settings_save') }}</button>
290                         </div>
291                     </form>
292                 </div>
293             </div>
294
295         </div>
296
297     </div>
298
299     @include('entities.selector-popup', ['entityTypes' => 'page'])
300 @stop