1 @extends('simple-layout')
6 <div class="container small">
9 <div class="grid left-focus v-center">
11 @include('settings/navbar', ['selected' => 'settings'])
13 <div class="text-right mb-l px-m">
15 BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
19 <div class="card content-wrap">
20 <h2 class="list-heading">{{ trans('settings.app_settings') }}</h2>
21 <form action="{{ baseUrl("/settings") }}" method="POST">
24 <div class="setting-list">
26 <div class="grid half large-gap">
28 <label for="setting-app-name" class="setting-list-label">{{ trans('settings.app_name') }}</label>
29 <p class="small">{{ trans('settings.app_name_desc') }}</p>
32 <input type="text" value="{{ setting('app-name', 'BookStack') }}" name="setting-app-name" id="setting-app-name">
33 @include('components.toggle-switch', [
34 'name' => 'setting-app-name-header',
35 'value' => setting('app-name-header'),
36 'label' => trans('settings.app_name_header'),
41 <div class="grid half large-gap">
43 <label for="setting-app-public" class="setting-list-label">{{ trans('settings.app_public_viewing') }}</label>
44 {{--<p class="small">{{ trans('settings.app_name_desc') }}</p>--}}
47 @include('components.toggle-switch', [
48 'name' => 'setting-app-public',
49 'value' => setting('app-public'),
50 'label' => trans('settings.app_public_viewing'),
56 <div class="grid half large-gap">
58 <label class="setting-list-label">{{ trans('settings.app_secure_images') }}</label>
59 <p class="small">{{ trans('settings.app_secure_images_desc') }}</p>
62 @include('components.toggle-switch', [
63 'name' => 'setting-app-secure-images',
64 'value' => setting('app-secure-images'),
65 'label' => trans('settings.app_secure_images'),
71 <div class="grid half large-gap">
73 <label class="setting-list-label">{{ trans('settings.app_disable_comments') }}</label>
74 <p class="small">{{ trans('settings.app_disable_comments_desc') }}</p>
77 @include('components.toggle-switch', [
78 'name' => 'setting-app-disable-comments',
79 'value' => setting('app-disable-comments'),
80 'label' => trans('settings.app_disable_comments'),
86 <div class="grid half large-gap">
88 <label class="setting-list-label">{{ trans('settings.app_editor') }}</label>
89 <p class="small">{{ trans('settings.app_editor_desc') }}</p>
92 <select name="setting-app-editor" id="setting-app-editor">
93 <option @if(setting('app-editor') === 'wysiwyg') selected @endif value="wysiwyg">WYSIWYG</option>
94 <option @if(setting('app-editor') === 'markdown') selected @endif value="markdown">Markdown</option>
100 <div class="grid half large-gap">
102 <label class="setting-list-label">{{ trans('settings.app_logo') }}</label>
103 <p class="small">{{ trans('settings.app_logo_desc') }}</p>
106 @include('components.image-picker', [
107 'resizeHeight' => '43',
108 'resizeWidth' => '200',
109 'showRemove' => true,
110 'defaultImage' => baseUrl('/logo.png'),
111 'currentImage' => setting('app-logo'),
112 'name' => 'setting-app-logo',
113 'imageClass' => 'logo-image',
119 <div class="grid half large-gap">
121 <label class="setting-list-label">{{ trans('settings.app_primary_color') }}</label>
122 <p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>
125 <input type="text" value="{{ setting('app-color') }}" name="setting-app-color" id="setting-app-color" placeholder="#0288D1">
126 <input type="hidden" value="{{ setting('app-color-light') }}" name="setting-app-color-light" id="setting-app-color-light">
130 <div homepage-control id="homepage-control" class="grid half large-gap">
132 <label for="setting-app-homepage" class="setting-list-label">{{ trans('settings.app_homepage') }}</label>
133 <p class="small">{{ trans('settings.app_homepage_desc') }}</p>
136 <select name="setting-app-homepage-type" id="setting-app-homepage-type">
137 <option @if(setting('app-homepage-type') === 'default') selected @endif value="default">{{ trans('common.default') }}</option>
138 <option @if(setting('app-homepage-type') === 'books') selected @endif value="books">{{ trans('entities.books') }}</option>
139 <option @if(setting('app-homepage-type') === 'bookshelves') selected @endif value="bookshelves">{{ trans('entities.shelves') }}</option>
140 <option @if(setting('app-homepage-type') === 'page') selected @endif value="page">{{ trans('entities.pages_specific') }}</option>
143 <div page-picker-container style="display: none;" class="mt-m">
144 @include('components.page-picker', ['name' => 'setting-app-homepage', 'placeholder' => trans('settings.app_homepage_select'), 'value' => setting('app-homepage')])
151 <label for="setting-app-custom-head" class="setting-list-label">{{ trans('settings.app_custom_html') }}</label>
152 <p class="small">{{ trans('settings.app_custom_html_desc') }}</p>
153 <textarea name="setting-app-custom-head" id="setting-app-custom-head" class="simple-code-input mt-m">{{ setting('app-custom-head', '') }}</textarea>
159 <div class="form-group text-right">
160 <button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
166 <div class="card content-wrap">
167 <h2 class="list-heading">{{ trans('settings.reg_settings') }}</h2>
168 <form action="{{ baseUrl("/settings") }}" method="POST">
171 <div class="setting-list">
172 <div class="grid half large-gap">
174 <label class="setting-list-label">{{ trans('settings.reg_allow') }}</label>
175 {{--<p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>--}}{{-- TODO--}}
178 @include('components.toggle-switch', [
179 'name' => 'setting-registration-enabled',
180 'value' => setting('registration-enabled'),
181 'label' => trans('settings.reg_allow')
183 {{--TODO - label --}}
187 <div class="grid half large-gap">
189 <label for="setting-registration-role" class="setting-list-label">{{ trans('settings.reg_default_role') }}</label>
190 {{--<p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>--}}{{-- TODO--}}
193 <select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
194 @foreach(\BookStack\Auth\Role::all() as $role)
195 <option value="{{$role->id}}" data-role-name="{{ $role->name }}"
196 @if(setting('registration-role', \BookStack\Auth\Role::first()->id) == $role->id) selected @endif
198 {{ $role->display_name }}
205 <div class="grid half large-gap">
207 <label class="setting-list-label">{{ trans('settings.reg_confirm_email') }}</label>
208 <p class="small">{{ trans('settings.reg_confirm_email_desc') }}</p>
211 @include('components.toggle-switch', [
212 'name' => 'setting-registration-confirmation',
213 'value' => setting('registration-confirmation'),
214 'label' => trans('settings.reg_confirm_email')
216 {{--TODO - label --}}
220 <div class="grid half large-gap">
222 <label for="setting-registration-restrict" class="setting-list-label">{{ trans('settings.reg_confirm_restrict_domain') }}</label>
223 <p class="small">{!! trans('settings.reg_confirm_restrict_domain_desc') !!}</p>
226 <input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="{{ trans('settings.reg_confirm_restrict_domain_placeholder') }}" value="{{ setting('registration-restrict', '') }}">
231 <div class="form-group text-right">
232 <button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
239 @include('components.image-manager', ['imageType' => 'system'])
240 @include('components.entity-selector-popup', ['entityTypes' => 'page'])
244 {{--TODO - Merge into JS--}}
245 <script src="{{ baseUrl("/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0") }}"></script>
246 <script type="text/javascript">
247 $('#setting-app-color').colorPicker({
249 renderCallback: function($elm, toggled) {
250 var hexVal = '#' + this.color.colors.HEX;
251 var rgb = this.color.colors.RND.rgb;
252 var rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';
254 // Set textbox color to hex color code.
255 var isEmpty = $.trim($elm.val()).length === 0;
256 if (!isEmpty) $elm.val(hexVal);
257 $('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
259 var customStyles = document.getElementById('custom-styles');
260 var oldColor = customStyles.getAttribute('data-color');
261 var oldColorLight = customStyles.getAttribute('data-color-light');
263 customStyles.innerHTML = customStyles.innerHTML.split(oldColor).join(hexVal);
264 customStyles.innerHTML = customStyles.innerHTML.split(oldColorLight).join(rgbLightVal);
266 customStyles.setAttribute('data-color', hexVal);
267 customStyles.setAttribute('data-color-light', rgbLightVal);