]> BookStack Code Mirror - bookstack/blob - resources/views/settings/index.blade.php
Update create new book button on shelves to 2019 design
[bookstack] / resources / views / settings / index.blade.php
1 @extends('simple-layout')
2
3 @section('body')
4     <div class="container small">
5
6         <div class="grid left-focus v-center no-row-gap">
7             <div class="py-m">
8                 @include('settings.navbar', ['selected' => 'settings'])
9             </div>
10             <div class="text-right mb-l px-m">
11                 <br>
12                 BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
13             </div>
14         </div>
15
16         <div class="card content-wrap auto-height">
17             <h2 class="list-heading">{{ trans('settings.app_features_security') }}</h2>
18             <form action="{{ baseUrl("/settings") }}" method="POST">
19                 {!! csrf_field() !!}
20
21                 <div class="setting-list">
22
23
24                     <div class="grid half gap-xl">
25                         <div>
26                             <label for="setting-app-public" class="setting-list-label">{{ trans('settings.app_public_access') }}</label>
27                             <p class="small">{!! trans('settings.app_public_access_desc') !!}</p>
28                             @if(userCan('users-manage'))
29                                 <p class="small mb-none">
30                                     <a href="{{ baseUrl($guestUser->getEditUrl()) }}">{!! trans('settings.app_public_access_desc_guest') !!}</a>
31                                 </p>
32                             @endif
33                         </div>
34                         <div>
35                             @include('components.toggle-switch', [
36                                 'name' => 'setting-app-public',
37                                 'value' => setting('app-public'),
38                                 'label' => trans('settings.app_public_access_toggle'),
39                             ])
40                         </div>
41                     </div>
42
43                     <div class="grid half gap-xl">
44                         <div>
45                             <label class="setting-list-label">{{ trans('settings.app_secure_images') }}</label>
46                             <p class="small">{{ trans('settings.app_secure_images_desc') }}</p>
47                         </div>
48                         <div>
49                             @include('components.toggle-switch', [
50                                 'name' => 'setting-app-secure-images',
51                                 'value' => setting('app-secure-images'),
52                                 'label' => trans('settings.app_secure_images_toggle'),
53                             ])
54                         </div>
55                     </div>
56
57                     <div class="grid half gap-xl">
58                         <div>
59                             <label class="setting-list-label">{{ trans('settings.app_disable_comments') }}</label>
60                             <p class="small">{!! trans('settings.app_disable_comments_desc') !!}</p>
61                         </div>
62                         <div>
63                             @include('components.toggle-switch', [
64                                 'name' => 'setting-app-disable-comments',
65                                 'value' => setting('app-disable-comments'),
66                                 'label' => trans('settings.app_disable_comments_toggle'),
67                             ])
68                         </div>
69                     </div>
70
71
72                 </div>
73
74                 <div class="form-group text-right">
75                     <button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
76                 </div>
77             </form>
78         </div>
79
80         <div class="card content-wrap auto-height">
81             <h2 class="list-heading">{{ trans('settings.app_customization') }}</h2>
82             <form action="{{ baseUrl("/settings") }}" method="POST">
83                 {!! csrf_field() !!}
84
85                 <div class="setting-list">
86
87                     <div class="grid half gap-xl">
88                         <div>
89                             <label for="setting-app-name" class="setting-list-label">{{ trans('settings.app_name') }}</label>
90                             <p class="small">{{ trans('settings.app_name_desc') }}</p>
91                         </div>
92                         <div>
93                             <input type="text" value="{{ setting('app-name', 'BookStack') }}" name="setting-app-name" id="setting-app-name">
94                             @include('components.toggle-switch', [
95                                 'name' => 'setting-app-name-header',
96                                 'value' => setting('app-name-header'),
97                                 'label' => trans('settings.app_name_header'),
98                             ])
99                         </div>
100                     </div>
101
102                     <div class="grid half gap-xl">
103                         <div>
104                             <label class="setting-list-label">{{ trans('settings.app_editor') }}</label>
105                             <p class="small">{{ trans('settings.app_editor_desc') }}</p>
106                         </div>
107                         <div>
108                             <select name="setting-app-editor" id="setting-app-editor">
109                                 <option @if(setting('app-editor') === 'wysiwyg') selected @endif value="wysiwyg">WYSIWYG</option>
110                                 <option @if(setting('app-editor') === 'markdown') selected @endif value="markdown">Markdown</option>
111                             </select>
112                         </div>
113                     </div>
114
115                     <div class="grid half gap-xl">
116                         <div>
117                             <label class="setting-list-label">{{ trans('settings.app_logo') }}</label>
118                             <p class="small">{!! trans('settings.app_logo_desc') !!}</p>
119                         </div>
120                         <div>
121                             @include('components.image-picker', [
122                                      'resizeHeight' => '43',
123                                      'resizeWidth' => '200',
124                                      'showRemove' => true,
125                                      'defaultImage' => baseUrl('/logo.png'),
126                                      'currentImage' => setting('app-logo'),
127                                      'name' => 'setting-app-logo',
128                                      'imageClass' => 'logo-image',
129                                      'currentId' => false
130                                  ])
131                         </div>
132                     </div>
133
134                     <div class="grid half gap-xl">
135                         <div>
136                             <label class="setting-list-label">{{ trans('settings.app_primary_color') }}</label>
137                             <p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>
138                         </div>
139                         <div>
140                             <input type="text" value="{{ setting('app-color') }}" name="setting-app-color" id="setting-app-color" placeholder="#0288D1">
141                             <input type="hidden" value="{{ setting('app-color-light') }}" name="setting-app-color-light" id="setting-app-color-light">
142                         </div>
143                     </div>
144
145                     <div homepage-control id="homepage-control" class="grid half gap-xl">
146                         <div>
147                             <label for="setting-app-homepage" class="setting-list-label">{{ trans('settings.app_homepage') }}</label>
148                             <p class="small">{{ trans('settings.app_homepage_desc') }}</p>
149                         </div>
150                         <div>
151                             <select name="setting-app-homepage-type" id="setting-app-homepage-type">
152                                 <option @if(setting('app-homepage-type') === 'default') selected @endif value="default">{{ trans('common.default') }}</option>
153                                 <option @if(setting('app-homepage-type') === 'books') selected @endif value="books">{{ trans('entities.books') }}</option>
154                                 <option @if(setting('app-homepage-type') === 'bookshelves') selected @endif value="bookshelves">{{ trans('entities.shelves') }}</option>
155                                 <option @if(setting('app-homepage-type') === 'page') selected @endif value="page">{{ trans('entities.pages_specific') }}</option>
156                             </select>
157
158                             <div page-picker-container style="display: none;" class="mt-m">
159                                 @include('components.page-picker', ['name' => 'setting-app-homepage', 'placeholder' => trans('settings.app_homepage_select'), 'value' => setting('app-homepage')])
160                             </div>
161                         </div>
162                     </div>
163
164
165                     <div>
166                         <label for="setting-app-custom-head" class="setting-list-label">{{ trans('settings.app_custom_html') }}</label>
167                         <p class="small">{{ trans('settings.app_custom_html_desc') }}</p>
168                         <textarea name="setting-app-custom-head" id="setting-app-custom-head" class="simple-code-input mt-m">{{ setting('app-custom-head', '') }}</textarea>
169                     </div>
170
171
172                 </div>
173
174                 <div class="form-group text-right">
175                     <button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
176                 </div>
177             </form>
178         </div>
179
180         <div class="card content-wrap auto-height">
181             <h2 class="list-heading">{{ trans('settings.reg_settings') }}</h2>
182             <form action="{{ baseUrl("/settings") }}" method="POST">
183                 {!! csrf_field() !!}
184
185                 <div class="setting-list">
186                     <div class="grid half gap-xl">
187                         <div>
188                             <label class="setting-list-label">{{ trans('settings.reg_enable') }}</label>
189                             <p class="small">{!! trans('settings.reg_enable_desc') !!}</p>
190                         </div>
191                         <div>
192                             @include('components.toggle-switch', [
193                                 'name' => 'setting-registration-enabled',
194                                 'value' => setting('registration-enabled'),
195                                 'label' => trans('settings.reg_enable_toggle')
196                             ])
197
198                             <label for="setting-registration-role">{{ trans('settings.reg_default_role') }}</label>
199                             <select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
200                                 @foreach(\BookStack\Auth\Role::all() as $role)
201                                     <option value="{{$role->id}}" data-role-name="{{ $role->name }}"
202                                             @if(setting('registration-role', \BookStack\Auth\Role::first()->id) == $role->id) selected @endif
203                                     >
204                                         {{ $role->display_name }}
205                                     </option>
206                                 @endforeach
207                             </select>
208                         </div>
209                     </div>
210
211                     <div class="grid half gap-xl">
212                         <div>
213                             <label for="setting-registration-restrict" class="setting-list-label">{{ trans('settings.reg_confirm_restrict_domain') }}</label>
214                             <p class="small">{!! trans('settings.reg_confirm_restrict_domain_desc') !!}</p>
215                         </div>
216                         <div>
217                             <input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="{{ trans('settings.reg_confirm_restrict_domain_placeholder') }}" value="{{ setting('registration-restrict', '') }}">
218                         </div>
219                     </div>
220
221                     <div class="grid half gap-xl">
222                         <div>
223                             <label class="setting-list-label">{{ trans('settings.reg_email_confirmation') }}</label>
224                             <p class="small">{{ trans('settings.reg_confirm_email_desc') }}</p>
225                         </div>
226                         <div>
227                             @include('components.toggle-switch', [
228                                 'name' => 'setting-registration-confirmation',
229                                 'value' => setting('registration-confirmation'),
230                                 'label' => trans('settings.reg_email_confirmation_toggle')
231                             ])
232                         </div>
233                     </div>
234
235                 </div>
236
237                 <div class="form-group text-right">
238                     <button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
239                 </div>
240             </form>
241         </div>
242
243     </div>
244
245     @include('components.image-manager', ['imageType' => 'system'])
246     @include('components.entity-selector-popup', ['entityTypes' => 'page'])
247 @stop
248
249 @section('scripts')
250     <script src="{{ baseUrl("/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0") }}"></script>
251     <script type="text/javascript">
252         $('#setting-app-color').colorPicker({
253             opacity: false,
254             renderCallback: function($elm, toggled) {
255                 const hexVal = '#' + this.color.colors.HEX;
256                 const rgb = this.color.colors.RND.rgb;
257                 const rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';
258
259                 // Set textbox color to hex color code.
260                 const isEmpty = $.trim($elm.val()).length === 0;
261                 if (!isEmpty) $elm.val(hexVal);
262                 $('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
263
264                 const customStyles = document.getElementById('custom-styles');
265                 const oldColor = customStyles.getAttribute('data-color');
266                 const oldColorLight = customStyles.getAttribute('data-color-light');
267
268                 customStyles.innerHTML = customStyles.innerHTML.split(oldColor).join(hexVal);
269                 customStyles.innerHTML = customStyles.innerHTML.split(oldColorLight).join(rgbLightVal);
270
271                 customStyles.setAttribute('data-color', hexVal);
272                 customStyles.setAttribute('data-color-light', rgbLightVal);
273             }
274         });
275     </script>
276 @stop