]> BookStack Code Mirror - bookstack/commitdiff
Updated auth pages to new design, Removed public layout
authorDan Brown <redacted>
Sun, 3 Feb 2019 17:34:15 +0000 (17:34 +0000)
committerDan Brown <redacted>
Sun, 3 Feb 2019 17:34:15 +0000 (17:34 +0000)
31 files changed:
app/Auth/Role.php
app/Http/Controllers/PermissionController.php
app/Http/Middleware/Authenticate.php
app/helpers.php
resources/assets/sass/_forms.scss
resources/assets/sass/_grid.scss
resources/assets/sass/_lists.scss
resources/assets/sass/_text.scss
resources/lang/en/settings.php
resources/views/auth/forms/login/ldap.blade.php
resources/views/auth/forms/login/standard.blade.php
resources/views/auth/login.blade.php
resources/views/auth/passwords/email.blade.php
resources/views/auth/passwords/reset.blade.php
resources/views/auth/register-confirm.blade.php
resources/views/auth/register.blade.php
resources/views/auth/user-unconfirmed.blade.php
resources/views/common/header.blade.php
resources/views/common/home.blade.php
resources/views/errors/503.blade.php
resources/views/public.blade.php [deleted file]
resources/views/settings/roles/checkbox.blade.php
resources/views/settings/roles/create.blade.php
resources/views/settings/roles/edit.blade.php
resources/views/settings/roles/form.blade.php
resources/views/users/create.blade.php
resources/views/users/edit.blade.php
resources/views/users/form.blade.php [new file with mode: 0644]
resources/views/users/forms/ldap.blade.php [deleted file]
resources/views/users/forms/standard.blade.php [deleted file]
resources/views/users/forms/system.blade.php [deleted file]

index c8bb47e4582076ef90769a03a7f72b8e1e605ca4..917d8aa26192c0388fac58fa5970267f3e25969c 100644 (file)
@@ -1,6 +1,7 @@
 <?php namespace BookStack\Auth;
 
 use BookStack\Auth\Permissions\JointPermission;
+use BookStack\Auth\Permissions\RolePermission;
 use BookStack\Model;
 
 class Role extends Model
@@ -13,7 +14,7 @@ class Role extends Model
      */
     public function users()
     {
-        return $this->belongsToMany(User::class);
+        return $this->belongsToMany(User::class)->orderBy('name', 'asc');
     }
 
     /**
@@ -30,7 +31,7 @@ class Role extends Model
      */
     public function permissions()
     {
-        return $this->belongsToMany(Permissions\RolePermission::class, 'permission_role', 'role_id', 'permission_id');
+        return $this->belongsToMany(RolePermission::class, 'permission_role', 'role_id', 'permission_id');
     }
 
     /**
@@ -51,18 +52,18 @@ class Role extends Model
 
     /**
      * Add a permission to this role.
-     * @param \BookStack\Auth\Permissions\RolePermission $permission
+     * @param RolePermission $permission
      */
-    public function attachPermission(Permissions\RolePermission $permission)
+    public function attachPermission(RolePermission $permission)
     {
         $this->permissions()->attach($permission->id);
     }
 
     /**
      * Detach a single permission from this role.
-     * @param \BookStack\Auth\Permissions\RolePermission $permission
+     * @param RolePermission $permission
      */
-    public function detachPermission(Permissions\RolePermission $permission)
+    public function detachPermission(RolePermission $permission)
     {
         $this->permissions()->detach($permission->id);
     }
index 9be343c9a76011a5bd5b7a872ad78b1e6a9a8d3c..9893d59935ff6d284d98d5e335e2b452089de15e 100644 (file)
@@ -26,7 +26,7 @@ class PermissionController extends Controller
     {
         $this->checkPermission('user-roles-manage');
         $roles = $this->permissionsRepo->getAllRoles();
-        return view('settings/roles/index', ['roles' => $roles]);
+        return view('settings.roles.index', ['roles' => $roles]);
     }
 
     /**
@@ -36,7 +36,7 @@ class PermissionController extends Controller
     public function createRole()
     {
         $this->checkPermission('user-roles-manage');
-        return view('settings/roles/create');
+        return view('settings.roles.create');
     }
 
     /**
@@ -70,7 +70,7 @@ class PermissionController extends Controller
         if ($role->hidden) {
             throw new PermissionsException(trans('errors.role_cannot_be_edited'));
         }
-        return view('settings/roles/edit', ['role' => $role]);
+        return view('settings.roles.edit', ['role' => $role]);
     }
 
     /**
@@ -106,7 +106,7 @@ class PermissionController extends Controller
         $roles = $this->permissionsRepo->getAllRolesExcept($role);
         $blankRole = $role->newInstance(['display_name' => trans('settings.role_delete_no_migration')]);
         $roles->prepend($blankRole);
-        return view('settings/roles/delete', ['role' => $role, 'roles' => $roles]);
+        return view('settings.roles.delete', ['role' => $role, 'roles' => $roles]);
     }
 
     /**
index c9b2726e8c4eca4f9148f7567a035433bf216879..1a33843675a97266095cd6c2cb96918369652c9d 100644 (file)
@@ -37,7 +37,7 @@ class Authenticate
             }
         }
 
-        if ($this->auth->guest() && !setting('app-public')) {
+        if (!hasAppAccess()) {
             if ($request->ajax()) {
                 return response('Unauthorized.', 401);
             } else {
index b0886d02b9762c27383e37f5b7989014607ed03c..e1395d816e987ee468c2af849478a04ebc0a907d 100644 (file)
@@ -41,11 +41,19 @@ function user()
  * Check if current user is a signed in user.
  * @return bool
  */
-function signedInUser()
+function signedInUser() : bool
 {
     return auth()->user() && !auth()->user()->isDefault();
 }
 
+/**
+ * Check if the current user has general access.
+ * @return bool
+ */
+function hasAppAccess() : bool {
+    return !auth()->guest() || setting('app-public');
+}
+
 /**
  * Check if the current user has a permission.
  * If an ownable element is passed in the jointPermissions are checked against
index 6634ac81bc6965bc3650b289ce4ed0c28d14c6b2..0b69c0d5b4a4f92dafc873e3b472a13e5aaaccaa 100644 (file)
@@ -176,8 +176,13 @@ input[type=date] {
     opacity: 0.8;
   }
 }
-.toggle-switch-list .toggle-switch {
-  margin: $-xs 0;
+.toggle-switch-list {
+  .toggle-switch {
+    margin: $-xs 0;
+  }
+  &.compact .toggle-switch {
+    margin: 1px 0;
+  }
 }
 
 .form-group {
@@ -201,7 +206,8 @@ input[type=date] {
 .setting-list-label + .grid {
   margin-top: $-m;
 }
-.setting-list .grid {
+
+.setting-list .grid, .stretch-inputs {
   input[type=text], input[type=email], input[type=password], select {
     width: 100%;
   }
@@ -329,13 +335,6 @@ div[editor-type="markdown"] .title-input.page-title input[type="text"] {
   }
 }
 
-#login-form label[for="remember"] {
-  margin: 0;
-}
-#login-form label.toggle-switch {
-  margin-left: $-xl;
-}
-
 .image-picker img {
   background-color: #BBB;
 }
index b3d4895a3269a15779de2ca7cae9967643eea655..31ad84e1e4c7b70ea55bbb69e4b050c5bb528ae6 100644 (file)
@@ -200,6 +200,9 @@ div[class^="col-"] img {
   &.small {
     max-width: 840px;
   }
+  &.very-small {
+    max-width: 480px;
+  }
   &.nopad {
     padding-left: 0;
     padding-right: 0;
index 3392d831cc0414e4820c2b41a5ed06cd530c5716..d121559628b913775854a9f8f744ec570f3b6b23 100644 (file)
   padding: $-s $-m;
 }
 
+.user-list-item {
+  display: inline-grid;
+  padding: $-s;
+  grid-template-columns: min-content 1fr;
+  grid-column-gap: $-m;
+  font-size: 0.9em;
+  align-items: center;
+  > div:first-child {
+    line-height: 0;
+  }
+}
+
 ul.pagination {
   display: inline-block;
   list-style: none;
index 972eafddd64fb369a0e32bc1d9f77ec6c9f61916..539ffef9925af3eca73fa05db862c4ad7fa05993 100644 (file)
@@ -149,11 +149,8 @@ em, i, .italic {
 }
 
 small, p.small, span.small, .text-small {
-  font-size: 0.85em;
+  font-size: 0.75rem;
   color: lighten($text-dark, 10%);
-  small, p.small, span.small, .text-small {
-    font-size: 1em;
-  }
 }
 
 sup, .superscript {
index eb0d8df0751fa9e3db9d19d4d0e508c4e24346e4..44ae0c613678a2d2ca82353ed2eaf3fad7705820 100755 (executable)
@@ -93,11 +93,13 @@ return [
     'users_search' => 'Search Users',
     'users_details' => 'User Details',
     'users_details_desc' => 'Set a display name and an email address for this user. The email address will be used for logging into the application.',
+    'users_details_desc_no_email' => 'Set a display name for this user so others can recognise them.',
     'users_role' => 'User Roles',
     'users_role_desc' => 'Select which roles this user will be assigned to. If a user is assigned to multiple roles the permissions from those roles will stack and they will receive all abilities of the assigned roles.',
     'users_password' => 'User Password',
     'users_password_desc' => 'Set a password used to log-in to the application. This must be at least 5 characters long.',
     'users_external_auth_id' => 'External Authentication ID',
+    'users_external_auth_id_desc' => 'This is the ID used to match this user when communicating with your LDAP system.',
     'users_password_warning' => 'Only fill the below if you would like to change your password.',
     'users_system_public' => 'This user represents any guest users that visit your instance. It cannot be used to log in but is assigned automatically.',
     'users_delete' => 'Delete User',
@@ -109,8 +111,9 @@ return [
     'users_edit_profile' => 'Edit Profile',
     'users_edit_success' => 'User successfully updated',
     'users_avatar' => 'User Avatar',
-    'users_avatar_desc' => 'This image should be approx 256px square.',
+    'users_avatar_desc' => 'Select an image to represent this user. This should be approx 256px square.',
     'users_preferred_language' => 'Preferred Language',
+    'users_preferred_language_desc' => 'This option will change the language used for the user-interface of the application. This will not affect any user-created content.',
     'users_social_accounts' => 'Social Accounts',
     'users_social_accounts_info' => 'Here you can connect your other accounts for quicker and easier login. Disconnecting an account here does not previously authorized access. Revoke access from your profile settings on the connected social account.',
     'users_social_connect' => 'Connect Account',
index b52b5f13e9148a497c79248f4e811885da5c7092..ecdda652027285604225e1d0c58e515950d7622e 100644 (file)
@@ -1,12 +1,12 @@
 <div class="form-group">
     <label for="username">{{ trans('auth.username') }}</label>
-    @include('form/text', ['name' => 'username', 'tabindex' => 1])
+    @include('form.text', ['name' => 'username', 'tabindex' => 1])
 </div>
 
 @if(session('request-email', false) === true)
     <div class="form-group">
         <label for="email">{{ trans('auth.email') }}</label>
-        @include('form/text', ['name' => 'email', 'tabindex' => 1])
+        @include('form.text', ['name' => 'email', 'tabindex' => 1])
         <span class="text-neg">
             {{ trans('auth.ldap_email_hint') }}
         </span>
@@ -15,5 +15,5 @@
 
 <div class="form-group">
     <label for="password">{{ trans('auth.password') }}</label>
-    @include('form/password', ['name' => 'password', 'tabindex' => 2])
+    @include('form.password', ['name' => 'password', 'tabindex' => 2])
 </div>
\ No newline at end of file
index 4ea1f35ba2b89c4ff8b34e8839cca16943feb16c..557ee833961d83b6e7cfcb93bd6a1ac68ad14704 100644 (file)
@@ -1,10 +1,10 @@
 <div class="form-group">
     <label for="email">{{ trans('auth.email') }}</label>
-    @include('form/text', ['name' => 'email', 'tabindex' => 1])
+    @include('form.text', ['name' => 'email', 'tabindex' => 1])
 </div>
 
 <div class="form-group">
     <label for="password">{{ trans('auth.password') }}</label>
-    @include('form/password', ['name' => 'password', 'tabindex' => 2])
-    <span class="block small"><a href="{{ baseUrl('/password/email') }}">{{ trans('auth.forgot_password') }}</a></span>
+    @include('form.password', ['name' => 'password', 'tabindex' => 2])
+    <span class="block small mt-s"><a href="{{ baseUrl('/password/email') }}">{{ trans('auth.forgot_password') }}</a></span>
 </div>
\ No newline at end of file
index f3847bb043a1f5312583f813dab049d4a807ed85..7ee710da52a084c6f496aa93d8876824204ddbe7 100644 (file)
@@ -1,44 +1,48 @@
-@extends('public')
-
-@section('header-buttons')
-    @if(setting('registration-enabled', false))
-        <a href="{{ baseUrl("/register") }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
-    @endif
-@stop
+@extends('simple-layout')
 
 @section('content')
 
-    <div class="text-center">
-        <div class="card center-box">
-            <h3>@icon('login') {{ title_case(trans('auth.log_in')) }}</h3>
+    <div class="container very-small">
 
-            <div class="body">
-                <form action="{{ baseUrl("/login") }}" method="POST" id="login-form">
-                    {!! csrf_field() !!}
+        <div class="my-l">&nbsp;</div>
 
-                    @include('auth/forms/login/' . $authMethod)
+        <div class="card content-wrap">
+            <h1 class="list-heading">{{ title_case(trans('auth.log_in')) }}</h1>
 
-                    <div class="form-group">
-                        <label for="remember" class="inline">{{ trans('auth.remember_me') }}</label>
-                        <input type="checkbox" id="remember" name="remember"  class="toggle-switch-checkbox">
-                        <label for="remember" class="toggle-switch"></label>
-                    </div>
+            <form action="{{ baseUrl("/login") }}" method="POST" id="login-form" class="mt-l">
+                {!! csrf_field() !!}
 
-                    <div class="from-group">
-                        <button class="button block pos" tabindex="3">@icon('login') {{ title_case(trans('auth.log_in')) }}</button>
+                <div class="stretch-inputs">
+                    @include('auth/forms/login/' . $authMethod)
+                </div>
+
+                <div class="grid half large-gap v-center">
+                    <div class="text-left ml-xxs">
+                        @include('components.custom-checkbox', [
+                            'name' => 'remember',
+                            'checked' => false,
+                            'value' => 'on',
+                            'label' => trans('auth.remember_me'),
+                        ])
                     </div>
-                </form>
+                    <div class="text-right">
+                        <button class="button primary" tabindex="3">{{ title_case(trans('auth.log_in')) }}</button>
+                    </div>
+                </div>
+
+            </form>
 
-                @if(count($socialDrivers) > 0)
-                    <hr class="margin-top">
-                    @foreach($socialDrivers as $driver => $name)
+            @if(count($socialDrivers) > 0)
+                <hr class="my-l">
+                @foreach($socialDrivers as $driver => $name)
+                    <div>
                         <a id="social-login-{{$driver}}" class="button block muted-light svg text-left" href="{{ baseUrl("/login/service/" . $driver) }}">
                             @icon('auth/' . $driver)
                             {{ trans('auth.log_in_with', ['socialDriver' => $name]) }}
                         </a>
-                    @endforeach
-                @endif
-            </div>
+                    </div>
+                @endforeach
+            @endif
         </div>
     </div>
 
index 38f5cc07a9d4b14d2f0ffc15f02250bf244cd413..6746904d46514d4d33f15269a0030e7e62f27a02 100644 (file)
@@ -1,37 +1,25 @@
-@extends('public')
-
-@section('header-buttons')
-    <a href="{{ baseUrl("/login") }}">@icon('login') {{ trans('auth.log_in') }}</a>
-    @if(setting('registration-enabled'))
-        <a href="{{ baseUrl("/register") }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
-    @endif
-@stop
+@extends('simple-layout')
 
 @section('content')
+    <div class="container very-small mt-xl">
+        <div class="card content-wrap auto-height">
+            <h1 class="list-heading">{{ trans('auth.reset_password') }}</h1>
 
+            <p class="muted small">{{ trans('auth.reset_password_send_instructions') }}</p>
 
-    <div class="text-center">
-        <div class="card center-box">
-            <h3>@icon('permission') {{ trans('auth.reset_password') }}</h3>
-
-            <div class="body">
-                <p class="muted small">{{ trans('auth.reset_password_send_instructions') }}</p>
+            <form action="{{ baseUrl("/password/email") }}" method="POST" class="stretch-inputs">
+                {!! csrf_field() !!}
 
-                <form action="{{ baseUrl("/password/email") }}" method="POST">
-                    {!! csrf_field() !!}
+                <div class="form-group">
+                    <label for="email">{{ trans('auth.email') }}</label>
+                    @include('form/text', ['name' => 'email'])
+                </div>
 
-                    <div class="form-group">
-                        <label for="email">{{ trans('auth.email') }}</label>
-                        @include('form/text', ['name' => 'email'])
-                    </div>
-
-                    <div class="from-group text-right">
-                        <button class="button primary">{{ trans('auth.reset_password_send_button') }}</button>
-                    </div>
-                </form>
-            </div>
+                <div class="from-group text-right mt-m">
+                    <button class="button primary">{{ trans('auth.reset_password_send_button') }}</button>
+                </div>
+            </form>
 
         </div>
     </div>
-
 @stop
\ No newline at end of file
index 0f66bd47360ce63ee106708ef78397cddd0b0015..fa6ad5b9a327b6cd0945709f27c31616a21913f8 100644 (file)
@@ -1,43 +1,34 @@
-@extends('public')
-
-@section('header-buttons')
-    <a href="{{ baseUrl("/login") }}">@icon('login') {{ trans('auth.log_in') }}</a>
-    @if(setting('registration-enabled'))
-        <a href="{{ baseUrl("/register") }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
-    @endif
-@stop
+@extends('simple-layout')
 
 @section('content')
 
-    <div class="text-center">
-        <div class="card center-box">
-            <h3>@icon('permission') {{ trans('auth.reset_password') }}</h3>
-
-            <div class="body">
-                <form action="{{ baseUrl("/password/reset") }}" method="POST">
-                    {!! csrf_field() !!}
-                    <input type="hidden" name="token" value="{{ $token }}">
-
-                    <div class="form-group">
-                        <label for="email">{{ trans('auth.email') }}</label>
-                        @include('form/text', ['name' => 'email'])
-                    </div>
-
-                    <div class="form-group">
-                        <label for="password">{{ trans('auth.password') }}</label>
-                        @include('form/password', ['name' => 'password'])
-                    </div>
-
-                    <div class="form-group">
-                        <label for="password_confirmation">{{ trans('auth.password_confirm') }}</label>
-                        @include('form/password', ['name' => 'password_confirmation'])
-                    </div>
-
-                    <div class="from-group text-right">
-                        <button class="button primary">{{ trans('auth.reset_password') }}</button>
-                    </div>
-                </form>
-            </div>
+    <div class="container very-small mt-xl">
+        <div class="card content-wrap auto-height">
+            <h1 class="list-heading">{{ trans('auth.reset_password') }}</h1>
+
+            <form action="{{ baseUrl("/password/reset") }}" method="POST" class="stretch-inputs">
+                {!! csrf_field() !!}
+                <input type="hidden" name="token" value="{{ $token }}">
+
+                <div class="form-group">
+                    <label for="email">{{ trans('auth.email') }}</label>
+                    @include('form.text', ['name' => 'email'])
+                </div>
+
+                <div class="form-group">
+                    <label for="password">{{ trans('auth.password') }}</label>
+                    @include('form.password', ['name' => 'password'])
+                </div>
+
+                <div class="form-group">
+                    <label for="password_confirmation">{{ trans('auth.password_confirm') }}</label>
+                    @include('form.password', ['name' => 'password_confirmation'])
+                </div>
+
+                <div class="from-group text-right mt-m">
+                    <button class="button primary">{{ trans('auth.reset_password') }}</button>
+                </div>
+            </form>
 
         </div>
     </div>
index 22d0f4acbd9732f429e6e97ebc49a1227a3778c2..8fbf8abbbd7beae0c6d70af0a87d3183c4a57492 100644 (file)
@@ -1,19 +1,11 @@
-@extends('public')
-
-@section('header-buttons')
-    @if(!$signedIn)
-        <a href="{{ baseUrl("/login") }}">@icon('login') {{ trans('auth.log_in') }}</a>
-    @endif
-@stop
+@extends('simple-layout')
 
 @section('content')
 
-    <div class="text-center">
-        <div class="card center-box">
-            <h3>@icon('users') {{ trans('auth.register_thanks') }}</h3>
-            <div class="body">
-                <p>{{ trans('auth.register_confirm', ['appName' => setting('app-name')]) }}</p>
-            </div>
+    <div class="container very-small mt-xl">
+        <div class="card content-wrap auto-height">
+            <h1 class="list-heading">{{ trans('auth.register_thanks') }}</h1>
+            <p>{{ trans('auth.register_confirm', ['appName' => setting('app-name')]) }}</p>
         </div>
     </div>
 
index 900b394e3bf3cc61e3eeff3de6e7ee61d4788ac6..c997bcc198bb1e63ccb2e5c24322f0861445eef3 100644 (file)
@@ -1,50 +1,54 @@
-@extends('public')
-
-@section('header-buttons')
-    <a href="{{ baseUrl("/login") }}">@icon('login') {{ trans('auth.log_in') }}</a>
-@stop
+@extends('simple-layout')
 
 @section('content')
+    <div class="container very-small">
 
-    <div class="text-center">
-        <div class="card center-box">
-            <h3>@icon('new-user')  {{ title_case(trans('auth.sign_up')) }}</h3>
-            <div class="body">
-                <form action="{{ baseUrl("/register") }}" method="POST">
-                    {!! csrf_field() !!}
+        <div class="my-l">&nbsp;</div>
 
-                    <div class="form-group">
-                        <label for="email">{{ trans('auth.name') }}</label>
-                        @include('form/text', ['name' => 'name'])
-                    </div>
+        <div class="card content-wrap">
+            <h1 class="list-heading">{{ title_case(trans('auth.sign_up')) }}</h1>
 
-                    <div class="form-group">
-                        <label for="email">{{ trans('auth.email') }}</label>
-                        @include('form/text', ['name' => 'email'])
-                    </div>
+            <form action="{{ baseUrl("/register") }}" method="POST" class="mt-l stretch-inputs">
+                {!! csrf_field() !!}
 
-                    <div class="form-group">
-                        <label for="password">{{ trans('auth.password') }}</label>
-                        @include('form/password', ['name' => 'password', 'placeholder' => trans('auth.password_hint')])
-                    </div>
+                <div class="form-group">
+                    <label for="email">{{ trans('auth.name') }}</label>
+                    @include('form/text', ['name' => 'name'])
+                </div>
+
+                <div class="form-group">
+                    <label for="email">{{ trans('auth.email') }}</label>
+                    @include('form/text', ['name' => 'email'])
+                </div>
+
+                <div class="form-group">
+                    <label for="password">{{ trans('auth.password') }}</label>
+                    @include('form/password', ['name' => 'password', 'placeholder' => trans('auth.password_hint')])
+                </div>
 
-                    <div class="from-group">
-                        <button class="button block pos">{{ trans('auth.create_account') }}</button>
+                <div class="grid half large-gap v-center mt-m">
+                    <div class="text-small">
+                        <a href="{{ baseUrl('/login') }}">Already have an account?</a>
                     </div>
-                </form>
+                    <div class="from-group text-right">
+                        <button class="button primary">{{ trans('auth.create_account') }}</button>
+                    </div>
+                </div>
+
+
+            </form>
 
-                @if(count($socialDrivers) > 0)
-                    <hr class="margin-top">
-                    @foreach($socialDrivers as $driver => $name)
+            @if(count($socialDrivers) > 0)
+                <hr class="my-l">
+                @foreach($socialDrivers as $driver => $name)
+                    <div>
                         <a id="social-register-{{$driver}}" class="button block muted-light svg text-left" href="{{ baseUrl("/register/service/" . $driver) }}">
                             @icon('auth/' . $driver)
                             {{ trans('auth.sign_up_with', ['socialDriver' => $name]) }}
                         </a>
-                    @endforeach
-                @endif
-            </div>
+                    </div>
+                @endforeach
+            @endif
         </div>
     </div>
-
-
 @stop
index b02d45d22e97f24c011e7ac891501cebb8c96d54..536397eaf06cfbf9daac2c585d2458ac408b4e07 100644 (file)
@@ -1,34 +1,34 @@
-@extends('public')
+@extends('simple-layout')
 
 @section('content')
 
-    <div class="container small">
-        <p>&nbsp;</p>
-        <div class="card">
-            <h3>@icon('users') {{ trans('auth.email_not_confirmed') }}</h3>
-            <div class="body">
-                <p class="text-muted">{{ trans('auth.email_not_confirmed_text') }}<br>
-                    {{ trans('auth.email_not_confirmed_click_link') }} <br>
-                    {{ trans('auth.email_not_confirmed_resend') }}
-                </p>
-                <hr>
-                <form action="{{ baseUrl("/register/confirm/resend") }}" method="POST">
-                    {!! csrf_field() !!}
-                    <div class="form-group">
-                        <label for="email">{{ trans('auth.email') }}</label>
-                        @if(auth()->check())
-                            @include('form/text', ['name' => 'email', 'model' => auth()->user()])
-                        @else
-                            @include('form/text', ['name' => 'email'])
-                        @endif
-                    </div>
-                    <div class="form-group">
-                        <button type="submit" class="button pos">{{ trans('auth.email_not_confirmed_resend_button') }}</button>
-                    </div>
-                </form>
-            </div>
-        </div>
+    <div class="container very-small mt-xl">
+        <div class="card content-wrap auto-height">
+            <h1 class="list-heading">{{ trans('auth.email_not_confirmed') }}</h1>
+
+            <p>{{ trans('auth.email_not_confirmed_text') }}<br>
+                {{ trans('auth.email_not_confirmed_click_link') }}
+            </p>
+            <p>
+                {{ trans('auth.email_not_confirmed_resend') }}
+            </p>
 
+            <form action="{{ baseUrl("/register/confirm/resend") }}" method="POST" class="stretch-inputs">
+                {!! csrf_field() !!}
+                <div class="form-group">
+                    <label for="email">{{ trans('auth.email') }}</label>
+                    @if(auth()->check())
+                        @include('form/text', ['name' => 'email', 'model' => auth()->user()])
+                    @else
+                        @include('form/text', ['name' => 'email'])
+                    @endif
+                </div>
+                <div class="form-group text-right mt-m">
+                    <button type="submit" class="button primary">{{ trans('auth.email_not_confirmed_resend_button') }}</button>
+                </div>
+            </form>
+
+        </div>
     </div>
 
 @stop
index 67aa6759989c0c41e4adbd073204a3e7a263d7f0..75e4a3be016ac262a023cbd3441791c35d2750d8 100644 (file)
@@ -1,5 +1,6 @@
 <header id="header" header-mobile-toggle>
     <div class="grid break-l mx-l">
+
         <div>
             <a href="{{ baseUrl('/') }}" class="logo">
                 @if(setting('app-logo', '') !== 'none')
             </a>
             <div class="mobile-menu-toggle hide-over-l">@icon('more')</div>
         </div>
+
         <div class="header-search hide-under-l">
+            @if (hasAppAccess())
             <form action="{{ baseUrl('/search') }}" method="GET" class="search-box">
                 <button id="header-search-box-button" type="submit">@icon('search') </button>
                 <input id="header-search-box-input" type="text" name="term" tabindex="2" placeholder="{{ trans('common.search') }}" value="{{ isset($searchTerm) ? $searchTerm : '' }}">
             </form>
+            @endif
         </div>
+
         <div class="text-right">
             <div class="header-links">
                 <div class="links text-center">
-                    <a class="hide-over-l" href="{{ baseUrl('/search') }}">@icon('search'){{ trans('common.search') }}</a>
-                    @if(userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
-                        <a href="{{ baseUrl('/shelves') }}">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
-                    @endif
-                    <a href="{{ baseUrl('/books') }}">@icon('book'){{ trans('entities.books') }}</a>
-                    @if(signedInUser() && userCan('settings-manage'))
-                        <a href="{{ baseUrl('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
-                    @endif
-                    @if(signedInUser() && userCan('users-manage') && !userCan('settings-manage'))
-                        <a href="{{ baseUrl('/settings/users') }}">@icon('users'){{ trans('settings.users') }}</a>
+                    @if (hasAppAccess())
+                        <a class="hide-over-l" href="{{ baseUrl('/search') }}">@icon('search'){{ trans('common.search') }}</a>
+                        @if(userCan('bookshelf-view-all') || userCan('bookshelf-view-own'))
+                            <a href="{{ baseUrl('/shelves') }}">@icon('bookshelf'){{ trans('entities.shelves') }}</a>
+                        @endif
+                        <a href="{{ baseUrl('/books') }}">@icon('book'){{ trans('entities.books') }}</a>
+                        @if(signedInUser() && userCan('settings-manage'))
+                            <a href="{{ baseUrl('/settings') }}">@icon('settings'){{ trans('settings.settings') }}</a>
+                        @endif
+                        @if(signedInUser() && userCan('users-manage') && !userCan('settings-manage'))
+                            <a href="{{ baseUrl('/settings/users') }}">@icon('users'){{ trans('settings.users') }}</a>
+                        @endif
                     @endif
+
                     @if(!signedInUser())
                         @if(setting('registration-enabled', false))
                             <a href="{{ baseUrl("/register") }}">@icon('new-user') {{ trans('auth.sign_up') }}</a>
@@ -60,5 +68,6 @@
                 @endif
             </div>
         </div>
+
     </div>
 </header>
\ No newline at end of file
index 89583e97a84efe9470c8839a3d954c8e2ac29419..bc7778fe57c428e8f7bac68531725db8c88dbe66 100644 (file)
@@ -7,7 +7,7 @@
         <a expand-toggle=".entity-list.compact .entity-item-snippet" class="text-muted">@icon('expand-text'){{ trans('common.toggle_details') }}</a>
     </div>
 
-    <div class="grid contained thirds space-xl break-m" id="home-default">
+    <div class="grid contained third large-gap" id="home-default">
         <div>
             @if(count($draftPages) > 0)
                 <div id="recent-drafts" class="card mb-xl">
index f58856ced4d0f052129acfc8e2245574cb5d6557..29364606b97d24f58cc977d7adc012fd6bb3a788 100644 (file)
@@ -1,13 +1,11 @@
-@extends('public')
+@extends('simple-layout')
 
 @section('content')
 
-    <div class="container small">
-        <div class="card">
-            <div class="body">
-                <h4 class="text-muted">@icon('danger') {{ trans('errors.app_down', ['appName' => setting('app-name')]) }}</h4>
-                <p>{{ trans('errors.back_soon') }}</p>
-            </div>
+    <div class="container small mt-xl">
+        <div class="card content-wrap auto-height">
+            <h1 class="list-heading">{{ trans('errors.app_down', ['appName' => setting('app-name')]) }}</h1>
+            <p>{{ trans('errors.back_soon') }}</p>
         </div>
     </div>
 
diff --git a/resources/views/public.blade.php b/resources/views/public.blade.php
deleted file mode 100644 (file)
index 54918b1..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <title>{{ setting('app-name') }}</title>
-
-    <!-- Meta -->
-    <meta name="viewport" content="width=device-width">
-    <meta name="token" content="{{ csrf_token() }}">
-    <meta name="base-url" content="{{ baseUrl('/') }}">
-    <meta charset="utf-8">
-
-    <!-- Styles and Fonts -->
-    <link rel="stylesheet" href="{{ versioned_asset('dist/styles.css') }}">
-    <link rel="stylesheet" media="print" href="{{ versioned_asset('dist/print-styles.css') }}">
-
-    <!-- Scripts -->
-    @include('partials/custom-styles')
-
-    <!-- Custom user content -->
-    @if(setting('app-custom-head'))
-        {!! setting('app-custom-head') !!}
-    @endif
-</head>
-<body class="@yield('body-class')">
-
-@include('partials.notifications')
-
-<header id="header">
-    <div class="container fluid">
-        <div class="row">
-            <div class="col-sm-6">
-
-                <a href="{{ baseUrl('/') }}" class="logo">
-                    @if(setting('app-logo', '') !== 'none')
-                        <img class="logo-image" src="{{ setting('app-logo', '') === '' ? baseUrl('/logo.png') : baseUrl(setting('app-logo', '')) }}" alt="Logo">
-                    @endif
-                    @if (setting('app-name-header'))
-                        <span class="logo-text">{{ setting('app-name') }}</span>
-                    @endif
-                </a>
-            </div>
-            <div class="col-sm-6">
-                <div class="float right">
-                    <div class="links text-center">
-                        @yield('header-buttons')
-                    </div>
-                    @if(isset($signedIn) && $signedIn)
-                        @include('partials._header-dropdown', ['currentUser' => $currentUser])
-                    @endif
-                </div>
-            </div>
-        </div>
-    </div>
-</header>
-
-<section class="container">
-    @yield('content')
-</section>
-
-<script src="{{ versioned_asset('dist/app.js') }}"></script>
-</body>
-</html>
index 4dfba1f0b5f10eedfbb2fc95f8cec6280c5b5bfa..98201da8fc7d82af4ad69c867f159531530c2647 100644 (file)
@@ -1,3 +1,7 @@
-<input type="checkbox" name="permissions[{{ $permission }}]"
-       @if(old('permissions'.$permission, false)|| (!old('display_name', false) && (isset($role) && $role->hasPermission($permission)))) checked="checked" @endif
-       value="true">
\ No newline at end of file
+
+@include('components.custom-checkbox', [
+       'name' => 'permissions[' . $permission . ']',
+       'value' => 'true',
+       'checked' => old('permissions'.$permission, false)|| (!old('display_name', false) && (isset($role) && $role->hasPermission($permission))),
+       'label' => $label
+])
\ No newline at end of file
index 0c7ec97399bff562d14108392d07761b07fccb8b..80a6fc3820d1bffb5c671652d02e0e56f409d391 100644 (file)
@@ -2,7 +2,7 @@
 
 @section('body')
 
-    <div class="container">
+    <div class="container small">
 
         <div class="py-m">
             @include('settings.navbar', ['selected' => 'roles'])
index a600580f6e630b85fd68d44707eb76444bc4bf1d..f45458d9b1979c1591b71e518aba0e3eed6d7735 100644 (file)
@@ -2,7 +2,7 @@
 
 @section('body')
 
-    <div class="container">
+    <div class="container small">
         <div class="py-m">
             @include('settings.navbar', ['selected' => 'roles'])
         </div>
index ce71a2790730b03c2b7a421a3f75f947b4c264ae..5ea6d59a2125babbcd8f2b19a2ed2b57b2bb3400 100644 (file)
 
 {{--TODO - Add select-all shortcuts--}}
 
-<div class="grid left-focus large-gap">
+<div class="card content-wrap">
+    <h1 class="list-heading">{{ $title }}</h1>
 
-    <div class="card content-wrap fill-width">
-        <h1 class="list-heading">{{ $title }}</h1>
+    <div class="setting-list">
 
-        <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">
-                        <label for="name">{{ trans('settings.role_name') }}</label>
-                        @include('form/text', ['name' => 'display_name'])
-                    </div>
-                    <div class="form-group">
-                        <label for="name">{{ trans('settings.role_desc') }}</label>
-                        @include('form/text', ['name' => 'description'])
-                    </div>
-
-                    @if(config('auth.method') === 'ldap')
-                        <div class="form-group">
-                            <label for="name">{{ trans('settings.role_external_auth_id') }}</label>
-                            @include('form/text', ['name' => 'external_auth_id'])
-                        </div>
-                    @endif
-                </div>
+        <div class="grid half">
+            <div>
+                <label class="setting-list-label">{{ trans('settings.role_details') }}</label>
             </div>
-
-            <div class="grid half">
-                <div>
-                    <label class="setting-list-label">{{ trans('settings.role_system') }}</label>
+            <div>
+                <div class="form-group">
+                    <label for="name">{{ trans('settings.role_name') }}</label>
+                    @include('form.text', ['name' => 'display_name'])
                 </div>
-                <div>
-                    <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' => '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' => 'settings-manage']) {{ trans('settings.role_manage_settings') }}</label>
+                <div class="form-group">
+                    <label for="name">{{ trans('settings.role_desc') }}</label>
+                    @include('form.text', ['name' => 'description'])
                 </div>
-            </div>
 
-            <div>
-                <label class="setting-list-label">{{ trans('settings.role_asset') }}</label>
-                <p>{{ trans('settings.role_asset_desc') }}</p>
-
-                @if (isset($role) && $role->system_name === 'admin')
-                    <p>{{ trans('settings.role_asset_admins') }}</p>
+                @if(config('auth.method') === 'ldap')
+                    <div class="form-group">
+                        <label for="name">{{ trans('settings.role_external_auth_id') }}</label>
+                        @include('form.text', ['name' => 'external_auth_id'])
+                    </div>
                 @endif
+            </div>
+        </div>
 
-                <table class="table">
-                    <tr>
-                        <th width="20%"></th>
-                        <th width="20%">{{ trans('common.create') }}</th>
-                        <th width="20%">{{ trans('common.view') }}</th>
-                        <th width="20%">{{ trans('common.edit') }}</th>
-                        <th width="20%">{{ trans('common.delete') }}</th>
-                    </tr>
-                    <tr>
-                        <td>{{ trans('entities.shelves_long') }}</td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'bookshelf-create-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'bookshelf-view-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'bookshelf-view-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'bookshelf-update-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'bookshelf-update-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'bookshelf-delete-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'bookshelf-delete-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>{{ trans('entities.books') }}</td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'book-create-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'book-view-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'book-view-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'book-update-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'book-update-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'book-delete-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'book-delete-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>{{ trans('entities.chapters') }}</td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'chapter-create-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'chapter-create-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'chapter-view-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'chapter-view-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'chapter-update-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'chapter-update-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'chapter-delete-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'chapter-delete-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>{{ trans('entities.pages') }}</td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'page-create-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'page-create-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'page-view-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'page-view-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'page-update-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'page-update-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'page-delete-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'page-delete-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>{{ trans('entities.images') }}</td>
-                        <td>@include('settings/roles/checkbox', ['permission' => 'image-create-all'])</td>
-                        <td style="line-height:1.2;"><small class="faded">{{ trans('settings.role_controlled_by_asset') }}</small></td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'image-update-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'image-update-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'image-delete-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'image-delete-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>{{ trans('entities.attachments') }}</td>
-                        <td>@include('settings/roles/checkbox', ['permission' => 'attachment-create-all'])</td>
-                        <td style="line-height:1.2;"><small class="faded">{{ trans('settings.role_controlled_by_asset') }}</small></td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'attachment-update-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'attachment-update-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'attachment-delete-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'attachment-delete-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td>{{ trans('entities.comments') }}</td>
-                        <td>@include('settings/roles/checkbox', ['permission' => 'comment-create-all'])</td>
-                        <td style="line-height:1.2;"><small class="faded">{{ trans('settings.role_controlled_by_asset') }}</small></td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'comment-update-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'comment-update-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                        <td>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'comment-delete-own']) {{ trans('settings.role_own') }}</label>
-                            <label>@include('settings/roles/checkbox', ['permission' => 'comment-delete-all']) {{ trans('settings.role_all') }}</label>
-                        </td>
-                    </tr>
-                </table>
+        <div class="grid half">
+            <div>
+                <label class="setting-list-label">{{ trans('settings.role_system') }}</label>
+            </div>
+            <div class="toggle-switch-list">
+                <div>@include('settings.roles.checkbox', ['permission' => 'users-manage', 'label' => trans('settings.role_manage_users')])</div>
+                <div>@include('settings.roles.checkbox', ['permission' => 'user-roles-manage', 'label' => trans('settings.role_manage_roles')])</div>
+                <div>@include('settings.roles.checkbox', ['permission' => 'restrictions-manage-all', 'label' => trans('settings.role_manage_entity_permissions')])</div>
+                <div>@include('settings.roles.checkbox', ['permission' => 'restrictions-manage-own', 'label' => trans('settings.role_manage_own_entity_permissions')])</div>
+                <div>@include('settings.roles.checkbox', ['permission' => 'settings-manage', 'label' => trans('settings.role_manage_settings')])</div>
             </div>
         </div>
 
-        <div class="form-group text-right">
-            <a href="{{ baseUrl("/settings/roles") }}" class="button outline">{{ trans('common.cancel') }}</a>
-            @if (isset($role) && $role->id)
-                <a href="{{ baseUrl("/settings/roles/delete/{$role->id}") }}" class="button outline">{{ trans('settings.role_delete') }}</a>
+        <div>
+            <label class="setting-list-label">{{ trans('settings.role_asset') }}</label>
+            <p>{{ trans('settings.role_asset_desc') }}</p>
+
+            @if (isset($role) && $role->system_name === 'admin')
+                <p class="text-secondary">{{ trans('settings.role_asset_admins') }}</p>
             @endif
-            <button type="submit" class="button primary">{{ trans('settings.role_save') }}</button>
+
+            <table class="table toggle-switch-list compact">
+                <tr>
+                    <th width="20%"></th>
+                    <th width="20%">{{ trans('common.create') }}</th>
+                    <th width="20%">{{ trans('common.view') }}</th>
+                    <th width="20%">{{ trans('common.edit') }}</th>
+                    <th width="20%">{{ trans('common.delete') }}</th>
+                </tr>
+                <tr>
+                    <td>{{ trans('entities.shelves_long') }}</td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'bookshelf-create-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'bookshelf-view-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'bookshelf-view-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'bookshelf-update-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'bookshelf-update-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'bookshelf-delete-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'bookshelf-delete-all', 'label' => trans('settings.role_all')])
+                    </td>
+                </tr>
+                <tr>
+                    <td>{{ trans('entities.books') }}</td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'book-create-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'book-view-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'book-view-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'book-update-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'book-update-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'book-delete-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'book-delete-all', 'label' => trans('settings.role_all')])
+                    </td>
+                </tr>
+                <tr>
+                    <td>{{ trans('entities.chapters') }}</td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'chapter-create-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'chapter-create-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'chapter-view-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'chapter-view-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'chapter-update-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'chapter-update-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'chapter-delete-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'chapter-delete-all', 'label' => trans('settings.role_all')])
+                    </td>
+                </tr>
+                <tr>
+                    <td>{{ trans('entities.pages') }}</td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'page-create-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'page-create-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'page-view-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'page-view-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'page-update-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'page-update-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'page-delete-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'page-delete-all', 'label' => trans('settings.role_all')])
+                    </td>
+                </tr>
+                <tr>
+                    <td>{{ trans('entities.images') }}</td>
+                    <td>@include('settings.roles.checkbox', ['permission' => 'image-create-all', 'label' => ''])</td>
+                    <td style="line-height:1.2;"><small class="faded">{{ trans('settings.role_controlled_by_asset') }}</small></td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'image-update-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'image-update-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'image-delete-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'image-delete-all', 'label' => trans('settings.role_all')])
+                    </td>
+                </tr>
+                <tr>
+                    <td>{{ trans('entities.attachments') }}</td>
+                    <td>@include('settings.roles.checkbox', ['permission' => 'attachment-create-all', 'label' => ''])</td>
+                    <td style="line-height:1.2;"><small class="faded">{{ trans('settings.role_controlled_by_asset') }}</small></td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'attachment-update-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'attachment-update-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'attachment-delete-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'attachment-delete-all', 'label' => trans('settings.role_all')])
+                    </td>
+                </tr>
+                <tr>
+                    <td>{{ trans('entities.comments') }}</td>
+                    <td>@include('settings.roles.checkbox', ['permission' => 'comment-create-all', 'label' => ''])</td>
+                    <td style="line-height:1.2;"><small class="faded">{{ trans('settings.role_controlled_by_asset') }}</small></td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'comment-update-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'comment-update-all', 'label' => trans('settings.role_all')])
+                    </td>
+                    <td>
+                        @include('settings.roles.checkbox', ['permission' => 'comment-delete-own', 'label' => trans('settings.role_own')])
+                        <br>
+                        @include('settings.roles.checkbox', ['permission' => 'comment-delete-all', 'label' => trans('settings.role_all')])
+                    </td>
+                </tr>
+            </table>
         </div>
+    </div>
 
+    <div class="form-group text-right">
+        <a href="{{ baseUrl("/settings/roles") }}" class="button outline">{{ trans('common.cancel') }}</a>
+        @if (isset($role) && $role->id)
+            <a href="{{ baseUrl("/settings.roles.delete/{$role->id}") }}" class="button outline">{{ trans('settings.role_delete') }}</a>
+        @endif
+        <button type="submit" class="button primary">{{ trans('settings.role_save') }}</button>
     </div>
 
-    <div>
-        <div class="auto-height fill-width px-l">
-            <h2 class="list-heading">{{ trans('settings.role_users') }}</h2>
-            @if(isset($role) && count($role->users) > 0)
-                <table class="list-table">
-                    @foreach($role->users as $user)
-                        <tr>
-                            <td style="line-height: 0;"><img class="avatar small" src="{{ $user->getAvatar(40) }}" alt="{{ $user->name }}"></td>
-                            <td>
-                                @if(userCan('users-manage') || $currentUser->id == $user->id)
-                                    <a href="{{ baseUrl("/settings/users/{$user->id}") }}">
-                                        @endif
-                                        {{ $user->name }}
-                                        @if(userCan('users-manage') || $currentUser->id == $user->id)
-                                    </a>
+</div>
+
+<div class="card content-wrap auto-height">
+    <h2 class="list-heading">{{ trans('settings.role_users') }}</h2>
+    @if(isset($role) && count($role->users) > 0)
+        <div class="grid third">
+            @foreach($role->users as $user)
+                <div class="user-list-item">
+                    <div>
+                        <img class="avatar small" src="{{ $user->getAvatar(40) }}" alt="{{ $user->name }}">
+                    </div>
+                    <div>
+                        @if(userCan('users-manage') || $currentUser->id == $user->id)
+                            <a href="{{ baseUrl("/settings/users/{$user->id}") }}">
                                 @endif
-                            </td>
-                        </tr>
-                    @endforeach
-                </table>
-            @else
-                <p class="text-muted">
-                    {{ trans('settings.role_users_none') }}
-                </p>
-            @endif
+                                {{ $user->name }}
+                                @if(userCan('users-manage') || $currentUser->id == $user->id)
+                            </a>
+                        @endif
+                    </div>
+                </div>
+            @endforeach
         </div>
-    </div>
+    @else
+        <p class="text-muted">
+            {{ trans('settings.role_users_none') }}
+        </p>
+    @endif
 </div>
\ No newline at end of file
index 4cb29fc160878431cae8a84b1ae79372dc8c6d91..cd5d75f8fb9b9da6a7d3e0c0569cab7485c7fb7d 100644 (file)
@@ -15,7 +15,7 @@
                 {!! csrf_field() !!}
 
                 <div class="setting-list">
-                    @include('users.forms.' . $authMethod)
+                    @include('users.form')
                 </div>
 
                 <div class="form-group text-right">
index d6a4563ea71f1874ea1e9bb37f2da4d60787f866..42fc2beb1bba9135a82425d0657bb0a6c3a262fe 100644 (file)
@@ -14,7 +14,7 @@
                 <input type="hidden" name="_method" value="PUT">
 
                 <div class="setting-list">
-                    @include('users.forms.' . $authMethod, ['model' => $user])
+                    @include('users.form', ['model' => $user, 'authMethod' => $authMethod])
 
                     <div class="grid half large-gap">
                         <div>
                         </div>
                     </div>
 
-                    <div class="grid half large-gap">
+                    <div class="grid half large-gap v-center">
                         <div>
                             <label for="user-language" class="setting-list-label">{{ trans('settings.users_preferred_language') }}</label>
+                            <p class="small">
+                                {{ trans('settings.users_preferred_language_desc') }}
+                            </p>
                         </div>
                         <div>
                             <select name="setting[language]" id="user-language">
diff --git a/resources/views/users/form.blade.php b/resources/views/users/form.blade.php
new file mode 100644 (file)
index 0000000..2459626
--- /dev/null
@@ -0,0 +1,70 @@
+
+@if($authMethod === 'system' && $user->system_name == 'public')
+    <p class="mb-none text-secondary">{{ trans('settings.users_system_public') }}</p>
+@endif
+
+<div class="pt-m">
+    <label class="setting-list-label">{{ trans('settings.users_details') }}</label>
+    @if($authMethod === 'standard')
+        <p class="small">{{ trans('settings.users_details_desc') }}</p>
+    @endif
+    @if($authMethod === 'ldap' || $authMethod === 'system')
+        <p class="small">{{ trans('settings.users_details_desc_no_email') }}</p>
+    @endif
+    <div class="grid half mt-m large-gap">
+        <div>
+            <label for="name">{{ trans('auth.name') }}</label>
+            @include('form.text', ['name' => 'name'])
+        </div>
+        <div>
+            @if($authMethod !== 'ldap' || userCan('users-manage'))
+                <label for="email">{{ trans('auth.email') }}</label>
+                @include('form.text', ['name' => 'email'])
+            @endif
+        </div>
+    </div>
+</div>
+
+@if($authMethod === 'ldap' && userCan('users-manage'))
+    <div class="grid half large-gap v-center">
+        <div>
+            <label class="setting-list-label">{{ trans('settings.users_external_auth_id') }}</label>
+            <p class="small">{{ trans('settings.users_external_auth_id_desc') }}</p>
+        </div>
+        <div>
+            @include('form.text', ['name' => 'external_auth_id'])
+        </div>
+    </div>
+@endif
+
+@if(userCan('users-manage'))
+    <div>
+        <label for="role" class="setting-list-label">{{ trans('settings.users_role') }}</label>
+        <p class="small">{{ trans('settings.users_role_desc') }}</p>
+        <div class="mt-m">
+            @include('form/role-checkboxes', ['name' => 'roles', 'roles' => $roles])
+        </div>
+    </div>
+@endif
+
+@if($authMethod === 'standard')
+    <div>
+        <label class="setting-list-label">{{ trans('settings.users_password') }}</label>
+        <p class="small">{{ trans('settings.users_password_desc') }}</p>
+        @if(isset($model))
+            <p class="small">
+                {{ trans('settings.users_password_warning') }}
+            </p>
+        @endif
+        <div class="grid half mt-m large-gap">
+            <div>
+                <label for="password">{{ trans('auth.password') }}</label>
+                @include('form.password', ['name' => 'password'])
+            </div>
+            <div>
+                <label for="password-confirm">{{ trans('auth.password_confirm') }}</label>
+                @include('form.password', ['name' => 'password-confirm'])
+            </div>
+        </div>
+    </div>
+@endif
\ No newline at end of file
diff --git a/resources/views/users/forms/ldap.blade.php b/resources/views/users/forms/ldap.blade.php
deleted file mode 100644 (file)
index 8c7c874..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-{{--TODO--}}
-
-<div class="form-group">
-    <label for="name">{{ trans('auth.name') }}</label>
-    @include('form.text', ['name' => 'name'])
-</div>
-
-@if(userCan('users-manage'))
-<div class="form-group">
-    <label for="email">{{ trans('auth.email') }}</label>
-    @include('form.text', ['name' => 'email'])
-</div>
-@endif
-
-@if(userCan('users-manage'))
-    <div class="form-group">
-        <label for="role">{{ trans('settings.users_role') }}</label>
-        @include('form/role-checkboxes', ['name' => 'roles', 'roles' => $roles])
-    </div>
-@endif
-
-@if(userCan('users-manage'))
-    <div class="form-group">
-        <label for="external_auth_id">{{ trans('settings.users_external_auth_id') }}</label>
-        @include('form.text', ['name' => 'external_auth_id'])
-    </div>
-@endif
\ No newline at end of file
diff --git a/resources/views/users/forms/standard.blade.php b/resources/views/users/forms/standard.blade.php
deleted file mode 100644 (file)
index 097af9c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<div class="pt-m">
-    <label class="setting-list-label">{{ trans('settings.users_details') }}</label>
-    <p class="small">{{ trans('settings.users_details_desc') }}</p>
-    <div class="grid half mt-m large-gap">
-        <div>
-            <label for="name">{{ trans('auth.name') }}</label>
-            @include('form.text', ['name' => 'name'])
-        </div>
-        <div>
-            <label for="email">{{ trans('auth.email') }}</label>
-            @include('form.text', ['name' => 'email'])
-        </div>
-    </div>
-</div>
-
-
-@if(userCan('users-manage'))
-    <div>
-        <label for="role" class="setting-list-label">{{ trans('settings.users_role') }}</label>
-        <p class="small">{{ trans('settings.users_role_desc') }}</p>
-        <div class="mt-m">
-            @include('form/role-checkboxes', ['name' => 'roles', 'roles' => $roles])
-        </div>
-    </div>
-@endif
-
-
-<div>
-    <label class="setting-list-label">{{ trans('settings.users_password') }}</label>
-    <p class="small">{{ trans('settings.users_password_desc') }}</p>
-    @if(isset($model))
-        <p class="small">
-            {{ trans('settings.users_password_warning') }}
-        </p>
-    @endif
-    <div class="grid half mt-m large-gap">
-        <div>
-            <label for="password">{{ trans('auth.password') }}</label>
-            @include('form.password', ['name' => 'password'])
-        </div>
-        <div>
-            <label for="password-confirm">{{ trans('auth.password_confirm') }}</label>
-            @include('form.password', ['name' => 'password-confirm'])
-        </div>
-    </div>
-</div>
\ No newline at end of file
diff --git a/resources/views/users/forms/system.blade.php b/resources/views/users/forms/system.blade.php
deleted file mode 100644 (file)
index 7d33b75..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-{{--TODO--}}
-
-@if($user->system_name == 'public')
-    <p>{{ trans('settings.users_system_public') }}</p>
-@endif
-
-<div class="form-group">
-    <label for="name">{{ trans('auth.name') }}</label>
-    @include('form.text', ['name' => 'name'])
-</div>
-
-<div class="form-group">
-    <label for="email">{{ trans('auth.email') }}</label>
-    @include('form.text', ['name' => 'email'])
-</div>
-
-@if(userCan('users-manage'))
-    <div class="form-group">
-        <label for="role">{{ trans('settings.users_role') }}</label>
-        @include('form/role-checkboxes', ['name' => 'roles', 'roles' => $roles])
-    </div>
-@endif
-