]> BookStack Code Mirror - bookstack/blob - resources/views/settings/index.blade.php
Applied baseUrl to login redirect
[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>Settings</h1>
10
11     <form action="{{ baseUrl("/settings") }}" method="POST" ng-cloak>
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                     <div toggle-switch name="setting-app-public" value="{{ setting('app-public') }}"></div>
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. This option adds a random, hard-to-guess string in front of image urls. Ensure directory indexes are not enabled to prevent easy access.</p>
29                     <div toggle-switch name="setting-app-secure-images" value="{{ setting('app-secure-images') }}"></div>
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="{{ baseUrl('/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         <div class="form-group">
55             <label for="setting-app-custom-head">Custom HTML head content</label>
56             <p class="small">Any content added here will be inserted into the bottom of the &lt;head&gt; section of every page. This is handy for overriding styles or adding analytics code.</p>
57             <textarea name="setting-app-custom-head" id="setting-app-custom-head">{{ setting('app-custom-head', '') }}</textarea>
58         </div>
59
60         <hr class="margin-top">
61
62         <h3>Registration Settings</h3>
63
64         <div class="row">
65             <div class="col-md-6">
66                 <div class="form-group">
67                     <label for="setting-registration-enabled">Allow registration?</label>
68                     <div toggle-switch name="setting-registration-enabled" value="{{ setting('registration-enabled') }}"></div>
69                 </div>
70                 <div class="form-group">
71                     <label for="setting-registration-role">Default user role after registration</label>
72                     <select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
73                         @foreach(\BookStack\Role::visible() as $role)
74                             <option value="{{$role->id}}" data-role-name="{{ $role->name }}"
75                                     @if(setting('registration-role', \BookStack\Role::first()->id) == $role->id) selected @endif
76                                     >
77                                 {{ $role->display_name }}
78                             </option>
79                         @endforeach
80                     </select>
81                 </div>
82                 <div class="form-group">
83                     <label for="setting-registration-confirmation">Require email confirmation?</label>
84                     <p class="small">If domain restriction is used then email confirmation will be required and the below value will be ignored.</p>
85                     <div toggle-switch name="setting-registration-confirmation" value="{{ setting('registration-confirmation') }}"></div>
86                 </div>
87             </div>
88             <div class="col-md-6">
89                 <div class="form-group">
90                     <label for="setting-registration-restrict">Restrict registration to domain</label>
91                     <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.
92                         <br> Note that users will be able to change their email addresses after successful registration.</p>
93                     <input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="No restriction set" value="{{ setting('registration-restrict', '') }}">
94                 </div>
95             </div>
96         </div>
97
98         <hr class="margin-top">
99
100         <div class="form-group">
101             <span class="float right muted">
102                 BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
103             </span>
104             <button type="submit" class="button pos">Save Settings</button>
105         </div>
106     </form>
107
108 </div>
109
110 @include('partials/image-manager', ['imageType' => 'system'])
111
112 @stop
113
114 @section('scripts')
115     <script src="{{ baseUrl("/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0") }}"></script>
116     <script type="text/javascript">
117         $('#setting-app-color').colorPicker({
118             opacity: false,
119             renderCallback: function($elm, toggled) {
120                 var hexVal = '#' + this.color.colors.HEX;
121                 var rgb = this.color.colors.RND.rgb;
122                 var rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';
123                 // Set textbox color to hex color code.
124                 var isEmpty = $.trim($elm.val()).length === 0;
125                 if (!isEmpty) $elm.val(hexVal);
126                 $('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
127                 // Set page elements to provide preview
128                 $('#header, .image-picker .button').attr('style', 'background-color:'+ hexVal+'!important;');
129                 $('.faded-small').css('background-color', rgbLightVal);
130                 $('.setting-nav a.selected').css('border-bottom-color', hexVal  + '!important');
131             }
132         });
133     </script>
134 @stop