]> BookStack Code Mirror - bookstack/blob - resources/views/settings/index.blade.php
Fixes typo causing the message not to be displayed
[bookstack] / resources / views / settings / index.blade.php
1 @extends('base')
2
3 @section('content')
4
5     @include('settings/navbar', ['selected' => 'settings'])
6
7 <div class="container small settings-container">
8
9     <h1>{{ trans('settings.settings') }}</h1>
10
11     <form action="{{ baseUrl("/settings") }}" method="POST">
12         {!! csrf_field() !!}
13
14         <h3>{{ trans('settings.app_settings') }}</h3>
15
16         <div class="row">
17
18             <div class="col-md-6">
19                 <div class="form-group">
20                     <label for="setting-app-name">{{ trans('settings.app_name') }}</label>
21                     <p class="small">{{ trans('settings.app_name_desc') }}</p>
22                     <input type="text" value="{{ setting('app-name', 'BookStack') }}" name="setting-app-name" id="setting-app-name">
23                 </div>
24                 <div class="form-group">
25                     <label>{{ trans('settings.app_name_header') }}</label>
26                     @include('components.toggle-switch', ['name' => 'setting-app-name-header', 'value' => setting('app-name-header')])
27                 </div>
28                 <div class="form-group">
29                     <label for="setting-app-public">{{ trans('settings.app_public_viewing') }}</label>
30                     @include('components.toggle-switch', ['name' => 'setting-app-public', 'value' => setting('app-public')])
31                 </div>
32                 <div class="form-group">
33                     <label>{{ trans('settings.app_secure_images') }}</label>
34                     <p class="small">{{ trans('settings.app_secure_images_desc') }}</p>
35                     @include('components.toggle-switch', ['name' => 'setting-app-secure-images', 'value' => setting('app-secure-images')])
36                 </div>
37                 <div class="form-group">
38                     <label for="setting-app-editor">{{ trans('settings.app_editor') }}</label>
39                     <p class="small">{{ trans('settings.app_editor_desc') }}</p>
40                     <select name="setting-app-editor" id="setting-app-editor">
41                         <option @if(setting('app-editor') === 'wysiwyg') selected @endif value="wysiwyg">WYSIWYG</option>
42                         <option @if(setting('app-editor') === 'markdown') selected @endif value="markdown">Markdown</option>
43                     </select>
44                 </div>
45             </div>
46
47             <div class="col-md-6">
48                 <div class="form-group" id="logo-control">
49                     <label for="setting-app-logo">{{ trans('settings.app_logo') }}</label>
50                     <p class="small">{!! trans('settings.app_logo_desc') !!}</p>
51
52                     @include('components.image-picker', [
53                         'resizeHeight' => '43',
54                         'resizeWidth' => '200',
55                         'showRemove' => true,
56                         'defaultImage' => baseUrl('/logo.png'),
57                         'currentImage' => setting('app-logo'),
58                         'name' => 'setting-app-logo',
59                         'imageClass' => 'logo-image',
60                         'currentId' => false
61                     ])
62
63                 </div>
64                 <div class="form-group" id="color-control">
65                     <label for="setting-app-color">{{ trans('settings.app_primary_color') }}</label>
66                     <p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>
67                     <input  type="text" value="{{ setting('app-color', '') }}" name="setting-app-color" id="setting-app-color" placeholder="#0288D1">
68                     <input  type="hidden" value="{{ setting('app-color-light', '') }}" name="setting-app-color-light" id="setting-app-color-light" placeholder="rgba(21, 101, 192, 0.15)">
69                 </div>
70             </div>
71
72         </div>
73
74         <div class="form-group">
75             <label for="setting-app-custom-head">{{ trans('settings.app_custom_html') }}</label>
76             <p class="small">{{ trans('settings.app_custom_html_desc') }}</p>
77             <textarea name="setting-app-custom-head" id="setting-app-custom-head">{{ setting('app-custom-head', '') }}</textarea>
78         </div>
79
80         <hr class="margin-top">
81
82         <h3>{{ trans('settings.reg_settings') }}</h3>
83
84         <div class="row">
85             <div class="col-md-6">
86                 <div class="form-group">
87                     <label for="setting-registration-enabled">{{ trans('settings.reg_allow') }}</label>
88                     @include('components.toggle-switch', ['name' => 'setting-registration-enabled', 'value' => setting('registration-enabled')])
89                 </div>
90                 <div class="form-group">
91                     <label for="setting-registration-role">{{ trans('settings.reg_default_role') }}</label>
92                     <select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
93                         @foreach(\BookStack\Role::all() as $role)
94                             <option value="{{$role->id}}" data-role-name="{{ $role->name }}"
95                                     @if(setting('registration-role', \BookStack\Role::first()->id) == $role->id) selected @endif
96                                     >
97                                 {{ $role->display_name }}
98                             </option>
99                         @endforeach
100                     </select>
101                 </div>
102                 <div class="form-group">
103                     <label for="setting-registration-confirmation">{{ trans('settings.reg_confirm_email') }}</label>
104                     <p class="small">{{ trans('settings.reg_confirm_email_desc') }}</p>
105                     @include('components.toggle-switch', ['name' => 'setting-registration-confirmation', 'value' => setting('registration-confirmation')])
106                 </div>
107             </div>
108             <div class="col-md-6">
109                 <div class="form-group">
110                     <label for="setting-registration-restrict">{{ trans('settings.reg_confirm_restrict_domain') }}</label>
111                     <p class="small">{!! trans('settings.reg_confirm_restrict_domain_desc') !!}</p>
112                     <input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="{{ trans('settings.reg_confirm_restrict_domain_placeholder') }}" value="{{ setting('registration-restrict', '') }}">
113                 </div>
114             </div>
115         </div>
116
117         <hr class="margin-top">
118
119         <div class="form-group">
120             <span class="float right muted">
121                 BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
122             </span>
123             <button type="submit" class="button pos">{{ trans('settings.settings_save') }}</button>
124         </div>
125     </form>
126
127 </div>
128
129 @include('components.image-manager', ['imageType' => 'system'])
130
131 @stop
132
133 @section('scripts')
134     <script src="{{ baseUrl("/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0") }}"></script>
135     <script type="text/javascript">
136         $('#setting-app-color').colorPicker({
137             opacity: false,
138             renderCallback: function($elm, toggled) {
139                 var hexVal = '#' + this.color.colors.HEX;
140                 var rgb = this.color.colors.RND.rgb;
141                 var rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';
142                 // Set textbox color to hex color code.
143                 var isEmpty = $.trim($elm.val()).length === 0;
144                 if (!isEmpty) $elm.val(hexVal);
145                 $('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
146
147                 var customStyles = document.getElementById('custom-styles');
148                 var oldColor = customStyles.getAttribute('data-color');
149                 var oldColorLight = customStyles.getAttribute('data-color-light');
150
151                 customStyles.innerHTML = customStyles.innerHTML.split(oldColor).join(hexVal);
152                 customStyles.innerHTML = customStyles.innerHTML.split(oldColorLight).join(rgbLightVal);
153
154                 customStyles.setAttribute('data-color', hexVal);
155                 customStyles.setAttribute('data-color-light', rgbLightVal);
156             }
157         });
158     </script>
159 @stop