]> BookStack Code Mirror - bookstack/blob - resources/views/settings/index.blade.php
Major permission naming refactor and database migration cleanup
[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">
8
9     <h1>Settings</h1>
10
11     <form action="/settings" method="POST">
12         {!! csrf_field() !!}
13
14         <h3>App Settings</h3>
15
16         <div class="row">
17             <div class="col-md-6">
18                 <div class="form-group">
19                     <label for="setting-app-name">Application name</label>
20                     <input type="text" value="{{ setting('app-name', 'BookStack') }}" name="setting-app-name" id="setting-app-name">
21                 </div>
22                 <div class="form-group">
23                     <label>Allow public viewing?</label>
24                     <toggle-switch name="setting-app-public" value="{{ setting('app-public') }}"></toggle-switch>
25                 </div>
26                 <div class="form-group">
27                     <label>Enable higher security image uploads?</label>
28                     <p class="small">For performance reasons, all images are public by default, This option adds a random, hard-to-guess characters in front of image names. Ensure directory indexes are not enabled to prevent easy access.</p>
29                     <toggle-switch name="setting-app-secure-images" value="{{ setting('app-secure-images') }}"></toggle-switch>
30                 </div>
31                 <div class="form-group">
32                     <label for="setting-app-editor">Page editor</label>
33                     <p class="small">Select which editor will be used by all users to edit pages.</p>
34                     <select name="setting-app-editor" id="setting-app-editor">
35                         <option @if(setting('app-editor') === 'wysiwyg') selected @endif value="wysiwyg">WYSIWYG</option>
36                         <option @if(setting('app-editor') === 'markdown') selected @endif value="markdown">Markdown</option>
37                     </select>
38                 </div>
39             </div>
40             <div class="col-md-6">
41                 <div class="form-group" id="logo-control">
42                     <label for="setting-app-logo">Application logo</label>
43                     <p class="small">This image should be 43px in height. <br>Large images will be scaled down.</p>
44                     <image-picker resize-height="43" show-remove="true" resize-width="200" current-image="{{ setting('app-logo', '') }}" default-image="/logo.png" name="setting-app-logo" image-class="logo-image"></image-picker>
45                 </div>
46                 <div class="form-group" id="color-control">
47                     <label for="setting-app-color">Application primary color</label>
48                     <p class="small">This should be a hex value. <br> Leave empty to reset to the default color.</p>
49                     <input  type="text" value="{{ setting('app-color', '') }}" name="setting-app-color" id="setting-app-color" placeholder="#0288D1">
50                     <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)">
51                 </div>
52             </div>
53         </div>
54
55
56
57         <hr class="margin-top">
58
59         <h3>Registration Settings</h3>
60         <div class="row">
61             <div class="col-md-6">
62                 <div class="form-group">
63                     <label for="setting-registration-enabled">Allow registration?</label>
64                     <toggle-switch name="setting-registration-enabled" value="{{ setting('registration-enabled') }}"></toggle-switch>
65                 </div>
66                 <div class="form-group">
67                     <label for="setting-registration-role">Default user role after registration</label>
68                     <select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
69                         @foreach(\BookStack\Role::visible() as $role)
70                             <option value="{{$role->id}}" data-role-name="{{ $role->name }}"
71                                     @if(setting('registration-role', \BookStack\Role::first()->id) == $role->id) selected @endif
72                                     >
73                                 {{ $role->display_name }}
74                             </option>
75                         @endforeach
76                     </select>
77                 </div>
78                 <div class="form-group">
79                     <label for="setting-registration-confirmation">Require email confirmation?</label>
80                     <p class="small">If domain restriction is used then email confirmation will be required and the below value will be ignored.</p>
81                     <toggle-switch name="setting-registration-confirmation" value="{{ setting('registration-confirmation') }}"></toggle-switch>
82                 </div>
83             </div>
84             <div class="col-md-6">
85                 <div class="form-group">
86                     <label for="setting-registration-restrict">Restrict registration to domain</label>
87                     <p class="small">Enter a comma separated list of email domains you would like to restrict registration to. Users will be sent an email to confirm their address before being allowed to interact with the application.
88                         <br> Note that users will be able to change their email addresses after successful registration.</p>
89                     <input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="No restriction set" value="{{ setting('registration-restrict', '') }}">
90                 </div>
91             </div>
92         </div>
93
94         <hr class="margin-top">
95
96         <div class="form-group">
97             <button type="submit" class="button pos">Save Settings</button>
98         </div>
99     </form>
100
101 </div>
102
103 @include('partials/image-manager', ['imageType' => 'system'])
104
105 @stop
106
107 @section('scripts')
108     <script src="/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0"></script>
109     <script type="text/javascript">
110         $('#setting-app-color').colorPicker({
111             opacity: false,
112             renderCallback: function($elm, toggled) {
113                 var hexVal = '#' + this.color.colors.HEX;
114                 var rgb = this.color.colors.RND.rgb;
115                 var rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';
116                 // Set textbox color to hex color code.
117                 var isEmpty = $.trim($elm.val()).length === 0;
118                 if (!isEmpty) $elm.val(hexVal);
119                 $('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
120                 // Set page elements to provide preview
121                 $('#header, .image-picker .button').css('background-color', hexVal);
122                 $('.faded-small').css('background-color', rgbLightVal);
123                 $('.setting-nav a.selected').css('border-bottom-color', hexVal);
124             }
125         });
126     </script>
127 @stop