1 @extends('simple-layout')
4 <div class="container small">
6 <div class="grid left-focus v-center no-row-gap">
8 @include('settings.navbar', ['selected' => 'settings'])
10 <div class="text-right mb-l px-m">
12 BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
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">
21 <div class="setting-list">
24 <div class="grid half gap-xl">
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>
35 @include('components.toggle-switch', [
36 'name' => 'setting-app-public',
37 'value' => setting('app-public'),
38 'label' => trans('settings.app_public_access_toggle'),
43 <div class="grid half gap-xl">
45 <label class="setting-list-label">{{ trans('settings.app_secure_images') }}</label>
46 <p class="small">{{ trans('settings.app_secure_images_desc') }}</p>
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'),
57 <div class="grid half gap-xl">
59 <label class="setting-list-label">{{ trans('settings.app_disable_comments') }}</label>
60 <p class="small">{!! trans('settings.app_disable_comments_desc') !!}</p>
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'),
74 <div class="form-group text-right">
75 <button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
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" enctype="multipart/form-data">
85 <div class="setting-list">
87 <div class="grid half gap-xl">
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>
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'),
102 <div class="grid half gap-xl">
104 <label class="setting-list-label">{{ trans('settings.app_editor') }}</label>
105 <p class="small">{{ trans('settings.app_editor_desc') }}</p>
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>
115 <div class="grid half gap-xl">
117 <label class="setting-list-label">{{ trans('settings.app_logo') }}</label>
118 <p class="small">{!! trans('settings.app_logo_desc') !!}</p>
121 @include('components.image-picker', [
122 'removeName' => 'setting-app-logo',
123 'removeValue' => 'none',
124 'defaultImage' => baseUrl('/logo.png'),
125 'currentImage' => setting('app-logo'),
126 'name' => 'app_logo',
127 'imageClass' => 'logo-image',
132 <div class="grid half gap-xl">
134 <label class="setting-list-label">{{ trans('settings.app_primary_color') }}</label>
135 <p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>
138 <input type="text" value="{{ setting('app-color') }}" name="setting-app-color" id="setting-app-color" placeholder="#0288D1">
139 <input type="hidden" value="{{ setting('app-color-light') }}" name="setting-app-color-light" id="setting-app-color-light">
143 <div homepage-control id="homepage-control" class="grid half gap-xl">
145 <label for="setting-app-homepage" class="setting-list-label">{{ trans('settings.app_homepage') }}</label>
146 <p class="small">{{ trans('settings.app_homepage_desc') }}</p>
149 <select name="setting-app-homepage-type" id="setting-app-homepage-type">
150 <option @if(setting('app-homepage-type') === 'default') selected @endif value="default">{{ trans('common.default') }}</option>
151 <option @if(setting('app-homepage-type') === 'books') selected @endif value="books">{{ trans('entities.books') }}</option>
152 <option @if(setting('app-homepage-type') === 'bookshelves') selected @endif value="bookshelves">{{ trans('entities.shelves') }}</option>
153 <option @if(setting('app-homepage-type') === 'page') selected @endif value="page">{{ trans('entities.pages_specific') }}</option>
156 <div page-picker-container style="display: none;" class="mt-m">
157 @include('components.page-picker', ['name' => 'setting-app-homepage', 'placeholder' => trans('settings.app_homepage_select'), 'value' => setting('app-homepage')])
164 <label for="setting-app-custom-head" class="setting-list-label">{{ trans('settings.app_custom_html') }}</label>
165 <p class="small">{{ trans('settings.app_custom_html_desc') }}</p>
166 <textarea name="setting-app-custom-head" id="setting-app-custom-head" class="simple-code-input mt-m">{{ setting('app-custom-head', '') }}</textarea>
172 <div class="form-group text-right">
173 <button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
178 <div class="card content-wrap auto-height">
179 <h2 class="list-heading">{{ trans('settings.reg_settings') }}</h2>
180 <form action="{{ baseUrl("/settings") }}" method="POST">
183 <div class="setting-list">
184 <div class="grid half gap-xl">
186 <label class="setting-list-label">{{ trans('settings.reg_enable') }}</label>
187 <p class="small">{!! trans('settings.reg_enable_desc') !!}</p>
190 @include('components.toggle-switch', [
191 'name' => 'setting-registration-enabled',
192 'value' => setting('registration-enabled'),
193 'label' => trans('settings.reg_enable_toggle')
196 <label for="setting-registration-role">{{ trans('settings.reg_default_role') }}</label>
197 <select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
198 @foreach(\BookStack\Auth\Role::all() as $role)
199 <option value="{{$role->id}}" data-role-name="{{ $role->name }}"
200 @if(setting('registration-role', \BookStack\Auth\Role::first()->id) == $role->id) selected @endif
202 {{ $role->display_name }}
209 <div class="grid half gap-xl">
211 <label for="setting-registration-restrict" class="setting-list-label">{{ trans('settings.reg_confirm_restrict_domain') }}</label>
212 <p class="small">{!! trans('settings.reg_confirm_restrict_domain_desc') !!}</p>
215 <input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="{{ trans('settings.reg_confirm_restrict_domain_placeholder') }}" value="{{ setting('registration-restrict', '') }}">
219 <div class="grid half gap-xl">
221 <label class="setting-list-label">{{ trans('settings.reg_email_confirmation') }}</label>
222 <p class="small">{{ trans('settings.reg_confirm_email_desc') }}</p>
225 @include('components.toggle-switch', [
226 'name' => 'setting-registration-confirmation',
227 'value' => setting('registration-confirmation'),
228 'label' => trans('settings.reg_email_confirmation_toggle')
235 <div class="form-group text-right">
236 <button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
243 @include('components.image-manager', ['imageType' => 'system'])
244 @include('components.entity-selector-popup', ['entityTypes' => 'page'])
248 <script src="{{ baseUrl("/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0") }}"></script>
249 <script type="text/javascript">
250 $('#setting-app-color').colorPicker({
252 renderCallback: function($elm, toggled) {
253 const hexVal = '#' + this.color.colors.HEX;
254 const rgb = this.color.colors.RND.rgb;
255 const rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';
257 // Set textbox color to hex color code.
258 const isEmpty = $.trim($elm.val()).length === 0;
259 if (!isEmpty) $elm.val(hexVal);
260 $('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
262 const customStyles = document.getElementById('custom-styles');
263 const oldColor = customStyles.getAttribute('data-color');
264 const oldColorLight = customStyles.getAttribute('data-color-light');
266 customStyles.innerHTML = customStyles.innerHTML.split(oldColor).join(hexVal);
267 customStyles.innerHTML = customStyles.innerHTML.split(oldColorLight).join(rgbLightVal);
269 customStyles.setAttribute('data-color', hexVal);
270 customStyles.setAttribute('data-color-light', rgbLightVal);