2017-08-26 12:17:04 -04:00
|
|
|
@extends('simple-layout')
|
2015-08-30 10:31:16 -04:00
|
|
|
|
2017-08-26 12:17:04 -04:00
|
|
|
@section('body')
|
2019-02-02 10:49:57 -05:00
|
|
|
<div class="container small">
|
2017-08-26 12:17:04 -04:00
|
|
|
|
2019-02-02 10:49:57 -05:00
|
|
|
<div class="grid left-focus v-center">
|
|
|
|
<div class="py-m">
|
2019-02-16 09:17:35 -05:00
|
|
|
@include('settings.navbar', ['selected' => 'settings'])
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
<div class="text-right mb-l px-m">
|
|
|
|
<br>
|
|
|
|
BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-02-16 09:17:35 -05:00
|
|
|
<div class="card content-wrap auto-height">
|
|
|
|
<h2 class="list-heading">{{ trans('settings.app_features_security') }}</h2>
|
2017-08-26 12:17:04 -04:00
|
|
|
<form action="{{ baseUrl("/settings") }}" method="POST">
|
2019-02-02 10:49:57 -05:00
|
|
|
{!! csrf_field() !!}
|
|
|
|
|
|
|
|
<div class="setting-list">
|
2017-08-26 12:17:04 -04:00
|
|
|
|
2019-02-02 10:49:57 -05:00
|
|
|
|
2019-03-30 10:27:00 -04:00
|
|
|
<div class="grid half gap-xl">
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
2019-02-16 09:17:35 -05:00
|
|
|
<label for="setting-app-public" class="setting-list-label">{{ trans('settings.app_public_access') }}</label>
|
|
|
|
<p class="small">{!! trans('settings.app_public_access_desc') !!}</p>
|
|
|
|
@if(userCan('users-manage'))
|
|
|
|
<p class="small mb-none">
|
|
|
|
<a href="{{ baseUrl($guestUser->getEditUrl()) }}">{!! trans('settings.app_public_access_desc_guest') !!}</a>
|
|
|
|
</p>
|
|
|
|
@endif
|
2017-08-26 12:17:04 -04:00
|
|
|
</div>
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
|
|
|
@include('components.toggle-switch', [
|
|
|
|
'name' => 'setting-app-public',
|
|
|
|
'value' => setting('app-public'),
|
2019-02-16 09:17:35 -05:00
|
|
|
'label' => trans('settings.app_public_access_toggle'),
|
2019-02-02 10:49:57 -05:00
|
|
|
])
|
2017-08-26 12:17:04 -04:00
|
|
|
</div>
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
|
2019-03-30 10:27:00 -04:00
|
|
|
<div class="grid half gap-xl">
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
|
|
|
<label class="setting-list-label">{{ trans('settings.app_secure_images') }}</label>
|
2017-08-26 12:17:04 -04:00
|
|
|
<p class="small">{{ trans('settings.app_secure_images_desc') }}</p>
|
|
|
|
</div>
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
|
|
|
@include('components.toggle-switch', [
|
|
|
|
'name' => 'setting-app-secure-images',
|
|
|
|
'value' => setting('app-secure-images'),
|
2019-02-16 09:17:35 -05:00
|
|
|
'label' => trans('settings.app_secure_images_toggle'),
|
2019-02-02 10:49:57 -05:00
|
|
|
])
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-03-30 10:27:00 -04:00
|
|
|
<div class="grid half gap-xl">
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
|
|
|
<label class="setting-list-label">{{ trans('settings.app_disable_comments') }}</label>
|
2019-02-16 09:17:35 -05:00
|
|
|
<p class="small">{!! trans('settings.app_disable_comments_desc') !!}</p>
|
2017-11-15 13:35:24 -05:00
|
|
|
</div>
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
|
|
|
@include('components.toggle-switch', [
|
|
|
|
'name' => 'setting-app-disable-comments',
|
|
|
|
'value' => setting('app-disable-comments'),
|
2019-02-16 10:39:23 -05:00
|
|
|
'label' => trans('settings.app_disable_comments_toggle'),
|
2019-02-02 10:49:57 -05:00
|
|
|
])
|
2019-02-16 09:17:35 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group text-right">
|
|
|
|
<button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card content-wrap auto-height">
|
|
|
|
<h2 class="list-heading">{{ trans('settings.app_customization') }}</h2>
|
|
|
|
<form action="{{ baseUrl("/settings") }}" method="POST">
|
|
|
|
{!! csrf_field() !!}
|
|
|
|
|
|
|
|
<div class="setting-list">
|
|
|
|
|
2019-03-30 10:27:00 -04:00
|
|
|
<div class="grid half gap-xl">
|
2019-02-16 09:17:35 -05:00
|
|
|
<div>
|
|
|
|
<label for="setting-app-name" class="setting-list-label">{{ trans('settings.app_name') }}</label>
|
|
|
|
<p class="small">{{ trans('settings.app_name_desc') }}</p>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<input type="text" value="{{ setting('app-name', 'BookStack') }}" name="setting-app-name" id="setting-app-name">
|
|
|
|
@include('components.toggle-switch', [
|
|
|
|
'name' => 'setting-app-name-header',
|
|
|
|
'value' => setting('app-name-header'),
|
|
|
|
'label' => trans('settings.app_name_header'),
|
|
|
|
])
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-03-30 10:27:00 -04:00
|
|
|
<div class="grid half gap-xl">
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
|
|
|
<label class="setting-list-label">{{ trans('settings.app_editor') }}</label>
|
2017-08-26 12:17:04 -04:00
|
|
|
<p class="small">{{ trans('settings.app_editor_desc') }}</p>
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
<div>
|
2017-08-26 12:17:04 -04:00
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-03-30 10:27:00 -04:00
|
|
|
<div class="grid half gap-xl">
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
|
|
|
<label class="setting-list-label">{{ trans('settings.app_logo') }}</label>
|
2019-02-16 09:17:35 -05:00
|
|
|
<p class="small">{!! trans('settings.app_logo_desc') !!}</p>
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
<div>
|
2017-08-26 12:17:04 -04:00
|
|
|
@include('components.image-picker', [
|
2019-02-02 10:49:57 -05:00
|
|
|
'resizeHeight' => '43',
|
|
|
|
'resizeWidth' => '200',
|
|
|
|
'showRemove' => true,
|
|
|
|
'defaultImage' => baseUrl('/logo.png'),
|
|
|
|
'currentImage' => setting('app-logo'),
|
|
|
|
'name' => 'setting-app-logo',
|
|
|
|
'imageClass' => 'logo-image',
|
|
|
|
'currentId' => false
|
|
|
|
])
|
2017-08-26 12:17:04 -04:00
|
|
|
</div>
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
|
2019-03-30 10:27:00 -04:00
|
|
|
<div class="grid half gap-xl">
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
|
|
|
<label class="setting-list-label">{{ trans('settings.app_primary_color') }}</label>
|
2017-08-26 12:17:04 -04:00
|
|
|
<p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
<div>
|
2017-08-27 07:59:56 -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">
|
2017-08-26 12:17:04 -04:00
|
|
|
</div>
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
2018-09-20 10:27:30 -04:00
|
|
|
|
2019-03-30 10:27:00 -04:00
|
|
|
<div homepage-control id="homepage-control" class="grid half gap-xl">
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
|
|
|
<label for="setting-app-homepage" class="setting-list-label">{{ trans('settings.app_homepage') }}</label>
|
|
|
|
<p class="small">{{ trans('settings.app_homepage_desc') }}</p>
|
|
|
|
</div>
|
|
|
|
<div>
|
2018-09-20 10:27:30 -04:00
|
|
|
<select name="setting-app-homepage-type" id="setting-app-homepage-type">
|
|
|
|
<option @if(setting('app-homepage-type') === 'default') selected @endif value="default">{{ trans('common.default') }}</option>
|
|
|
|
<option @if(setting('app-homepage-type') === 'books') selected @endif value="books">{{ trans('entities.books') }}</option>
|
|
|
|
<option @if(setting('app-homepage-type') === 'bookshelves') selected @endif value="bookshelves">{{ trans('entities.shelves') }}</option>
|
|
|
|
<option @if(setting('app-homepage-type') === 'page') selected @endif value="page">{{ trans('entities.pages_specific') }}</option>
|
|
|
|
</select>
|
|
|
|
|
2019-02-02 10:49:57 -05:00
|
|
|
<div page-picker-container style="display: none;" class="mt-m">
|
2018-09-20 10:27:30 -04:00
|
|
|
@include('components.page-picker', ['name' => 'setting-app-homepage', 'placeholder' => trans('settings.app_homepage_select'), 'value' => setting('app-homepage')])
|
|
|
|
</div>
|
2017-08-28 08:38:32 -04:00
|
|
|
</div>
|
2017-08-26 12:17:04 -04:00
|
|
|
</div>
|
2016-09-22 13:53:22 -04:00
|
|
|
|
2017-08-26 12:17:04 -04:00
|
|
|
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
|
|
|
<label for="setting-app-custom-head" class="setting-list-label">{{ trans('settings.app_custom_html') }}</label>
|
|
|
|
<p class="small">{{ trans('settings.app_custom_html_desc') }}</p>
|
|
|
|
<textarea name="setting-app-custom-head" id="setting-app-custom-head" class="simple-code-input mt-m">{{ setting('app-custom-head', '') }}</textarea>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2015-12-07 18:00:34 -05:00
|
|
|
</div>
|
2016-12-24 10:21:19 -05:00
|
|
|
|
2017-08-26 12:17:04 -04:00
|
|
|
<div class="form-group text-right">
|
2019-02-02 10:49:57 -05:00
|
|
|
<button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
|
2015-10-07 18:17:48 -04:00
|
|
|
</div>
|
2017-08-26 12:17:04 -04:00
|
|
|
</form>
|
2016-05-22 06:01:21 -04:00
|
|
|
</div>
|
2017-08-26 12:17:04 -04:00
|
|
|
|
2019-02-16 09:17:35 -05:00
|
|
|
<div class="card content-wrap auto-height">
|
2019-02-02 10:49:57 -05:00
|
|
|
<h2 class="list-heading">{{ trans('settings.reg_settings') }}</h2>
|
2017-08-26 12:17:04 -04:00
|
|
|
<form action="{{ baseUrl("/settings") }}" method="POST">
|
|
|
|
{!! csrf_field() !!}
|
|
|
|
|
2019-02-02 10:49:57 -05:00
|
|
|
<div class="setting-list">
|
2019-03-30 10:27:00 -04:00
|
|
|
<div class="grid half gap-xl">
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
2019-02-16 09:17:35 -05:00
|
|
|
<label class="setting-list-label">{{ trans('settings.reg_enable') }}</label>
|
|
|
|
<p class="small">{!! trans('settings.reg_enable_desc') !!}</p>
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
@include('components.toggle-switch', [
|
|
|
|
'name' => 'setting-registration-enabled',
|
|
|
|
'value' => setting('registration-enabled'),
|
2019-02-16 10:39:23 -05:00
|
|
|
'label' => trans('settings.reg_enable_toggle')
|
2019-02-02 10:49:57 -05:00
|
|
|
])
|
|
|
|
|
2019-02-16 09:17:35 -05:00
|
|
|
<label for="setting-registration-role">{{ trans('settings.reg_default_role') }}</label>
|
2017-08-26 12:17:04 -04:00
|
|
|
<select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
|
2018-09-25 07:30:50 -04:00
|
|
|
@foreach(\BookStack\Auth\Role::all() as $role)
|
2017-08-26 12:17:04 -04:00
|
|
|
<option value="{{$role->id}}" data-role-name="{{ $role->name }}"
|
2018-09-25 07:30:50 -04:00
|
|
|
@if(setting('registration-role', \BookStack\Auth\Role::first()->id) == $role->id) selected @endif
|
2015-09-05 12:42:05 -04:00
|
|
|
>
|
2017-08-26 12:17:04 -04:00
|
|
|
{{ $role->display_name }}
|
|
|
|
</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
</div>
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
|
2019-03-30 10:27:00 -04:00
|
|
|
<div class="grid half gap-xl">
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
2019-02-16 09:17:35 -05:00
|
|
|
<label for="setting-registration-restrict" class="setting-list-label">{{ trans('settings.reg_confirm_restrict_domain') }}</label>
|
|
|
|
<p class="small">{!! trans('settings.reg_confirm_restrict_domain_desc') !!}</p>
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
<div>
|
2019-02-16 09:17:35 -05:00
|
|
|
<input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="{{ trans('settings.reg_confirm_restrict_domain_placeholder') }}" value="{{ setting('registration-restrict', '') }}">
|
2017-08-26 12:17:04 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-02-02 10:49:57 -05:00
|
|
|
|
2019-03-30 10:27:00 -04:00
|
|
|
<div class="grid half gap-xl">
|
2019-02-02 10:49:57 -05:00
|
|
|
<div>
|
2019-02-16 09:17:35 -05:00
|
|
|
<label class="setting-list-label">{{ trans('settings.reg_email_confirmation') }}</label>
|
|
|
|
<p class="small">{{ trans('settings.reg_confirm_email_desc') }}</p>
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
|
|
|
<div>
|
2019-02-16 09:17:35 -05:00
|
|
|
@include('components.toggle-switch', [
|
|
|
|
'name' => 'setting-registration-confirmation',
|
|
|
|
'value' => setting('registration-confirmation'),
|
|
|
|
'label' => trans('settings.reg_email_confirmation_toggle')
|
|
|
|
])
|
2017-08-26 12:17:04 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-02-16 09:17:35 -05:00
|
|
|
|
2015-09-05 12:42:05 -04:00
|
|
|
</div>
|
2017-08-26 12:17:04 -04:00
|
|
|
|
|
|
|
<div class="form-group text-right">
|
2019-02-02 10:49:57 -05:00
|
|
|
<button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
|
2015-09-05 12:42:05 -04:00
|
|
|
</div>
|
2017-08-26 12:17:04 -04:00
|
|
|
</form>
|
2015-09-03 11:51:10 -04:00
|
|
|
</div>
|
2015-09-05 12:42:05 -04:00
|
|
|
|
2019-02-02 10:49:57 -05:00
|
|
|
</div>
|
2015-09-03 11:51:10 -04:00
|
|
|
|
2019-02-02 10:49:57 -05:00
|
|
|
@include('components.image-manager', ['imageType' => 'system'])
|
|
|
|
@include('components.entity-selector-popup', ['entityTypes' => 'page'])
|
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) {
|
2019-02-16 09:17:35 -05:00
|
|
|
const hexVal = '#' + this.color.colors.HEX;
|
|
|
|
const rgb = this.color.colors.RND.rgb;
|
|
|
|
const rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';
|
2017-08-27 07:59:56 -04:00
|
|
|
|
2016-03-06 05:52:10 -05:00
|
|
|
// Set textbox color to hex color code.
|
2019-02-16 09:17:35 -05:00
|
|
|
const isEmpty = $.trim($elm.val()).length === 0;
|
2016-03-06 05:52:10 -05:00
|
|
|
if (!isEmpty) $elm.val(hexVal);
|
|
|
|
$('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
|
2016-12-31 09:27:40 -05:00
|
|
|
|
2019-02-16 09:17:35 -05:00
|
|
|
const customStyles = document.getElementById('custom-styles');
|
|
|
|
const oldColor = customStyles.getAttribute('data-color');
|
|
|
|
const oldColorLight = customStyles.getAttribute('data-color-light');
|
2016-12-31 09:27:40 -05:00
|
|
|
|
|
|
|
customStyles.innerHTML = customStyles.innerHTML.split(oldColor).join(hexVal);
|
|
|
|
customStyles.innerHTML = customStyles.innerHTML.split(oldColorLight).join(rgbLightVal);
|
|
|
|
|
|
|
|
customStyles.setAttribute('data-color', hexVal);
|
|
|
|
customStyles.setAttribute('data-color-light', rgbLightVal);
|
2016-03-06 05:52:10 -05:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2016-03-03 13:01:14 -05:00
|
|
|
@stop
|