Compare commits

...

5 Commits

Author SHA1 Message Date
Deon George
6bc2787602 Improved sidebar open/close handling 2020-03-11 12:41:36 +11:00
Deon George
96a6830e61 Changed carbon method naming to be consistent with Carbon itself 2020-02-08 17:52:13 +11:00
Deon George
176f680ff7 Enabled password reset forms 2020-01-22 20:48:42 +11:00
Deon George
62f66d7eed Fixes for laravel 6 2020-01-14 21:43:40 +11:00
Deon George
f131db31c6 Added custom.js, login redirects to current page, added form-start/form-end and change breadcrumb width 2020-01-09 18:44:07 +11:00
10 changed files with 153 additions and 89 deletions

View File

@@ -79,12 +79,12 @@
@endif @endif
<p class="mb-1"> <p class="mb-1">
<a name="reset" href="{{ url('/password/reset') }}">{{ trans('adminlte_lang::message.forgotpassword') }}</a> <a name="reset" href="{{ url('password/reset') }}">{{ trans('adminlte_lang::message.forgotpassword') }}</a>
</p> </p>
@isset($register) @isset($register)
<p class="mb-0"> <p class="mb-0">
<a href="register.html" class="text-center">Register a new membership</a> <a href="{{ url('register') }}" class="text-center">{{ trans('adminlte_lang::message.register') }}</a>
</p> </p>
@endisset @endisset
</div> </div>

View File

@@ -5,16 +5,16 @@
@endsection @endsection
@section('content') @section('content')
<body class="hold-transition login-page"> <div class="login-box m-auto">
<div id="app" v-cloak>
<div class="login-box">
<div class="login-logo"> <div class="login-logo">
<a href="{{ url('/home') }}">{!! config('app.name_html_long') !!}</a> <a>{!! config('app.name_html_long') !!}</a>
</div><!-- /.login-logo --> </div>
@if (session('status')) @if (Session::has('status'))
<div class="alert alert-success"> <div class="text-center mb-3">
{{ session('status') }} <div class="alert alert-success m-auto">
<strong>OK!</strong> {{ Session::get('status') }}
</div>
</div> </div>
@endif @endif
@@ -29,17 +29,39 @@
</div> </div>
@endif @endif
<div class="login-box-body"> <!-- /.login-logo -->
<p class="login-box-msg">{{ trans('adminlte_lang::message.passwordreset') }}</p> <div class="card">
<div class="card-body login-card-body">
<p class="login-box-msg">You forgot your password? Here you can easily retrieve a new password.</p>
<email-reset-password-form></email-reset-password-form> <form method="post" action="{{ url('password/email') }}">
{{ csrf_field() }}
<a href="{{ url('/login') }}">Log in</a><br> <div class="input-group mb-3">
</div><!-- /.login-box-body --> <input type="email" name="email" class="form-control" placeholder="Email" required>
<div class="input-group-append">
</div><!-- /.login-box --> <span class="fa fa-envelope input-group-text"></span>
</div> </div>
</div>
<div class="row">
<div class="col-12">
<button type="submit" class="btn btn-primary btn-block">{{ trans('adminlte_lang::message.sendpassword') }}</button>
</div>
<!-- /.col -->
</div>
</form>
@include('adminlte::layouts.partials.scripts_auth') <p class="mt-3 mb-1">
</body> <a href="{{ url('login') }}">{{ trans('adminlte_lang::message.login') }}</a>
</p>
@isset($register)
<p class="mb-0">
<a href="{{ url('register') }}" class="text-center">{{ trans('adminlte_lang::message.register') }}</a>
</p>
@endisset
</div>
<!-- /.login-card-body -->
</div>
</div>
<!-- /.login-box -->
@endsection @endsection

View File

@@ -5,18 +5,10 @@
@endsection @endsection
@section('content') @section('content')
<body class="hold-transition login-page"> <div class="login-box m-auto">
<div id="app" v-cloak>
<div class="login-box">
<div class="login-logo"> <div class="login-logo">
<a href="{{ url('/home') }}">{!! config('app.name_html_long') !!}</a> <a>{!! config('app.name_html_long') !!}</a>
</div><!-- /.login-logo -->
@if (session('status'))
<div class="alert alert-success">
{{ session('status') }}
</div> </div>
@endif
@if (count($errors) > 0) @if (count($errors) > 0)
<div class="alert alert-danger"> <div class="alert alert-danger">
@@ -29,18 +21,49 @@
</div> </div>
@endif @endif
<div class="login-box-body"> <!-- /.login-logo -->
<p class="login-box-msg">{{ trans('adminlte_lang::message.passwordreset') }}</p> <div class="card">
<div class="card-body login-card-body">
<p class="login-box-msg">You are only one step a way from your new password, set your new password now.</p>
<reset-password-form token="{{ $token }}">></reset-password-form> <form method="post" action="{{ url('password/reset') }}">
{{ csrf_field() }}
<a href="{{ url('/login') }}">Log in</a><br> <div class="input-group mb-3">
<a href="{{ url('/register') }}" class="text-center">{{ trans('adminlte_lang::message.register') }}</a> <input type="email" name="email" class="form-control" placeholder="Email" required>
</div><!-- /.login-box-body --> <div class="input-group-append">
<span class="fa fa-envelope input-group-text"></span>
</div><!-- /.login-box -->
</div> </div>
</div>
<div class="input-group mb-3">
<input type="password" name="password" class="form-control" placeholder="Password" required>
<div class="input-group-append">
<span class="fa fa-lock input-group-text"></span>
</div>
</div>
<div class="input-group mb-3">
<input type="password" name="password_confirmation" class="form-control" placeholder="Confirm Password" data-match="#password" required>
<div class="input-group-append">
<span class="fa fa-lock input-group-text"></span>
</div>
</div>
<div class="row">
<div class="col-12">
<button type="submit" class="btn btn-primary btn-block">{{ trans('adminlte_lang::message.passwordreset') }}</button>
</div>
<!-- /.col -->
</div>
<input type="hidden" name="token" value="{{ $token }}">
</form>
@include('adminlte::layouts.partials.scripts_auth') <p class="mt-3 mb-1">
</body> <a href="{{ url('login') }}">Login</a>
@isset($register)
<a href="{{ url('register') }}" class="text-center">{{ trans('adminlte_lang::message.register') }}</a>
@endisset
</p>
</div>
<!-- /.login-card-body -->
</div>
</div>
<!-- /.login-box -->
@endsection @endsection

View File

@@ -13,7 +13,8 @@
<!-- Content Wrapper. Contains page content --> <!-- Content Wrapper. Contains page content -->
<div class="content-wrapper"> <div class="content-wrapper">
<!-- In case we have input fields in the header -->
@yield('page-form-start')
@include('adminlte::layouts.partials.contentheader') @include('adminlte::layouts.partials.contentheader')
<!-- Main content --> <!-- Main content -->
@@ -24,6 +25,7 @@
</div> </div>
</section><!-- /.content --> </section><!-- /.content -->
@yield('page-form-end')
</div><!-- /.content-wrapper --> </div><!-- /.content-wrapper -->
@isset($controlsidebar) @isset($controlsidebar)

View File

@@ -2,12 +2,12 @@
<div class="content-header d-print-none"> <div class="content-header d-print-none">
<div class="container-fluid"> <div class="container-fluid">
<div class="row mb-2"> <div class="row mb-2">
<div class="col-sm-6"> <div class="col-sm-8">
<h1 class="m-0 text-dark">@yield('contentheader_title', 'Content Title')</h1> <h1 class="m-0 text-dark">@yield('contentheader_title', 'Content Title')</h1>
<small>@yield('contentheader_description','Description')</small> <small>@yield('contentheader_description','Description')</small>
</div><!-- /.col --> </div><!-- /.col -->
<div class="col-sm-6"> <div class="col-sm-4">
<ol class="breadcrumb float-sm-right small"> <ol class="breadcrumb float-sm-right small">
<li class="breadcrumb-item"><a href="{{ url('/home'.(isset($ido) ? '/'.$ido->id : '')) }}">Home</a></li> <li class="breadcrumb-item"><a href="{{ url('/home'.(isset($ido) ? '/'.$ido->id : '')) }}">Home</a></li>
@isset($breadcrumb) @isset($breadcrumb)

View File

@@ -59,7 +59,7 @@
</div> </div>
</li> </li>
@else @else
<a href="{{ url('login') }}" class="text-muted pr-2"><i class="fa fa-lock"></i></a> <a href="{{ url()->current().'?login=1' }}" class="text-muted pr-2"><i class="fa fa-lock"></i></a>
@endif @endif
<!-- Control Side Bar --> <!-- Control Side Bar -->

View File

@@ -14,6 +14,7 @@
}); });
$.AdminLTESidebarTweak = {}; $.AdminLTESidebarTweak = {};
$.AdminLTESidebarTweak.Open = true;
$.AdminLTESidebarTweak.options = { $.AdminLTESidebarTweak.options = {
EnableRemember: true, EnableRemember: true,
@@ -24,6 +25,29 @@
// Work out our timezone. // Work out our timezone.
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone; const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
/**
* Open and close the sidebar
* @param state
* @param addclass
*/
function sidebaropenclose(state,addclass) {
// Dont do anything if the state hasnt changed.
if (state == $.AdminLTESidebarTweak.Open) {
return;
}
$.AdminLTESidebarTweak.Open = state;
if (addclass !== 'undefined')
$("body")
.addClass(state ? 'sidebar-open' : 'sidebar-collapse');
$(this).delay(500).queue(function() {
window.dispatchEvent(new Event('resize'));
$(this).dequeue();
});
}
$(function () { $(function () {
"use strict"; "use strict";
@@ -31,22 +55,15 @@
if($.AdminLTESidebarTweak.options.EnableRemember) { if($.AdminLTESidebarTweak.options.EnableRemember) {
document.cookie = "toggleState=closed;path=/"; document.cookie = "toggleState=closed;path=/";
$("body").delay(500).queue(function () { $("body").queue(sidebaropenclose(false));
window.dispatchEvent(new Event('resize'));
$(this).dequeue();
});
} }
}); });
// @todo this is not firing.
$("body").on("shown.lte.pushmenu", function(){ $("body").on("shown.lte.pushmenu", function(){
if($.AdminLTESidebarTweak.options.EnableRemember){ if($.AdminLTESidebarTweak.options.EnableRemember){
document.cookie = "toggleState=opened;path=/"; document.cookie = "toggleState=opened;path=/";
$("body").delay(500).queue(function () { $("body").queue(sidebaropenclose(true));
window.dispatchEvent(new Event('resize'));
$(this).dequeue();
});
} }
}); });
@@ -60,14 +77,14 @@
$(this).removeClass('hold-transition'); $(this).removeClass('hold-transition');
}); });
}else{ }else{
$("body") $("body").queue(sidebaropenclose(false,true));
.addClass('sidebar-collapse')
.delay(500).queue(function () {
window.dispatchEvent(new Event('resize'));
$(this).dequeue();
});
} }
} }
} }
}); });
</script> </script>
@if(file_exists('js/custom.js'))
<!-- Any Custom JS -->
<script src="{{ asset('js/custom.js') }}"></script>
@endif

View File

@@ -14,13 +14,13 @@
@if($user->exists) @if($user->exists)
<img src="{{ Gravatar::get(($user->exists AND $user->email) ? $user->email : 'nobody@example.com') }}" class="img-circle elevation-2" alt="User"> <img src="{{ Gravatar::get(($user->exists AND $user->email) ? $user->email : 'nobody@example.com') }}" class="img-circle elevation-2" alt="User">
@else @else
<a href="{{ url('login') }}" class="d-block"><i class="pl-1 fa fa-3x fa-lock"></i></a> <a name="login" href="{{ url()->current().'?login=1' }}" class="d-block"><i class="pl-1 fa fa-3x fa-lock"></i></a>
@endif @endif
</div> </div>
<div class="info"> <div class="info">
<a href="{{ url('login') }}" class="d-block">{{ $user->exists ? ($user->name ?: 'No Name') : 'Login' }}</a> <a href="{{ url('login') }}" class="d-block">{{ $user->exists ? ($user->name ?: 'No Name') : 'Login' }}</a>
@isset($user->lastlogin)<a span="d-block"><small><span style="color: #747474;">Last On:</span> {{ $user->lastlogin->format('Y-m-d H:i') }}</small></a>@endisset @isset($user->lastlogin)<a name="login" span="d-block"><small><span style="color: #747474;">Last On:</span> {{ $user->lastlogin->format('Y-m-d H:i') }}</small></a>@endisset
</div> </div>
</div> </div>

View File

@@ -34,7 +34,7 @@ class Carbon extends CarbonBase
* *
* @return static * @return static
*/ */
public function firstOfHalf($dayOfWeek = null) public function startOfHalf($dayOfWeek = null)
{ {
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF - 5, 1)->firstOfMonth($dayOfWeek); return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF - 5, 1)->firstOfMonth($dayOfWeek);
} }
@@ -49,7 +49,7 @@ class Carbon extends CarbonBase
* *
* @return static * @return static
*/ */
public function lastOfHalf($dayOfWeek = null) public function endOfHalf($dayOfWeek = null)
{ {
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF, 1)->lastOfMonth($dayOfWeek); return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF, 1)->lastOfMonth($dayOfWeek);
} }

View File

@@ -21,7 +21,7 @@ if (! function_exists('array_undot')) {
$array = []; $array = [];
foreach ($dotNotationArray as $key => $value) { foreach ($dotNotationArray as $key => $value) {
array_set($array, $key, $value); \Illuminate\Support\Arr::set($array, $key, $value);
} }
return $array; return $array;