2015-08-30 10:31:16 -04:00
|
|
|
@extends('base')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
|
|
|
@include('settings/navbar', ['selected' => 'settings'])
|
|
|
|
|
2016-05-03 16:10:05 -04:00
|
|
|
<div class="container small settings-container">
|
2015-08-30 10:31:16 -04:00
|
|
|
|
2015-09-03 11:51:10 -04:00
|
|
|
<h1>Settings</h1>
|
2015-08-30 10:31:16 -04:00
|
|
|
|
2016-08-14 07:29:35 -04:00
|
|
|
<form action="{{ baseUrl("/settings") }}" method="POST" ng-cloak>
|
2015-09-03 11:51:10 -04:00
|
|
|
{!! csrf_field() !!}
|
2015-09-05 12:42:05 -04:00
|
|
|
|
|
|
|
<h3>App Settings</h3>
|
2015-10-07 18:17:48 -04:00
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="setting-app-name">Application name</label>
|
2016-03-29 14:26:13 -04:00
|
|
|
<input type="text" value="{{ setting('app-name', 'BookStack') }}" name="setting-app-name" id="setting-app-name">
|
2015-10-07 18:17:48 -04:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2015-10-18 12:29:26 -04:00
|
|
|
<label>Allow public viewing?</label>
|
2016-04-24 05:28:47 -04:00
|
|
|
<div toggle-switch name="setting-app-public" value="{{ setting('app-public') }}"></div>
|
2015-10-07 18:17:48 -04:00
|
|
|
</div>
|
2015-12-07 18:00:34 -05:00
|
|
|
<div class="form-group">
|
|
|
|
<label>Enable higher security image uploads?</label>
|
2016-05-22 06:01:21 -04:00
|
|
|
<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>
|
2016-04-24 05:28:47 -04:00
|
|
|
<div toggle-switch name="setting-app-secure-images" value="{{ setting('app-secure-images') }}"></div>
|
2016-03-29 14:26:13 -04:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2016-04-03 07:19:44 -04:00
|
|
|
<label for="setting-app-editor">Page editor</label>
|
2016-03-29 14:26:13 -04:00
|
|
|
<p class="small">Select which editor will be used by all users to edit pages.</p>
|
|
|
|
<select name="setting-app-editor" id="setting-app-editor">
|
|
|
|
<option @if(setting('app-editor') === 'wysiwyg') selected @endif value="wysiwyg">WYSIWYG</option>
|
|
|
|
<option @if(setting('app-editor') === 'markdown') selected @endif value="markdown">Markdown</option>
|
|
|
|
</select>
|
2015-12-07 18:00:34 -05:00
|
|
|
</div>
|
2015-10-07 18:17:48 -04:00
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="form-group" id="logo-control">
|
2016-04-03 07:19:44 -04:00
|
|
|
<label for="setting-app-logo">Application logo</label>
|
2015-12-08 17:04:59 -05:00
|
|
|
<p class="small">This image should be 43px in height. <br>Large images will be scaled down.</p>
|
2016-08-14 07:29:35 -04:00
|
|
|
<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>
|
2015-10-07 18:17:48 -04:00
|
|
|
</div>
|
2016-03-03 13:01:14 -05:00
|
|
|
<div class="form-group" id="color-control">
|
2016-04-03 07:19:44 -04:00
|
|
|
<label for="setting-app-color">Application primary color</label>
|
2016-03-06 05:52:10 -05:00
|
|
|
<p class="small">This should be a hex value. <br> Leave empty to reset to the default color.</p>
|
2016-03-29 14:26:13 -04:00
|
|
|
<input type="text" value="{{ setting('app-color', '') }}" name="setting-app-color" id="setting-app-color" placeholder="#0288D1">
|
|
|
|
<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)">
|
2016-03-03 13:01:14 -05:00
|
|
|
</div>
|
2015-10-07 18:17:48 -04:00
|
|
|
</div>
|
2015-09-05 12:42:05 -04:00
|
|
|
</div>
|
2016-05-22 06:01:21 -04:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="setting-app-custom-head">Custom HTML head content</label>
|
|
|
|
<p class="small">Any content added here will be inserted into the bottom of the <head> section of every page. This is handy for overriding styles or adding analytics code.</p>
|
|
|
|
<textarea name="setting-app-custom-head" id="setting-app-custom-head">{{ setting('app-custom-head', '') }}</textarea>
|
|
|
|
</div>
|
2015-10-07 18:17:48 -04:00
|
|
|
|
2015-09-05 12:42:05 -04:00
|
|
|
<hr class="margin-top">
|
|
|
|
|
|
|
|
<h3>Registration Settings</h3>
|
2016-05-22 06:01:21 -04:00
|
|
|
|
2015-09-05 12:42:05 -04:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="setting-registration-enabled">Allow registration?</label>
|
2016-04-24 05:28:47 -04:00
|
|
|
<div toggle-switch name="setting-registration-enabled" value="{{ setting('registration-enabled') }}"></div>
|
2015-09-05 12:42:05 -04:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="setting-registration-role">Default user role after registration</label>
|
|
|
|
<select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
|
2016-05-01 14:36:53 -04:00
|
|
|
@foreach(\BookStack\Role::visible() as $role)
|
|
|
|
<option value="{{$role->id}}" data-role-name="{{ $role->name }}"
|
2016-03-29 14:26:13 -04:00
|
|
|
@if(setting('registration-role', \BookStack\Role::first()->id) == $role->id) selected @endif
|
2015-09-05 12:42:05 -04:00
|
|
|
>
|
|
|
|
{{ $role->display_name }}
|
|
|
|
</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2015-12-07 18:00:34 -05:00
|
|
|
<label for="setting-registration-confirmation">Require email confirmation?</label>
|
2015-09-05 12:42:05 -04:00
|
|
|
<p class="small">If domain restriction is used then email confirmation will be required and the below value will be ignored.</p>
|
2016-04-24 05:28:47 -04:00
|
|
|
<div toggle-switch name="setting-registration-confirmation" value="{{ setting('registration-confirmation') }}"></div>
|
2015-09-05 12:42:05 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="setting-registration-restrict">Restrict registration to domain</label>
|
|
|
|
<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.
|
|
|
|
<br> Note that users will be able to change their email addresses after successful registration.</p>
|
2016-03-29 14:26:13 -04:00
|
|
|
<input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="No restriction set" value="{{ setting('registration-restrict', '') }}">
|
2015-09-05 12:42:05 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-09-03 11:51:10 -04:00
|
|
|
</div>
|
2015-09-05 12:42:05 -04:00
|
|
|
|
|
|
|
<hr class="margin-top">
|
|
|
|
|
2015-09-03 11:51:10 -04:00
|
|
|
<div class="form-group">
|
2016-05-03 16:10:05 -04:00
|
|
|
<span class="float right muted">
|
|
|
|
BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
|
|
|
|
</span>
|
2015-09-05 12:42:05 -04:00
|
|
|
<button type="submit" class="button pos">Save Settings</button>
|
2015-09-03 11:51:10 -04:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
2015-08-30 10:31:16 -04:00
|
|
|
|
2015-12-30 13:38:18 -05:00
|
|
|
@include('partials/image-manager', ['imageType' => 'system'])
|
2015-10-07 18:17:48 -04:00
|
|
|
|
2015-10-08 18:49:18 -04:00
|
|
|
@stop
|
2016-03-03 13:01:14 -05:00
|
|
|
|
|
|
|
@section('scripts')
|
2016-08-14 07:29:35 -04:00
|
|
|
<script src="{{ baseUrl("/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0") }}"></script>
|
2016-03-06 05:52:10 -05:00
|
|
|
<script type="text/javascript">
|
|
|
|
$('#setting-app-color').colorPicker({
|
|
|
|
opacity: false,
|
|
|
|
renderCallback: function($elm, toggled) {
|
|
|
|
var hexVal = '#' + this.color.colors.HEX;
|
|
|
|
var rgb = this.color.colors.RND.rgb;
|
|
|
|
var rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';
|
|
|
|
// Set textbox color to hex color code.
|
|
|
|
var isEmpty = $.trim($elm.val()).length === 0;
|
|
|
|
if (!isEmpty) $elm.val(hexVal);
|
|
|
|
$('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
|
|
|
|
// Set page elements to provide preview
|
2016-08-14 07:29:35 -04:00
|
|
|
$('#header, .image-picker .button').attr('style', 'background-color:'+ hexVal+'!important;');
|
2016-03-06 05:52:10 -05:00
|
|
|
$('.faded-small').css('background-color', rgbLightVal);
|
2016-08-14 07:29:35 -04:00
|
|
|
$('.setting-nav a.selected').css('border-bottom-color', hexVal + '!important');
|
2016-03-06 05:52:10 -05:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2016-03-03 13:01:14 -05:00
|
|
|
@stop
|