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