Started the migration of the setting views

This commit is contained in:
Dan Brown 2019-02-02 15:49:57 +00:00
parent 20988962fe
commit 880d4f35da
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
24 changed files with 666 additions and 529 deletions

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.86 4.118l-9.733 9.609-3.951-3.995-2.98 2.966 6.93 7.184L21.805 7.217z"/></svg>

After

Width:  |  Height:  |  Size: 151 B

View File

@ -3,15 +3,15 @@ class ToggleSwitch {
constructor(elem) { constructor(elem) {
this.elem = elem; this.elem = elem;
this.input = elem.querySelector('input'); this.input = elem.querySelector('input[type=hidden]');
this.checkbox = elem.querySelector('input[type=checkbox]');
this.elem.onclick = this.onClick.bind(this); this.checkbox.addEventListener('change', this.onClick.bind(this));
} }
onClick(event) { onClick(event) {
let checked = this.input.value !== 'true'; let checked = this.checkbox.checked;
this.input.value = checked ? 'true' : 'false'; this.input.value = checked ? 'true' : 'false';
checked ? this.elem.classList.add('active') : this.elem.classList.remove('active');
} }
} }

View File

@ -31,7 +31,8 @@ $button-border-radius: 2px;
font-size: $fs-m; font-size: $fs-m;
line-height: 1.4em; line-height: 1.4em;
padding: $-xs*1.3 $-m; padding: $-xs*1.3 $-m;
margin: $-xs $-xs $-xs 0; margin-top: $-xs;
margin-bottom: $-xs;
display: inline-block; display: inline-block;
border: none; border: none;
font-weight: 400; font-weight: 400;
@ -62,6 +63,10 @@ $button-border-radius: 2px;
} }
} }
.button + .button {
margin-left: $-s;
}
.button.outline { .button.outline {
background-color: transparent; background-color: transparent;
color: #888; color: #888;

View File

@ -139,64 +139,68 @@ input[type=date] {
} }
.toggle-switch { .toggle-switch {
display: inline-block;
background-color: #BBB;
width: 36px;
height: 14px;
border-radius: 7px;
position: relative;
transition: all ease-in-out 120ms;
cursor: pointer;
user-select: none; user-select: none;
&:after { display: inline-grid;
content: ''; grid-template-columns: (16px + $-s) 1fr;
display: block; align-items: center;
position: relative; margin: $-m 0;
.custom-checkbox {
width: 16px;
height: 16px;
border-radius: 2px;
display: inline-block;
border: 2px solid #999;
overflow: hidden;
fill: #888;
.svg-icon {
width: 100%;
height: 100%;
margin: 0;
bottom: auto;
top: -1.5px;
left: 0; left: 0;
margin-top: -3px; transition: transform ease-in-out 120ms;
width: 20px; transform: scale(0);
height: 20px; transform-origin: center center;
border-radius: 50%;
background-color: #fafafa;
border: 1px solid #CCC;
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
transition: all ease-in-out 120ms;
}
&.active {
background-color: rgba($positive, 0.4);
&:after {
left: 16px;
background-color: $positive;
border: darken($positive, 20%);
} }
} }
} input[type=checkbox] {
.toggle-switch-checkbox {
display: none; display: none;
} }
input:checked + .toggle-switch { input[type=checkbox]:checked + .custom-checkbox .svg-icon {
background-color: rgba($positive, 0.4); transform: scale(1);
&:after { }
left: 16px; .custom-checkbox:hover {
background-color: $positive; background-color: rgba(0, 0, 0, 0.05);
border: darken($positive, 20%);
} }
} }
.form-group { .form-group {
margin-bottom: $-s; margin-bottom: $-s;
textarea { }
display: block;
width: 100%; .setting-list > div {
min-height: 64px; border-bottom: 1px solid #DDD;
padding: $-xl 0;
&:last-child {
border-bottom: none;
} }
} }
.setting-list-label {
color: #444;
font-size: 1rem;
}
.setting-list-label + p.small {
margin-bottom: 0;
}
.simple-code-input { .simple-code-input {
background-color: #F8F8F8; background-color: #F8F8F8;
font-family: monospace; font-family: monospace;
font-size: 12px; font-size: 12px;
min-height: 100px; min-height: 100px;
display: block;
width: 100%;
} }
.form-group { .form-group {

View File

@ -60,6 +60,9 @@ body.flexbox {
&.auto-height { &.auto-height {
min-height: 0; min-height: 0;
} }
&.fill-width {
width: 100%;
}
} }
.tri-layout-container { .tri-layout-container {
@ -211,7 +214,6 @@ div[class^="col-"] img {
&.large-gap { &.large-gap {
grid-column-gap: $-xl; grid-column-gap: $-xl;
grid-row-gap: $-xl; grid-row-gap: $-xl;
justify-items: start;
} }
} }
@ -272,6 +274,12 @@ div[class^="col-"] img {
.grid.left-focus, .grid.right-focus { .grid.left-focus, .grid.right-focus {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.grid.right-focus.reverse-collapse > *:nth-child(2) {
order: 0;
}
.grid.right-focus.reverse-collapse > *:nth-child(1) {
order: 1;
}
} }
@include smaller-than($s) { @include smaller-than($s) {

View File

@ -396,3 +396,18 @@ ul.pagination {
padding: $-m 0; padding: $-m 0;
} }
.active-link-list {
a {
display: inline-block;
padding: $-s;
}
a:not(.active) {
color: #444;
fill: #444;
}
a:hover {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 3px;
text-decoration: none;
}
}

View File

@ -19,13 +19,13 @@ table {
table.table { table.table {
width: 100%; width: 100%;
tr { tr td, tr th {
border-bottom: 1px solid #DDD; border-bottom: 1px solid rgba(0, 0, 0, 0.05);
} }
th, td { th, td {
text-align: left; text-align: left;
border: none; border: none;
padding: $-xs $-xs; padding: $-s $-s;
vertical-align: middle; vertical-align: middle;
margin: 0; margin: 0;
} }
@ -44,6 +44,9 @@ table.table {
td.actions { td.actions {
overflow: visible; overflow: visible;
} }
a {
display: inline-block;
}
} }
table.no-style { table.no-style {

View File

@ -83,6 +83,10 @@ h5, h6 {
font-size: 2rem; font-size: 2rem;
} }
h2.list-heading {
font-size: 1.333rem;
}
/* /*
* Link styling * Link styling
*/ */

View File

@ -14,8 +14,8 @@ return [
// App Settings // App Settings
'app_settings' => 'App Settings', 'app_settings' => 'App Settings',
'app_name' => 'Application name', 'app_name' => 'Application name',
'app_name_desc' => 'This name is shown in the header and any emails.', 'app_name_desc' => 'This name is shown in the header and in any system-sent emails.',
'app_name_header' => 'Show Application name in header?', 'app_name_header' => 'Show name in header',
'app_public_viewing' => 'Allow public viewing?', 'app_public_viewing' => 'Allow public viewing?',
'app_secure_images' => 'Enable higher security image uploads?', 'app_secure_images' => 'Enable higher security image uploads?',
'app_secure_images_desc' => '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.', 'app_secure_images_desc' => '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.',

View File

@ -1,4 +1,6 @@
<div toggle-switch="{{$name}}" class="toggle-switch @if($value) active @endif"> <label toggle-switch="{{$name}}" class="toggle-switch">
<input type="hidden" name="{{$name}}" value="{{$value?'true':'false'}}"/> <input type="hidden" name="{{$name}}" value="{{$value?'true':'false'}}"/>
<div class="switch-handle"></div> <input type="checkbox" @if($value) checked="checked" @endif>
</div> <span class="custom-checkbox ">@icon('check')</span>
<span class="label">{{ $label ?? '' }}</span> {{-- TODO - remove default operataor backup --}}
</label>

View File

@ -8,6 +8,8 @@
@include('form/checkbox', ['name' => 'restricted', 'label' => trans('entities.permissions_enable')]) @include('form/checkbox', ['name' => 'restricted', 'label' => trans('entities.permissions_enable')])
</div> </div>
{{--TODO - Add global and role "Select All" options--}}
<table class="table"> <table class="table">
<tr> <tr>
<th>{{ trans('common.role') }}</th> <th>{{ trans('common.role') }}</th>

View File

@ -1,4 +1,4 @@
{{--TODO - Make custom--}}
<label> <label>
<input value="true" id="{{$name}}[{{$role->id}}][{{$action}}]" type="checkbox" name="{{$name}}[{{$role->id}}][{{$action}}]" <input value="true" id="{{$name}}[{{$role->id}}][{{$action}}]" type="checkbox" name="{{$name}}[{{$role->id}}][{{$action}}]"
@if(isset($model) && $model->hasRestriction($role->id, $action)) checked="checked" @endif> @if(isset($model) && $model->hasRestriction($role->id, $action)) checked="checked" @endif>

View File

@ -1,63 +1,108 @@
@extends('simple-layout') @extends('simple-layout')
@section('toolbar') {{--TODO - Reorder--}}
@include('settings/navbar', ['selected' => 'settings'])
@stop
@section('body') @section('body')
<div class="container small"> <div class="container small">
<div class="text-right text-muted container">
<div class="grid left-focus v-center">
<div class="py-m">
@include('settings/navbar', ['selected' => 'settings'])
</div>
<div class="text-right mb-l px-m">
<br> <br>
BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }} BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
</div> </div>
</div>
<div class="card"> <div class="card content-wrap">
<h3>@icon('settings') {{ trans('settings.app_settings') }}</h3> <h2 class="list-heading">{{ trans('settings.app_settings') }}</h2>
<div class="body">
<form action="{{ baseUrl("/settings") }}" method="POST"> <form action="{{ baseUrl("/settings") }}" method="POST">
{!! csrf_field() !!} {!! csrf_field() !!}
<div class="row">
<div class="col-md-6"> <div class="setting-list">
<div class="form-group">
<label for="setting-app-name">{{ trans('settings.app_name') }}</label> <div class="grid half large-gap">
<div>
<label for="setting-app-name" class="setting-list-label">{{ trans('settings.app_name') }}</label>
<p class="small">{{ trans('settings.app_name_desc') }}</p> <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"> <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'),
])
</div> </div>
<div class="form-group">
<label>{{ trans('settings.app_name_header') }}</label>
@include('components.toggle-switch', ['name' => 'setting-app-name-header', 'value' => setting('app-name-header')])
</div> </div>
<div class="form-group">
<label for="setting-app-public">{{ trans('settings.app_public_viewing') }}</label> <div class="grid half large-gap">
@include('components.toggle-switch', ['name' => 'setting-app-public', 'value' => setting('app-public')]) <div>
<label for="setting-app-public" class="setting-list-label">{{ trans('settings.app_public_viewing') }}</label>
{{--<p class="small">{{ trans('settings.app_name_desc') }}</p>--}}
</div> </div>
<div class="form-group"> <div>
<label>{{ trans('settings.app_secure_images') }}</label> @include('components.toggle-switch', [
'name' => 'setting-app-public',
'value' => setting('app-public'),
'label' => trans('settings.app_public_viewing'),
])
{{--TODO - Text --}}
</div>
</div>
<div class="grid half large-gap">
<div>
<label class="setting-list-label">{{ trans('settings.app_secure_images') }}</label>
<p class="small">{{ trans('settings.app_secure_images_desc') }}</p> <p class="small">{{ trans('settings.app_secure_images_desc') }}</p>
@include('components.toggle-switch', ['name' => 'setting-app-secure-images', 'value' => setting('app-secure-images')])
</div> </div>
<div class="form-group"> <div>
<label>{{ trans('settings.app_disable_comments') }}</label> @include('components.toggle-switch', [
'name' => 'setting-app-secure-images',
'value' => setting('app-secure-images'),
'label' => trans('settings.app_secure_images'),
])
{{--TODO - Text --}}
</div>
</div>
<div class="grid half large-gap">
<div>
<label class="setting-list-label">{{ trans('settings.app_disable_comments') }}</label>
<p class="small">{{ trans('settings.app_disable_comments_desc') }}</p> <p class="small">{{ trans('settings.app_disable_comments_desc') }}</p>
@include('components.toggle-switch', ['name' => 'setting-app-disable-comments', 'value' => setting('app-disable-comments')])
</div> </div>
<div class="form-group"> <div>
<label for="setting-app-editor">{{ trans('settings.app_editor') }}</label> @include('components.toggle-switch', [
'name' => 'setting-app-disable-comments',
'value' => setting('app-disable-comments'),
'label' => trans('settings.app_disable_comments'),
])
{{--TODO - Text --}}
</div>
</div>
<div class="grid half large-gap">
<div>
<label class="setting-list-label">{{ trans('settings.app_editor') }}</label>
<p class="small">{{ trans('settings.app_editor_desc') }}</p> <p class="small">{{ trans('settings.app_editor_desc') }}</p>
</div>
<div>
<select name="setting-app-editor" id="setting-app-editor"> <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') === 'wysiwyg') selected @endif value="wysiwyg">WYSIWYG</option>
<option @if(setting('app-editor') === 'markdown') selected @endif value="markdown">Markdown</option> <option @if(setting('app-editor') === 'markdown') selected @endif value="markdown">Markdown</option>
</select> </select>
{{--TODO - Text --}}
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="grid half large-gap">
<div class="form-group" id="logo-control"> <div>
<label for="setting-app-logo">{{ trans('settings.app_logo') }}</label> <label class="setting-list-label">{{ trans('settings.app_logo') }}</label>
<p class="small">{!! trans('settings.app_logo_desc') !!}</p> <p class="small">{{ trans('settings.app_logo_desc') }}</p>
</div>
<div>
@include('components.image-picker', [ @include('components.image-picker', [
'resizeHeight' => '43', 'resizeHeight' => '43',
'resizeWidth' => '200', 'resizeWidth' => '200',
@ -68,18 +113,26 @@
'imageClass' => 'logo-image', 'imageClass' => 'logo-image',
'currentId' => false 'currentId' => false
]) ])
</div> </div>
<div class="form-group" id="color-control"> </div>
<label for="setting-app-color">{{ trans('settings.app_primary_color') }}</label>
<div class="grid half large-gap">
<div>
<label class="setting-list-label">{{ trans('settings.app_primary_color') }}</label>
<p class="small">{!! trans('settings.app_primary_color_desc') !!}</p> <p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>
</div>
<div>
<input type="text" value="{{ setting('app-color') }}" name="setting-app-color" id="setting-app-color" placeholder="#0288D1"> <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"> <input type="hidden" value="{{ setting('app-color-light') }}" name="setting-app-color-light" id="setting-app-color-light">
</div> </div>
<div homepage-control class="form-group" id="homepage-control"> </div>
<label for="setting-app-homepage">{{ trans('settings.app_homepage') }}</label>
<p class="small">{{ trans('settings.app_homepage_desc') }}</p>
<div homepage-control id="homepage-control" class="grid half large-gap">
<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>
<select name="setting-app-homepage-type" id="setting-app-homepage-type"> <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') === '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') === 'books') selected @endif value="books">{{ trans('entities.books') }}</option>
@ -87,45 +140,56 @@
<option @if(setting('app-homepage-type') === 'page') selected @endif value="page">{{ trans('entities.pages_specific') }}</option> <option @if(setting('app-homepage-type') === 'page') selected @endif value="page">{{ trans('entities.pages_specific') }}</option>
</select> </select>
<br><br> <div page-picker-container style="display: none;" class="mt-m">
<div page-picker-container style="display: none;">
@include('components.page-picker', ['name' => 'setting-app-homepage', 'placeholder' => trans('settings.app_homepage_select'), 'value' => setting('app-homepage')]) @include('components.page-picker', ['name' => 'setting-app-homepage', 'placeholder' => trans('settings.app_homepage_select'), 'value' => setting('app-homepage')])
</div> </div>
</div> </div>
</div> </div>
<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> </div>
<div class="form-group">
<label for="setting-app-custom-head">{{ trans('settings.app_custom_html') }}</label>
<p class="small">{{ trans('settings.app_custom_html_desc') }}</p>
<textarea class="simple-code-input" name="setting-app-custom-head" id="setting-app-custom-head">{{ setting('app-custom-head', '') }}</textarea>
</div> </div>
<div class="form-group text-right"> <div class="form-group text-right">
<button type="submit" class="button pos">{{ trans('settings.settings_save') }}</button> <button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
</div> </div>
</form> </form>
</div> </div>
</div>
<p>&nbsp;</p>
<div class="card"> <div class="card content-wrap">
<h3>@icon('users-add') {{ trans('settings.reg_settings') }}</h3> <h2 class="list-heading">{{ trans('settings.reg_settings') }}</h2>
<div class="body">
<form action="{{ baseUrl("/settings") }}" method="POST"> <form action="{{ baseUrl("/settings") }}" method="POST">
{!! csrf_field() !!} {!! csrf_field() !!}
<div class="row"> <div class="setting-list">
<div class="col-md-6"> <div class="grid half large-gap">
<div class="form-group"> <div>
<label for="setting-registration-enabled">{{ trans('settings.reg_allow') }}</label> <label class="setting-list-label">{{ trans('settings.reg_allow') }}</label>
@include('components.toggle-switch', ['name' => 'setting-registration-enabled', 'value' => setting('registration-enabled')]) {{--<p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>--}}{{-- TODO--}}
</div> </div>
<div class="form-group"> <div>
<label for="setting-registration-role">{{ trans('settings.reg_default_role') }}</label> @include('components.toggle-switch', [
'name' => 'setting-registration-enabled',
'value' => setting('registration-enabled'),
'label' => trans('settings.reg_allow')
])
{{--TODO - label --}}
</div>
</div>
<div class="grid half large-gap">
<div>
<label for="setting-registration-role" class="setting-list-label">{{ trans('settings.reg_default_role') }}</label>
{{--<p class="small">{!! trans('settings.app_primary_color_desc') !!}</p>--}}{{-- TODO--}}
</div>
<div>
<select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif> <select id="setting-registration-role" name="setting-registration-role" @if($errors->has('setting-registration-role')) class="neg" @endif>
@foreach(\BookStack\Auth\Role::all() as $role) @foreach(\BookStack\Auth\Role::all() as $role)
<option value="{{$role->id}}" data-role-name="{{ $role->name }}" <option value="{{$role->id}}" data-role-name="{{ $role->name }}"
@ -136,37 +200,48 @@
@endforeach @endforeach
</select> </select>
</div> </div>
<div class="form-group"> </div>
<label for="setting-registration-confirmation">{{ trans('settings.reg_confirm_email') }}</label>
<div class="grid half large-gap">
<div>
<label class="setting-list-label">{{ trans('settings.reg_confirm_email') }}</label>
<p class="small">{{ trans('settings.reg_confirm_email_desc') }}</p> <p class="small">{{ trans('settings.reg_confirm_email_desc') }}</p>
@include('components.toggle-switch', ['name' => 'setting-registration-confirmation', 'value' => setting('registration-confirmation')]) </div>
<div>
@include('components.toggle-switch', [
'name' => 'setting-registration-confirmation',
'value' => setting('registration-confirmation'),
'label' => trans('settings.reg_confirm_email')
])
{{--TODO - label --}}
</div> </div>
</div> </div>
<div class="col-md-6">
<div class="form-group"> <div class="grid half large-gap">
<label for="setting-registration-restrict">{{ trans('settings.reg_confirm_restrict_domain') }}</label> <div>
<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> <p class="small">{!! trans('settings.reg_confirm_restrict_domain_desc') !!}</p>
</div>
<div>
<input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="{{ trans('settings.reg_confirm_restrict_domain_placeholder') }}" value="{{ setting('registration-restrict', '') }}"> <input type="text" id="setting-registration-restrict" name="setting-registration-restrict" placeholder="{{ trans('settings.reg_confirm_restrict_domain_placeholder') }}" value="{{ setting('registration-restrict', '') }}">
</div> </div>
</div> </div>
</div> </div>
<div class="form-group text-right"> <div class="form-group text-right">
<button type="submit" class="button pos">{{ trans('settings.settings_save') }}</button> <button type="submit" class="button primary">{{ trans('settings.settings_save') }}</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
@include('components.image-manager', ['imageType' => 'system'])
</div> @include('components.entity-selector-popup', ['entityTypes' => 'page'])
@include('components.image-manager', ['imageType' => 'system'])
@include('components.entity-selector-popup', ['entityTypes' => 'page'])
@stop @stop
@section('scripts') @section('scripts')
{{--TODO - Merge into JS--}}
<script src="{{ baseUrl("/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0") }}"></script> <script src="{{ baseUrl("/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0") }}"></script>
<script type="text/javascript"> <script type="text/javascript">
$('#setting-app-color').colorPicker({ $('#setting-app-color').colorPicker({

View File

@ -1,26 +1,26 @@
@extends('simple-layout') @extends('simple-layout')
@section('toolbar')
@include('settings/navbar', ['selected' => 'maintenance'])
@stop
@section('body') @section('body')
<div class="container small"> <div class="container small">
<div class="text-right text-muted container"> <div class="grid left-focus v-center">
<div class="py-m">
@include('settings/navbar', ['selected' => 'maintenance'])
</div>
<div class="text-right mb-l px-m">
<br> <br>
BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }} BookStack @if(strpos($version, 'v') !== 0) version @endif {{ $version }}
</div> </div>
</div>
<div class="card" id="image-cleanup"> <div id="image-cleanup" class="card content-wrap auto-height">
<h3>@icon('images') {{ trans('settings.maint_image_cleanup') }}</h3> <h2 class="list-heading">{{ trans('settings.maint_image_cleanup') }}</h2>
<div class="body"> <div class="grid half large-gap">
<div class="row"> <div>
<div class="col-sm-6">
<p class="small muted">{{ trans('settings.maint_image_cleanup_desc') }}</p> <p class="small muted">{{ trans('settings.maint_image_cleanup_desc') }}</p>
</div> </div>
<div class="col-sm-6"> <div>
<form method="POST" action="{{ baseUrl('/settings/maintenance/cleanup-images') }}"> <form method="POST" action="{{ baseUrl('/settings/maintenance/cleanup-images') }}">
{!! csrf_field() !!} {!! csrf_field() !!}
<input type="hidden" name="_method" value="DELETE"> <input type="hidden" name="_method" value="DELETE">
@ -43,7 +43,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
@stop @stop

View File

@ -1,13 +1,13 @@
<div class="col-md-12 setting-nav nav-tabs"> <div class="active-link-list">
@if($currentUser->can('settings-manage')) @if($currentUser->can('settings-manage'))
<a href="{{ baseUrl('/settings') }}" @if($selected == 'settings') class="selected text-button" @endif>@icon('settings'){{ trans('settings.settings') }}</a> <a href="{{ baseUrl('/settings') }}" @if($selected == 'settings') class="active" @endif>@icon('settings'){{ trans('settings.settings') }}</a>
<a href="{{ baseUrl('/settings/maintenance') }}" @if($selected == 'maintenance') class="selected text-button" @endif>@icon('spanner'){{ trans('settings.maint') }}</a> <a href="{{ baseUrl('/settings/maintenance') }}" @if($selected == 'maintenance') class="active" @endif>@icon('spanner'){{ trans('settings.maint') }}</a>
@endif @endif
@if($currentUser->can('users-manage')) @if($currentUser->can('users-manage'))
<a href="{{ baseUrl('/settings/users') }}" @if($selected == 'users') class="selected text-button" @endif>@icon('users'){{ trans('settings.users') }}</a> <a href="{{ baseUrl('/settings/users') }}" @if($selected == 'users') class="active" @endif>@icon('users'){{ trans('settings.users') }}</a>
@endif @endif
@if($currentUser->can('user-roles-manage')) @if($currentUser->can('user-roles-manage'))
<a href="{{ baseUrl('/settings/roles') }}" @if($selected == 'roles') class="selected text-button" @endif>@icon('lock-open'){{ trans('settings.roles') }}</a> <a href="{{ baseUrl('/settings/roles') }}" @if($selected == 'roles') class="active" @endif>@icon('lock-open'){{ trans('settings.roles') }}</a>
@endif @endif
</div> </div>

View File

@ -1,17 +1,16 @@
@extends('simple-layout') @extends('simple-layout')
@section('toolbar')
@include('settings/navbar', ['selected' => 'roles'])
@stop
@section('body') @section('body')
<form action="{{ baseUrl("/settings/roles/new") }}" method="POST">
<div class="container"> <div class="container">
<div class="row">
@include('settings/roles/form', ['title' => trans('settings.role_create'), 'icon' => 'plus']) <div class="py-m">
</div> @include('settings.navbar', ['selected' => 'roles'])
</div> </div>
<form action="{{ baseUrl("/settings/roles/new") }}" method="POST">
@include('settings.roles.form', ['title' => trans('settings.role_create')])
</form> </form>
</div>
@stop @stop

View File

@ -1,15 +1,17 @@
@extends('simple-layout') @extends('simple-layout')
@section('toolbar') {{--TODO - Looks strange--}}
@include('settings/navbar', ['selected' => 'roles'])
@stop
@section('body') @section('body')
<div class="container small"> <div class="container small">
<p>&nbsp;</p>
<div class="card"> <div class="py-m">
<h3>@icon('delete') {{ trans('settings.role_delete') }}</h3> @include('settings.navbar', ['selected' => 'roles'])
<div class="body"> </div>
<div class="card content-wrap auto-height">
<h1 class="list-heading"> {{ trans('settings.role_delete') }}</h1>
<p>{{ trans('settings.role_delete_confirm', ['roleName' => $role->display_name]) }}</p> <p>{{ trans('settings.role_delete_confirm', ['roleName' => $role->display_name]) }}</p>
<form action="{{ baseUrl("/settings/roles/delete/{$role->id}") }}" method="POST"> <form action="{{ baseUrl("/settings/roles/delete/{$role->id}") }}" method="POST">
@ -23,14 +25,16 @@
</div> </div>
@endif @endif
<p class="text-neg">{{ trans('settings.role_delete_sure') }}</p> <p class="text-neg">
<div class="form-group"> <strong>{{ trans('settings.role_delete_sure') }}</strong>
</p>
<div class="form-group text-right">
<a href="{{ baseUrl("/settings/roles/{$role->id}") }}" class="button outline">{{ trans('common.cancel') }}</a> <a href="{{ baseUrl("/settings/roles/{$role->id}") }}" class="button outline">{{ trans('common.cancel') }}</a>
<button type="submit" class="button neg">{{ trans('common.confirm') }}</button> <button type="submit" class="button primary">{{ trans('common.confirm') }}</button>
</div> </div>
</form> </form>
</div> </div>
</div>
</div> </div>
@stop @stop

View File

@ -1,17 +1,16 @@
@extends('simple-layout') @extends('simple-layout')
@section('toolbar')
@include('settings/navbar', ['selected' => 'roles'])
@stop
@section('body') @section('body')
<div class="container">
<div class="py-m">
@include('settings.navbar', ['selected' => 'roles'])
</div>
<form action="{{ baseUrl("/settings/roles/{$role->id}") }}" method="POST"> <form action="{{ baseUrl("/settings/roles/{$role->id}") }}" method="POST">
<input type="hidden" name="_method" value="PUT"> <input type="hidden" name="_method" value="PUT">
<div class="container">
<div class="row">
@include('settings/roles/form', ['model' => $role, 'title' => trans('settings.role_edit'), 'icon' => 'edit']) @include('settings/roles/form', ['model' => $role, 'title' => trans('settings.role_edit'), 'icon' => 'edit'])
</div>
</div>
</form> </form>
</div>
@stop @stop

View File

@ -1,12 +1,19 @@
{!! csrf_field() !!} {!! csrf_field() !!}
<div class="col-md-9"> {{--TODO - Add select-all shortcuts--}}
<div class="card">
<h3>@icon($icon) {{$title}}</h3> <div class="grid left-focus large-gap">
<div class="body">
<div class="row"> <div class="card content-wrap fill-width">
<div class="col-md-5"> <h1 class="list-heading">{{ $title }}</h1>
<h5>{{ trans('settings.role_details') }}</h5>
<div class="setting-list">
<div class="grid half">
<div>
<label class="setting-list-label">{{ trans('settings.role_details') }}</label>
</div>
<div>
<div class="form-group"> <div class="form-group">
<label for="name">{{ trans('settings.role_name') }}</label> <label for="name">{{ trans('settings.role_name') }}</label>
@include('form/text', ['name' => 'display_name']) @include('form/text', ['name' => 'display_name'])
@ -22,18 +29,24 @@
@include('form/text', ['name' => 'external_auth_id']) @include('form/text', ['name' => 'external_auth_id'])
</div> </div>
@endif @endif
</div>
</div>
<h5>{{ trans('settings.role_system') }}</h5> <div class="grid half">
<div>
<label class="setting-list-label">{{ trans('settings.role_system') }}</label>
</div>
<div>
<label>@include('settings/roles/checkbox', ['permission' => 'users-manage']) {{ trans('settings.role_manage_users') }}</label> <label>@include('settings/roles/checkbox', ['permission' => 'users-manage']) {{ trans('settings.role_manage_users') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'user-roles-manage']) {{ trans('settings.role_manage_roles') }}</label> <label>@include('settings/roles/checkbox', ['permission' => 'user-roles-manage']) {{ trans('settings.role_manage_roles') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'restrictions-manage-all']) {{ trans('settings.role_manage_entity_permissions') }}</label> <label>@include('settings/roles/checkbox', ['permission' => 'restrictions-manage-all']) {{ trans('settings.role_manage_entity_permissions') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'restrictions-manage-own']) {{ trans('settings.role_manage_own_entity_permissions') }}</label> <label>@include('settings/roles/checkbox', ['permission' => 'restrictions-manage-own']) {{ trans('settings.role_manage_own_entity_permissions') }}</label>
<label>@include('settings/roles/checkbox', ['permission' => 'settings-manage']) {{ trans('settings.role_manage_settings') }}</label> <label>@include('settings/roles/checkbox', ['permission' => 'settings-manage']) {{ trans('settings.role_manage_settings') }}</label>
</div> </div>
</div>
<div class="col-md-6"> <div>
<label class="setting-list-label">{{ trans('settings.role_asset') }}</label>
<h5>{{ trans('settings.role_asset') }}</h5>
<p>{{ trans('settings.role_asset_desc') }}</p> <p>{{ trans('settings.role_asset_desc') }}</p>
@if (isset($role) && $role->system_name === 'admin') @if (isset($role) && $role->system_name === 'admin')
@ -164,20 +177,20 @@
</table> </table>
</div> </div>
</div> </div>
<div class="form-group text-right"> <div class="form-group text-right">
<a href="{{ baseUrl("/settings/roles") }}" class="button outline">{{ trans('common.cancel') }}</a> <a href="{{ baseUrl("/settings/roles") }}" class="button outline">{{ trans('common.cancel') }}</a>
@if (isset($role) && $role->id) @if (isset($role) && $role->id)
<a href="{{ baseUrl("/settings/roles/delete/{$role->id}") }}" class="button neg">{{ trans('settings.role_delete') }}</a> <a href="{{ baseUrl("/settings/roles/delete/{$role->id}") }}" class="button outline">{{ trans('settings.role_delete') }}</a>
@endif @endif
<button type="submit" class="button pos">{{ trans('settings.role_save') }}</button> <button type="submit" class="button primary">{{ trans('settings.role_save') }}</button>
</div> </div>
</div> </div>
</div>
</div> <div>
<div class="col-md-3"> <div class="auto-height fill-width px-l">
<div class="card"> <h2 class="list-heading">{{ trans('settings.role_users') }}</h2>
<h3>@icon('users') {{ trans('settings.role_users') }}</h3>
<div class="body">
@if(isset($role) && count($role->users) > 0) @if(isset($role) && count($role->users) > 0)
<table class="list-table"> <table class="list-table">
@foreach($role->users as $user) @foreach($role->users as $user)

View File

@ -1,16 +1,23 @@
@extends('simple-layout') @extends('simple-layout')
@section('toolbar')
@include('settings/navbar', ['selected' => 'roles'])
@stop
@section('body') @section('body')
<div class="container small"> <div class="container small">
<p>&nbsp;</p>
<div class="card"> <div class="py-m">
<h3>@icon('lock-open') {{ trans('settings.role_user_roles') }}</h3> @include('settings/navbar', ['selected' => 'roles'])
<div class="body"> </div>
<div class="card content-wrap auto-height">
<div class="grid half v-center">
<h1 class="list-heading">{{ trans('settings.role_user_roles') }}</h1>
<div class="text-right">
<a href="{{ baseUrl("/settings/roles/new") }}" class="button outline">{{ trans('settings.role_create') }}</a>
</div>
</div>
<table class="table"> <table class="table">
<tr> <tr>
<th>{{ trans('settings.role_name') }}</th> <th>{{ trans('settings.role_name') }}</th>
@ -26,10 +33,7 @@
@endforeach @endforeach
</table> </table>
<div class="form-group">
<a href="{{ baseUrl("/settings/roles/new") }}" class="button pos">{{ trans('settings.role_create') }}</a>
</div>
</div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,7 @@
@extends('simple-layout') @extends('simple-layout')
{{--TODO--}}
@section('toolbar') @section('toolbar')
@include('settings/navbar', ['selected' => 'users']) @include('settings/navbar', ['selected' => 'users'])
@stop @stop

View File

@ -1,5 +1,7 @@
@extends('simple-layout') @extends('simple-layout')
{{--TODO--}}
@section('toolbar') @section('toolbar')
@include('settings/navbar', ['selected' => 'users']) @include('settings/navbar', ['selected' => 'users'])
@stop @stop

View File

@ -1,18 +1,19 @@
@extends('simple-layout') @extends('simple-layout')
@section('toolbar')
@include('settings/navbar', ['selected' => 'users'])
@stop
@section('body') @section('body')
<div class="container small"> <div class="container small">
<p>&nbsp;</p>
<div class="card"> <div class="py-m">
<h3>@icon('users') {{ trans('settings.users') }}</h3> @include('settings/navbar', ['selected' => 'users'])
<div class="body"> </div>
<div class="container">
<div class="row"> <div class="card content-wrap">
<div class="col-sm-4">
<div class="grid right-focus v-center">
<h1 class="list-heading">{{ trans('settings.users') }}</h1>
<div class="text-right">
<div class="block inline mr-s">
<form method="get" action="{{ baseUrl("/settings/users") }}"> <form method="get" action="{{ baseUrl("/settings/users") }}">
@foreach(collect($listDetails)->except('search') as $name => $val) @foreach(collect($listDetails)->except('search') as $name => $val)
<input type="hidden" name="{{ $name }}" value="{{ $val }}"> <input type="hidden" name="{{ $name }}" value="{{ $val }}">
@ -20,38 +21,31 @@
<input type="text" name="search" placeholder="{{ trans('settings.users_search') }}" @if($listDetails['search']) value="{{$listDetails['search']}}" @endif> <input type="text" name="search" placeholder="{{ trans('settings.users_search') }}" @if($listDetails['search']) value="{{$listDetails['search']}}" @endif>
</form> </form>
</div> </div>
<div class="col-sm-8 text-right">
@if(userCan('users-manage')) @if(userCan('users-manage'))
<a href="{{ baseUrl("/settings/users/create") }}" style="margin-top: 0;" class="pos button">{{ trans('settings.users_add_new') }}</a> <a href="{{ baseUrl("/settings/users/create") }}" style="margin-top: 0;" class="outline button">{{ trans('settings.users_add_new') }}</a>
@endif @endif
</div> </div>
</div> </div>
</div>
{{--TODO - Add last login--}}
<table class="table"> <table class="table">
<tr> <tr>
<th></th> <th></th>
<th><a href="{{ sortUrl('/settings/users', $listDetails, ['sort' => 'name']) }}">{{ trans('auth.name') }}</a></th> <th>
<th><a href="{{ sortUrl('/settings/users', $listDetails, ['sort' => 'email']) }}">{{ trans('auth.email') }}</a></th> <a href="{{ sortUrl('/settings/users', $listDetails, ['sort' => 'name']) }}">{{ trans('auth.name') }}</a>
/
<a href="{{ sortUrl('/settings/users', $listDetails, ['sort' => 'email']) }}">{{ trans('auth.email') }}</a>
</th>
<th>{{ trans('settings.role_user_roles') }}</th> <th>{{ trans('settings.role_user_roles') }}</th>
</tr> </tr>
@foreach($users as $user) @foreach($users as $user)
<tr> <tr>
<td style="line-height: 0;"><img class="avatar med" src="{{ $user->getAvatar(40)}}" alt="{{ $user->name }}"></td> <td class="text-center" style="line-height: 0;"><img class="avatar med" src="{{ $user->getAvatar(40)}}" alt="{{ $user->name }}"></td>
<td> <td>
@if(userCan('users-manage') || $currentUser->id == $user->id) @if(userCan('users-manage') || $currentUser->id == $user->id)
<a href="{{ baseUrl("/settings/users/{$user->id}") }}"> <a href="{{ baseUrl("/settings/users/{$user->id}") }}">
@endif @endif
{{ $user->name }} {{ $user->name }} <br> <span class="text-muted">{{ $user->email }}</span>
@if(userCan('users-manage') || $currentUser->id == $user->id)
</a>
@endif
</td>
<td>
@if(userCan('users-manage') || $currentUser->id == $user->id)
<a href="{{ baseUrl("/settings/users/{$user->id}") }}">
@endif
{{ $user->email }}
@if(userCan('users-manage') || $currentUser->id == $user->id) @if(userCan('users-manage') || $currentUser->id == $user->id)
</a> </a>
@endif @endif
@ -68,8 +62,6 @@
<div> <div>
{{ $users->links() }} {{ $users->links() }}
</div> </div>
</div>
</div> </div>
</div> </div>

View File

@ -1,85 +1,89 @@
@extends('sidebar-layout') @extends('simple-layout')
@section('toolbar') {{--TODO - Include links to search based on this user being the creator for each entity type--}}
<div class="col-sm-6 col-xs-1 faded"> {{--Linking either the "Created content" items or as "View All" links next to headers--}}
<div class="breadcrumbs"> {{--TODO - Add shelves?--}}
<a href="{{ $user->getProfileUrl() }}" class="text-button">@icon('user'){{ $user->name }}</a>
</div>
</div>
@stop
@section('sidebar')
<div class="card" id="recent-activity">
<h3>@icon('time') {{ trans('entities.recent_activity') }}</h3>
@include('partials/activity-list', ['activity' => $activity])
</div>
@stop
@section('body') @section('body')
<div class="container small"> <div class="container pt-xl">
<div class="padded-top large"></div> <div class="grid right-focus reverse-collapse">
<div class="row"> <div>
<div class="col-md-7"> <div id="recent-user-activity" class="mb-xl">
<div class="clearfix"> <h5>{{ trans('entities.recent_activity') }}</h5>
<div class="padded-right float left"> @include('partials/activity-list', ['activity' => $activity])
</div>
</div>
<div>
<div class="card content-wrap auto-height">
<div class="grid left-focus v-center">
<div>
<div class="mr-m float left">
<img class="avatar square huge" src="{{ $user->getAvatar(120) }}" alt="{{ $user->name }}"> <img class="avatar square huge" src="{{ $user->getAvatar(120) }}" alt="{{ $user->name }}">
</div> </div>
<div> <div>
<h3 style="margin-top: 0;">{{ $user->name }}</h3> <h4 class="mt-md">{{ $user->name }}</h4>
<p class="text-muted"> <p class="text-muted">
{{ trans('entities.profile_user_for_x', ['time' => $user->created_at->diffForHumans(null, true)]) }} {{ trans('entities.profile_user_for_x', ['time' => $user->created_at->diffForHumans(null, true)]) }}
</p> </p>
</div> </div>
</div> </div>
</div> <div id="content-counts">
<div class="col-md-5 text-bigger" id="content-counts">
<div class="text-muted">{{ trans('entities.profile_created_content') }}</div> <div class="text-muted">{{ trans('entities.profile_created_content') }}</div>
<a href="#recent-books"> <div class="icon-list">
<div class="text-book"> <a href="#recent-books" class="text-book icon-list-item">
@icon('book') {{ trans_choice('entities.x_books', $assetCounts['books']) }} <span class="icon">@icon('book')</span>
</div> <span>{{ trans_choice('entities.x_books', $assetCounts['books']) }}</span>
</a> </a>
<a href="#recent-chapters"> <a href="#recent-chapters" class="text-chapter icon-list-item">
<div class="text-chapter"> <span class="icon">@icon('chapter')</span>
@icon('chapter') {{ trans_choice('entities.x_chapters', $assetCounts['chapters']) }} <span>{{ trans_choice('entities.x_chapters', $assetCounts['chapters']) }}</span>
</div>
</a> </a>
<a href="#recent-pages"> <a href="#recent-pages" class="text-page icon-list-item">
<div class="text-page"> <span class="icon">@icon('page')</span>
@icon('page') {{ trans_choice('entities.x_pages', $assetCounts['pages']) }} <span>{{ trans_choice('entities.x_pages', $assetCounts['pages']) }}</span>
</div>
</a> </a>
</div> </div>
</div>
</div>
</div> </div>
<div class="card content-wrap auto-height book-contents">
<hr class="even"> <h2 id="recent-pages" class="list-heading">{{ trans('entities.recently_created_pages') }}</h2>
<h3 id="recent-pages">{{ trans('entities.recently_created_pages') }}</h3>
@if (count($recentlyCreated['pages']) > 0) @if (count($recentlyCreated['pages']) > 0)
@include('partials/entity-list', ['entities' => $recentlyCreated['pages']]) @include('partials/entity-list', ['entities' => $recentlyCreated['pages']])
@else @else
<p class="text-muted">{{ trans('entities.profile_not_created_pages', ['userName' => $user->name]) }}</p> <p class="text-muted">{{ trans('entities.profile_not_created_pages', ['userName' => $user->name]) }}</p>
@endif @endif
</div>
<hr class="even"> <div class="card content-wrap auto-height book-contents">
<h3 id="recent-chapters">{{ trans('entities.recently_created_chapters') }}</h3> <h2 id="recent-chapters" class="list-heading">{{ trans('entities.recently_created_chapters') }}</h2>
@if (count($recentlyCreated['chapters']) > 0) @if (count($recentlyCreated['chapters']) > 0)
@include('partials/entity-list', ['entities' => $recentlyCreated['chapters']]) @include('partials/entity-list', ['entities' => $recentlyCreated['chapters']])
@else @else
<p class="text-muted">{{ trans('entities.profile_not_created_chapters', ['userName' => $user->name]) }}</p> <p class="text-muted">{{ trans('entities.profile_not_created_chapters', ['userName' => $user->name]) }}</p>
@endif @endif
</div>
<hr class="even"> <div class="card content-wrap auto-height book-contents">
<h3 id="recent-books">{{ trans('entities.recently_created_books') }}</h3> <h2 id="recent-books" class="list-heading">{{ trans('entities.recently_created_books') }}</h2>
@if (count($recentlyCreated['books']) > 0) @if (count($recentlyCreated['books']) > 0)
@include('partials/entity-list', ['entities' => $recentlyCreated['books']]) @include('partials/entity-list', ['entities' => $recentlyCreated['books']])
@else @else
<p class="text-muted">{{ trans('entities.profile_not_created_books', ['userName' => $user->name]) }}</p> <p class="text-muted">{{ trans('entities.profile_not_created_books', ['userName' => $user->name]) }}</p>
@endif @endif
</div> </div>
</div>
</div>
</div>
@stop @stop