Compare commits

...

56 Commits
0.1.0 ... 7.0.0

Author SHA1 Message Date
Deon George
432606760b Update for Laravel 7.x 2020-08-04 16:14:35 +10:00
Deon George
958dbc7092 Remove @todo comment that has been implemented 2020-07-10 09:43:40 +10:00
Deon George
12f33b6853 Remove unnecessary console.log() 2020-06-23 12:34:28 +10:00
Deon George
b67df24219 Disable sorting - should be sorted by ajax method 2020-06-11 16:19:40 +10:00
Deon George
7ffcdb139a Enable font selection override 2020-05-26 11:26:00 +10:00
Deon George
5a9437db37 bootstrap typeahead now part of app.js - updated and optimised enabling categories 2020-05-26 11:12:54 +10:00
Deon George
9389fd9e83 Added widget for success/error messages 2020-05-06 17:13:15 +10:00
Deon George
87819891a1 Updated Fontawesome to v5 2020-05-06 16:30:41 +10:00
Deon George
b3924ea239 Make resize delay configurable and default 1000 2020-03-12 09:13:55 +11:00
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
Deon George
8b83990a66 Changed not logged in user to padlock with 'Login' 2019-12-16 11:29:34 +11:00
Deon George
4472202afb Display improvements for login note 2019-11-29 11:13:24 +11:00
Deon George
2040266ab2 Disable autocomplete in search 2019-11-26 09:58:45 +11:00
Deon George
1774987dea Dispatch resize event if sidebar collapsed 2019-11-22 14:22:37 +11:00
Deon George
6c60298e8f Add a note on the login page 2019-11-21 14:33:33 +11:00
Deon George
41b320a5b9 Fix file_exist check for custom.css 2019-11-17 23:26:12 +11:00
Deon George
1096f0e28d Added custom.css to app.blade 2019-10-30 14:31:32 +08:00
Deon George
b0730b9ed3 Revert name to igaster/laravel-theme 2019-10-30 14:15:20 +08:00
Deon George
163a7f2587 Add github cvs to composer 2019-10-30 12:15:23 +08:00
Deon George
4f2707a374 Switch laravel-them to fix issue with @ directives 2019-10-30 09:49:19 +08:00
Deon George
0ca66c6d1c Updated orchestra/asset 2019-10-11 15:50:06 +11:00
Deon George
5833122ab5 Removed Acache/User 2019-10-11 14:47:13 +11:00
Deon George
a946ce4418 Added error dialog on login box 2019-09-03 14:38:19 +10:00
Deon George
e5ff189d3e Added tz and move adminlte css to later 2019-08-20 15:50:15 +10:00
Deon George
1efdfca55f Remove mix() for now 2019-07-03 17:16:46 +10:00
Deon George
6d876f2c94 No longer using // urls, and fixed sudo rendoring 2019-06-17 11:44:56 +10:00
Deon George
70a7142877 Fix for sidebar collapse/expand and window resizing 2019-05-16 11:15:49 +10:00
Deon George
c406c35ff7 User login updates 2019-04-11 22:30:03 +10:00
Deon George
6d84613158 Added custom css files 2019-03-28 11:16:50 +11:00
Deon George
05dbcaf6c4 Added creativeorange/gravatar to requirements 2019-03-26 17:23:46 +11:00
Deon George
867b42be91 Added acache/user to requirements 2019-03-26 17:18:40 +11:00
Deon George
f44e6f1d09 Added csrf_field() to login form 2019-03-26 14:31:18 +11:00
Deon George
fb88cf2866 Added items to search 2019-03-22 21:52:44 +11:00
Deon George
91aa1d9378 Enabled search results and remember sidebar collapse 2019-02-18 20:44:17 +11:00
Deon George
062b1bce8c Update for laravel 5.7 and adminlte v3-alpha 2019-02-08 23:42:58 +11:00
Deon George
11a321603c Update require for igaster/laravel-theme 2019-02-04 11:04:41 +00:00
Deon George
8aa21663d5 Changed body font size 2018-08-23 16:26:39 +10:00
Deon George
3af5ae6466 Remember sidebar collapse state 2018-08-12 17:01:50 +10:00
Deon George
f8d7432965 Added array_undot() helper 2018-08-11 15:11:34 +10:00
Deon George
98b7b9f6a8 Fix login and password resets forms 2018-08-08 00:14:48 +10:00
Deon George
f1787aaa32 Fixes for printing and page rendering improvements 2018-08-07 22:53:35 +10:00
Deon George
0bd32aab4a Layout updates, switch user updates 2018-08-01 16:29:14 +10:00
Deon George
444c159ab9 Added CompositeKeys Traits for Models with multiple primary keys 2018-07-31 12:56:29 +10:00
Deon George
55cbe4087c More improvements to User Switch 2018-07-17 13:27:25 +10:00
Deon George
ac867a2526 Enhancements to user switch 2018-07-13 14:39:10 +10:00
Deon George
b0fcdaa375 Added artisan command schedule:list 2018-06-15 14:14:04 +10:00
Deon George
55d369df47 Added helpers.php 2018-06-12 16:09:27 +10:00
Deon George
c5413d5b50 Added X-CSRF-TOKEN 2018-06-05 23:39:47 +10:00
Deon George
8bafc735c4 Moved page-scripts to render after main scripts 2018-05-24 12:28:30 +10:00
Deon George
1bfd5609a5 Using @js instead of script, minor fixes 2018-05-22 22:09:18 +10:00
Deon George
602fc14760 Added admin switch, and composer dependencies 2018-05-20 11:57:49 +10:00
Deon George
eb6ebd635e Added partial.topmenu 2018-05-08 15:13:31 +10:00
35 changed files with 1033 additions and 599 deletions

View File

@@ -10,13 +10,19 @@
} }
], ],
"require": { "require": {
"igaster/laravel-theme": "^2.0.15",
"creativeorange/gravatar": "^1.0",
"orchestra/asset": "^5.0"
}, },
"require-dev": { "require-dev": {
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Leenooks\\": "src" "Leenooks\\": "src"
} },
"files": [
"src/helpers.php"
]
}, },
"extra": { "extra": {
"laravel": { "laravel": {

6
readme.md Normal file
View File

@@ -0,0 +1,6 @@
* User Switch
Add the following routes
```
Route::get( 'admin/switch/start/{id}', 'UserController@user_switch_start' );
Route::get( 'admin/switch/stop', 'UserController@user_switch_stop' );
```

View File

@@ -24,15 +24,16 @@ return [
'conditions' => 'Terms and conditions', 'conditions' => 'Terms and conditions',
'register' => 'Register', 'register' => 'Register',
'login' => 'Login', 'login' => 'Login',
'membreship' => 'I already have a membership', 'membership' => 'I already have a membership',
'passwordclickreset' => 'Click here to reset your password:', 'passwordclickreset' => 'Click here to reset your password:',
'signGithub' => 'Sign in using Github', 'signGithub' => 'Sign in using Github',
'signFacebook' => 'Sign in using Facebook', 'signFacebook' => 'Sign in using Facebook',
'signTwitter' => 'Sign in using Twitter', 'signTwitter' => 'Sign in using Twitter',
'signGoogle+' => 'Sign in using Google+', 'signGoogle' => 'Sign in using Google',
'signLinkedin' => 'Sign in using Linkedin', 'signLinkedin' => 'Sign in using Linkedin',
'signW3id' => 'Sign in using W3id', 'signW3id' => 'Sign in using W3id',
'signIBMid' => 'Sign in using IBMid', 'signIBMid' => 'Sign in using IBMid',
'signMeetup' => 'Sign in using Meetup',
'sendpassword' => 'Send Password Reset Link', 'sendpassword' => 'Send Password Reset Link',
'passwordreset' => 'Reset password', 'passwordreset' => 'Reset password',
'pagenotfound' => 'Page not found', 'pagenotfound' => 'Page not found',
@@ -51,35 +52,21 @@ return [
'level' => 'Level', 'level' => 'Level',
'here' => 'Here', 'here' => 'Here',
'recentactivity' => 'Recent Activity', 'recentactivity' => 'Recent Activity',
'descriptionpackage' => 'A Laravel 5 package that switchs default Laravel scaffolding/boilerplate to AdminLTE template',
'createdby' => 'Created by', 'createdby' => 'Created by',
'seecode' => 'See code at', 'seecode' => 'See code at',
'online' => 'Online', 'online' => 'Online',
'home' => 'Home', 'home' => 'Home',
'header' => 'HEADER', 'header' => 'HEADER',
'anotherlink' => 'Another Link',
'multilevel' => 'Multilevel',
'linklevel2' => 'Link in level2',
'birthday' => 'Langdon\'s Birthday',
'birthdaydate' => 'Will be 23 on April 24th',
'progress' => 'Tasks Progress', 'progress' => 'Tasks Progress',
'customtemplate' => 'Custom Template Design',
'statstab' => 'Stats Tab Content', 'statstab' => 'Stats Tab Content',
'generalset' => 'General Settings', 'generalset' => 'General Settings',
'reportpanel' => 'Report panel usage', 'reportpanel' => 'Report panel usage',
'checked' => 'checked', 'checked' => 'checked',
'informationsettings' => 'Some information about this general settings option',
'togglenav' => 'Toggle navigation', 'togglenav' => 'Toggle navigation',
'tabmessages' => 'You have 4 messages',
'supteam' => 'Support Team', 'supteam' => 'Support Team',
'awesometheme' => 'Why not buy a new awesome theme?',
'allmessages' => 'See All Messages', 'allmessages' => 'See All Messages',
'notifications' => 'You have 10 notifications',
'newmembers' => '5 new members joined today',
'viewall' => 'View all', 'viewall' => 'View all',
'tasks' => 'You have 9 tasks',
'alltasks' => 'View all tasks', 'alltasks' => 'View all tasks',
'desbuttons' => 'Design some buttons',
'complete' => 'Complete', 'complete' => 'Complete',
'membersince' => 'Member since', 'membersince' => 'Member since',
'followers' => 'Followers', 'followers' => 'Followers',
@@ -87,26 +74,15 @@ return [
'friends' => 'Friends', 'friends' => 'Friends',
'profile' => 'Profile', 'profile' => 'Profile',
'signout' => 'Sign out', 'signout' => 'Sign out',
'landingdescription' => 'Laravel 5 package that switchs default Laravel scaffolding/boilerplate to AdminLTE template with Bootstrap 3.0 and Pratt Landing page',
'landingdescriptionpratt' => 'Acacha AdminLTE Laravel package template Landing page - Using Pratt',
'description' => 'Description',
'showcase' => 'Showcase', 'showcase' => 'Showcase',
'contact' => 'Contact', 'contact' => 'Contact',
'laravelpackage' => '5 package that switchs default Laravel',
'to' => 'to', 'to' => 'to',
'templatewith' => 'template with',
'and' => 'and', 'and' => 'and',
'gedstarted' => 'Get Started!', 'gedstarted' => 'Get Started!',
'amazing' => 'Amazing admin template',
'basedadminlte' => 'Based on adminlte bootstrap theme',
'awesomepackaged' => 'Awesome packaged...',
'by' => 'by', 'by' => 'by',
'at' => 'at', 'at' => 'at',
'readytouse' => 'ready to use with Laravel!',
'designed' => 'Designed To Excel',
'community' => 'Community', 'community' => 'Community',
'see' => 'See', 'see' => 'See',
'githubproject' => 'Github project',
'post' => 'post', 'post' => 'post',
'issues' => 'issues', 'issues' => 'issues',
'pullrequests' => 'Pull requests', 'pullrequests' => 'Pull requests',
@@ -114,10 +90,6 @@ return [
'monitoring' => 'Monitoring', 'monitoring' => 'Monitoring',
'whatnew' => 'What\'s New?', 'whatnew' => 'What\'s New?',
'features' => 'Some Features', 'features' => 'Some Features',
'design' => 'First Class Design',
'retina' => 'Retina Ready Theme',
'support' => 'Awesome Support',
'responsive' => 'Responsive Design',
'screenshots' => 'Some Screenshots', 'screenshots' => 'Some Screenshots',
'address' => 'Address', 'address' => 'Address',
'dropus' => 'Drop Us A Line', 'dropus' => 'Drop Us A Line',
@@ -136,4 +108,7 @@ return [
'loggedin' => 'Logged in!', 'loggedin' => 'Logged in!',
'entering' => 'Entering...', 'entering' => 'Entering...',
'registered' => 'User Registered!', 'registered' => 'User Registered!',
'switchoff' => 'Switch Back',
'success' => 'Success!',
'resetemaillink' => 'We have e-mailed your password reset link!',
]; ];

View File

@@ -1,53 +1,105 @@
@extends('adminlte::layouts.auth') @extends('adminlte::layouts.auth')
@section('htmlheader_title') @section('htmlheader_title')
Log in Log in
@endsection @endsection
@section('content') @section('content')
<body class="hold-transition login-page"> @if(isset($login_note) AND $login_note)
<div id="app" v-cloak> <div class="alert alert-info alert-dismissible m-auto">
<div class="login-box"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<div class="login-logo"> <h5><i class="icon fas fa-info"></i> NOTE!</h5>
<a href="{{ url('/home') }}">{!! config('app.name_html_long') !!}</a> {!! $login_note !!}
</div><!-- /.login-logo --> </div>
<br>
@endisset
@if (count($errors) > 0) <div class="login-box m-auto">
<div class="alert alert-danger"> <div class="login-logo">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br> <a>{!! config('app.name_html_long') !!}</a>
<ul> </div>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="login-box-body"> @if (count($errors) > 0)
<p class="login-box-msg"> {{ trans('adminlte_lang::message.siginsession') }} </p> <div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<login-form name="{{ config('auth.providers.users.field','email') }}" @if (Session::has('error'))
domain="{{ config('auth.defaults.domain','') }}"></login-form> <div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
<ul>
<li>{{ Session::get('error') }}</li>
</ul>
</div>
@endif
<a href="{{ url('/password/reset') }}">{{ trans('adminlte_lang::message.forgotpassword') }}</a><br> <!-- /.login-logo -->
<div class="card">
<div class="card-body login-card-body">
<p class="login-box-msg">{{ trans('adminlte_lang::message.siginsession') }}</p>
@if(count(config('auth.social',[]))) <form method="post">
@include('adminlte::auth.partials.social_login') {{ csrf_field() }}
@endif
</div>
</div>
</div>
@include('adminlte::layouts.partials.scripts_auth') <div class="row">
<div class="col-12">
<div class="input-group mb-3">
<input type="email" name="email" class="form-control" placeholder="Email">
<div class="input-group-append">
<span class="input-group-text"><i class="fas fa-envelope fa-fw"></i></span>
</div>
</div>
</div>
<script> <div class="col-12">
$(function () { <div class="input-group mb-3">
$('input').iCheck({ <input type="password" name="password" class="form-control" placeholder="Password">
checkboxClass: 'icheckbox_square-blue', <div class="input-group-append">
radioClass: 'iradio_square-blue', <span class="input-group-text"><i class="fas fa-key fa-fw"></i></span>
increaseArea: '20%' // optional </div>
}); </div>
}); </div>
</script> </div>
</body>
<div class="row">
<div class="col-8">
<div class="checkbox icheck">
<label>
<input type="checkbox" name="remember"> Remember Me
</label>
</div>
</div>
<!-- /.col -->
<div class="col-4">
<button type="submit" name="submit" class="btn btn-primary mr-0 float-right">Sign In</button>
</div>
<!-- /.col -->
</div>
</form>
@if(count(config('auth.social',[])))
@include('adminlte::auth.partials.social_login')
@endif
<p class="mb-1">
<a name="reset" href="{{ url('password/reset') }}">{{ trans('adminlte_lang::message.forgotpassword') }}</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

@@ -0,0 +1,14 @@
<!-- Compiled app javascript -->
<script src="{{ asset('/js/app.js') }}"></script>
<!-- iCheck -->
<script src="{{ asset('/plugin/iCheck/icheck.min.js') }}"></script>
<script>
$(document).ready(function() {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass : 'iradio_square-blue',
increaseArea : '20%' // optional
})
})
</script>

View File

@@ -1,6 +1,9 @@
<div class="social-auth-links text-center"> <div class="social-auth-links text-center mb-3">
<p>- OR -</p> <p>- OR -</p>
@foreach(config('auth.social') as $o) @foreach(config('auth.social') as $o)
<a href="{{ url('/auth/'.$o['id']) }}" class="btn btn-block btn-social btn-{{ $o['class'] }} btn-flat"><i class="fa fa-{{ $o['icon'] }}"></i> {{ trans('adminlte_lang::message.sign'.$o['name']) }}</a> <a href="{{ url('/auth/'.$o['id']) }}" class="btn btn-block {{ $o['class'] }}">
<i class="{{ $o['icon'] }} fa-fw mr-2"></i> {{ trans('adminlte_lang::message.sign'.$o['name']) }}
</a>
@endforeach @endforeach
</div><!-- /.social-auth-links --> </div>
<!-- /.social-auth-links -->

View File

@@ -1,59 +1,67 @@
@extends('adminlte::layouts.auth') @extends('adminlte::layouts.auth')
@section('htmlheader_title') @section('htmlheader_title')
Password recovery Password recovery
@endsection @endsection
@section('content') @section('content')
<div class="login-box m-auto">
<div class="login-logo">
<a>{!! config('app.name_html_long') !!}</a>
</div>
<body class="login-page"> @if (Session::has('status'))
<div id="app"> <div class="text-center mb-3">
<div class="alert alert-success m-auto">
<strong>OK!</strong> {{ Session::get('status') }}
</div>
</div>
@endif
<div class="login-box"> @if (count($errors) > 0)
<div class="login-logo"> <div class="alert alert-danger">
<a href="{{ url('/home') }}"><b>Admin</b>LTE</a> <strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
</div><!-- /.login-logo --> <ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
@if (session('status')) <!-- /.login-logo -->
<div class="alert alert-success"> <div class="card">
{{ session('status') }} <div class="card-body login-card-body">
</div> <p class="login-box-msg">You forgot your password? Here you can easily retrieve a new password.</p>
@endif
@if (count($errors) > 0) <form method="post" action="{{ url('password/email') }}">
<div class="alert alert-danger"> {{ csrf_field() }}
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br> <div class="input-group mb-3">
<ul> <input type="email" name="email" class="form-control" placeholder="Email" required>
@foreach ($errors->all() as $error) <div class="input-group-append">
<li>{{ $error }}</li> <span class="fas fa-envelope input-group-text"></span>
@endforeach </div>
</ul> </div>
</div> <div class="row">
@endif <div class="col-12">
<button type="submit" class="btn btn-primary btn-block">{{ trans('adminlte_lang::message.sendpassword') }}</button>
</div>
<!-- /.col -->
</div>
</form>
<div class="login-box-body"> <p class="mt-3 mb-1">
<p class="login-box-msg">Reset Password</p> <a href="{{ url('login') }}">{{ trans('adminlte_lang::message.login') }}</a>
</p>
<email-reset-password-form></email-reset-password-form> @isset($register)
<p class="mb-0">
<a href="{{ url('/login') }}">Log in</a><br> <a href="{{ url('register') }}" class="text-center">{{ trans('adminlte_lang::message.register') }}</a>
</p>
</div><!-- /.login-box-body --> @endisset
</div>
</div><!-- /.login-box --> <!-- /.login-card-body -->
</div> </div>
</div>
@include('adminlte::layouts.partials.scripts_auth') <!-- /.login-box -->
@endsection
<script>
$(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
</script>
</body>
@endsection

View File

@@ -0,0 +1,69 @@
@extends('adminlte::layouts.auth')
@section('htmlheader_title')
Password reset
@endsection
@section('content')
<div class="login-box m-auto">
<div class="login-logo">
<a>{!! config('app.name_html_long') !!}</a>
</div>
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<!-- /.login-logo -->
<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>
<form method="post" action="{{ url('password/reset') }}">
{{ csrf_field() }}
<div class="input-group mb-3">
<input type="email" name="email" class="form-control" placeholder="Email" required>
<div class="input-group-append">
<span class="fas fa-envelope fa-fw input-group-text"></span>
</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="fas 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="fas 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>
<p class="mt-3 mb-1">
<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

View File

@@ -1,44 +0,0 @@
@extends('adminlte::layouts.auth')
@section('htmlheader_title')
Register
@endsection
@section('content')
<body class="hold-transition register-page">
<div id="app" v-cloak>
<div class="register-box">
<div class="register-logo">
<a href="{{ url('/home') }}"><b>Pipeline</b>Management</a>
</div>
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="register-box-body">
<p class="login-box-msg">Register for access</p>
<register-form></register-form>
<!-- #include('adminlte::auth.partials.social_login') -->
<a href="{{ url('/login') }}" class="text-center">I already have an account</a>
</div><!-- /.form-box -->
</div><!-- /.register-box -->
</div>
@include('adminlte::layouts.partials.scripts_auth')
@include('adminlte::auth.terms')
</body>
@endsection

View File

@@ -1,20 +0,0 @@
@extends('adminlte::layouts.errors')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.servererror') }}
@endsection
@section('main-content')
<div class="error-page">
<h2 class="headline text-red">403</h2>
<div class="error-content">
<h3><i class="fa fa-warning text-red"></i> Oops! Bad Authentication</h3>
<p>
Sorry, your authentication failed.
{{ trans('adminlte_lang::message.mainwhile') }} <a href='{{ url('/home') }}'>{{ trans('adminlte_lang::message.returndashboard') }}</a>.
</p>
<br>
</div>
</div><!-- /.error-page -->
@endsection

View File

@@ -1,20 +0,0 @@
@extends('adminlte::layouts.errors')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.pagenotfound') }}
@endsection
@section('main-content')
<div class="error-page">
<h2 class="headline text-yellow">404</h2>
<div class="error-content">
<h3><i class="fa fa-warning text-yellow"></i> Oops! {{ trans('adminlte_lang::message.pagenotfound') }}.</h3>
<p>
{{ trans('adminlte_lang::message.notfindpage') }}
{{ trans('adminlte_lang::message.mainwhile') }} <a href='{{ url('/home') }}'>{{ trans('adminlte_lang::message.returndashboard') }}</a>.
</p>
<br/>
</div><!-- /.error-content -->
</div><!-- /.error-page -->
@endsection

View File

@@ -1,20 +0,0 @@
@extends('adminlte::layouts.errors')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.servererror') }}
@endsection
@section('main-content')
<div class="error-page">
<h2 class="headline text-red">500</h2>
<div class="error-content">
<h3><i class="fa fa-warning text-red"></i> Oops! {{ trans('adminlte_lang::message.somethingwrong') }}</h3>
<h4><i class="text-red"></i> {{ trans($msg) }}</h4>
<p>
{{ trans('adminlte_lang::message.wewillwork') }}
{{ trans('adminlte_lang::message.mainwhile') }} <a href='{{ url('/home') }}'>{{ trans('adminlte_lang::message.returndashboard') }}</a>.
</p>
</div>
</div><!-- /.error-page -->
@endsection

View File

@@ -1,41 +1,48 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@section('htmlheader')
@section('htmlheader') @include('adminlte::layouts.partials.htmlheader')
@include('adminlte::layouts.partials.htmlheader')
@show
<body class="fixed skin-blue sidebar-mini">
<div id="app" v-cloak>
<div class="wrapper">
@include('adminlte::layouts.partials.mainheader')
@include('adminlte::layouts.partials.sidebar')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
@include('adminlte::layouts.partials.contentheader')
<!-- Main content -->
<section class="content">
<div class="row">
<!-- Your Page Content Here -->
@yield('main-content')
</div>
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<!-- #include('adminlte::layouts.partials.controlsidebar') -->
@include('adminlte::layouts.partials.footer')
</div><!-- ./wrapper -->
</div> <!-- ./app -->
@section('scripts')
@include('adminlte::layouts.partials.scripts')
{{-- Scripts --}}
{!! Asset::scripts() !!}
@show @show
</body>
<body class="hold-transition sidebar-mini @if (Cookie::get('toggleState') === 'closed') {{ 'sidebar-collapse' }} @endif">
<div id="app">
<div class="wrapper">
@include('adminlte::layouts.partials.mainheader')
@include('adminlte::layouts.partials.sidebar')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- In case we have input fields in the header -->
@yield('page-form-start')
@include('adminlte::layouts.partials.contentheader')
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<!-- Your Page Content Here -->
@yield('main-content')
</div>
</section><!-- /.content -->
@yield('page-form-end')
</div><!-- /.content-wrapper -->
@isset($controlsidebar)
@include('adminlte::layouts.partials.controlsidebar')
@endisset
@include('adminlte::layouts.partials.footer')
</div><!-- ./wrapper -->
</div> <!-- ./app -->
@section('scripts')
@include('adminlte::layouts.partials.scripts')
{{-- Scripts --}}
{!! Asset::scripts() !!}
@yield('page-scripts')
@show
</body>
</html> </html>

View File

@@ -1,8 +1,19 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@section('htmlheader')
@include('adminlte::layouts.partials.htmlheader')
@include('adminlte::layouts.partials.htmlheader') <!-- iCheck -->
<link rel="stylesheet" href="{{ asset('/plugin/iCheck/square/blue.css') }}">
@show
@yield('content') <body class="hold-transition login-page">
<div id="app">
@yield('content')
</div>
@section('scripts')
@include('adminlte::auth.partials.scripts')
@show
</body>
</html> </html>

View File

@@ -1,17 +0,0 @@
<!DOCTYPE html>
<html>
@include('adminlte::layouts.partials.htmlheader')
<body>
<div id="app" v-cloak>
<!-- Main content -->
<section class="content">
<!-- Your Page Content Here -->
@yield('main-content')
</section>
</div>
@section('scripts')
@include('adminlte::layouts.partials.scripts')
@show
</body>
</html>

View File

@@ -1,17 +1,24 @@
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <div class="content-header d-print-none">
<div id="search_results"></div> <div class="container-fluid">
<h1> <div class="row mb-2">
@yield('contentheader_title', 'Content Title') <div class="col-sm-8">
<small>@yield('contentheader_description')</small> <h1 class="m-0 text-dark">@yield('contentheader_title', 'Content Title')</h1>
</h1> <small>@yield('contentheader_description','Description')</small>
<ol class="breadcrumb"> </div><!-- /.col -->
<li><a href="{{ url('/home'.(isset($ido) ? '/'.$ido->id : '')) }}"><i class="fa fa-dashboard"></i>Home</a></li>
@isset($breadcrumb) <div class="col-sm-4">
@foreach ($breadcrumb as $item => $url) <ol class="breadcrumb float-sm-right small">
<li><a href="{{url($url)}}">{{ $item }}</a></li> <li class="breadcrumb-item"><a href="{{ url('/home'.(isset($ido) ? '/'.$ido->id : '')) }}">Home</a></li>
@endforeach @isset($breadcrumb)
@endisset @foreach ($breadcrumb as $item => $url)
</ol> <!-- /.breadcrumb --> <li class="breadcrumb-item"><a href="{{url($url)}}">{{ $item }}</a></li>
</section> <!-- /.content-header --> @endforeach
@endisset
<li class="breadcrumb-item active">@yield('page_title','Page Title')</li>
</ol>
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->

View File

@@ -0,0 +1,5 @@
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->

View File

@@ -1,8 +1,10 @@
<!-- Main Footer --> <!-- Main Footer -->
<footer class="main-footer"> <footer class="main-footer">
<!-- To the right --> <!-- To the right -->
<div class="pull-right hidden-xs"> <div class="float-right d-sm-none d-md-block">
<a href="#"></a><b>{{ config('app.name') }}</b></a> {{ config('app.name') }}
</div> </div>
<strong>&copy Leenooks</strong>
</footer> <!-- Default to the left -->
<strong>Copyright &copy; 2014-2018 <a href="#">&copy Leenooks</a>.</strong> All rights reserved.
</footer>

View File

@@ -1,41 +1,49 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{{ config('app.name') }} - @yield('htmlheader_title', 'Your title here') </title> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ config('app.name') }} - @yield('htmlheader_title', 'Your title here')</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<!-- CSRF Token --> <!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}"> <meta name="csrf-token" content="{{ csrf_token() }}">
<link href="{{ asset('/css/all.css') }}" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="{{ asset('/css/app.css') }}">
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="{{ asset('//use.fontawesome.com/releases/v5.13.0/css/all.css') }}">
<link rel="stylesheet" href="{{ asset('//use.fontawesome.com/releases/v5.13.0/css/v4-shims.css') }}">
<!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css2?family={{ str_replace(' ','+',config('app.font') ?: 'IBM Plex Sans') }}:wght@300&display=swap" rel="stylesheet">
@if(file_exists('css/social.css'))
<!-- Social Logins -->
<link rel="stylesheet" href="{{ asset('/css/social.css') }}">
@endif
@if(file_exists('css/print.css'))
<!-- Printing Modifications -->
<link rel="stylesheet" href="{{ asset('/css/print.css') }}">
@endif
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--> <![endif]-->
<script>
//See https://laracasts.com/discuss/channels/vue/use-trans-in-vuejs
window.trans =
@php
// copy all translations from /resources/lang/CURRENT_LOCALE/* to global JS variable
$lang_files = File::files(resource_path() . '/lang/' . App::getLocale());
$trans = [];
foreach ($lang_files as $f) {
$filename = pathinfo($f)['filename'];
$trans[$filename] = trans($filename);
}
$trans['adminlte_lang_message'] = trans('adminlte_lang::message');
echo json_encode($trans);
@endphp
</script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<style>
#favourite.selected {
color: orange;
}
</style>
<!-- STYLESHEETS --> <!-- STYLESHEETS -->
{!! Asset::styles() !!} {!! Asset::styles() !!}
<!-- Theme style -->
<link rel="stylesheet" href="{{ asset('/css/adminlte.min.css') }}">
@if(file_exists('css/fixes.css'))
<!-- CSS Fixes -->
<link rel="stylesheet" href="{{ asset('/css/fixes.css') }}">
@endif
@if(file_exists('css/custom.css'))
<!-- Custom CSS -->
<link rel="stylesheet" href="{{ asset('/css/custom.css') }}">
@endif
</head> </head>

View File

@@ -1,95 +1,158 @@
<!-- Main Header --> <!-- Main Header -->
<header class="main-header"> <!-- Navbar -->
<nav class="main-header navbar navbar-expand bg-white navbar-light border-bottom">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#"><i class="fas fa-bars"></i></a>
</li>
</ul>
<!-- Logo --> <!-- SEARCH FORM -->
<a href="{{ url('/home') }}" class="logo"> <form class="form-inline ml-3">
<!-- mini logo for sidebar mini 50x50 pixels --> <div class="input-group input-group-sm">
<span class="logo-mini">{!! config('app.name_html_short','<b>A</b>N') !!}</span> <input class="form-control form-control-navbar" name="q" type="search" placeholder="Search" aria-label="Search" autocomplete="off">
<!-- logo for regular state and mobile devices --> <div class="input-group-append">
<span class="logo-lg">{!! config('app.name_html_long','<b>App</b>Name') !!}</span> <button class="btn btn-navbar" type="submit">
</a> <i class="fas fa-search"></i>
</button>
<!-- Header Navbar --> </div>
<nav class="navbar navbar-static-top" role="navigation"> <span name="searching" class="d-none"><i class="fas fa-spinner fa-spin fa-fw" style="margin-top: .33em; width: 1em; height: 1em;"></i></span>
<!-- Sidebar toggle button--> <div id="search_results"></div>
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">{{ trans('adminlte_lang::message.togglenav') }}</span>
</a>
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<!-- Tasks Menu -->
@if (Auth::guest())
<li><a href="{{ url('/register') }}">{{ trans('adminlte_lang::message.register') }}</a></li>
<li><a href="{{ url('/login') }}">{{ trans('adminlte_lang::message.login') }}</a></li>
@else
@if (isset($topmenu))
<!-- Available Data Menu -->
<li class="dropdown tasks-menu" id="import_date">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span class="hidden-xs">Items</span>
</a>
<ul class="dropdown-menu">
<li class="header">Header</li>
<li>
<ul class="menu small">
&nbsp;
</ul>
</li>
<li class="footer"><a href="#">(Not Active)</a></li>
</ul>
</li>
@endif
<li class="dropdown user user-menu" id="user_menu">
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<!-- The user image in the navbar-->
<img src="{{ Gravatar::get($user->email) }}" class="user-image" alt="User Image"/>
<!-- hidden-xs hides the username on small devices so only the image appears. -->
<span class="hidden-xs">{{ $user->name }}</span>
</a>
<ul class="dropdown-menu">
<!-- The user image in the menu -->
<li class="user-header">
<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image" />
<p>
{{ $user->name }}
<small>{{ trans('adminlte_lang::message.login') }}: @if($user->last_access) {{ $user->last_access->format('Y-m-d') }} @else Unknown @endif</small>
</p>
</li>
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<a href="{{ url('/settings') }}" class="btn btn-default btn-flat">{{ trans('adminlte_lang::message.profile') }}</a>
</div>
<div class="pull-right">
<a href="{{ url('/logout') }}" class="btn btn-default btn-flat" id="logout"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
{{ trans('adminlte_lang::message.signout') }}
</a>
<form id="logout-form" action="{{ url('/logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
<input type="submit" value="logout" style="display: none;">
</form>
</div>
</li>
</ul>
</li>
@endif
<!-- Control Sidebar Toggle Button -->
@if (isset($controlbar))
<li>
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
</li>
@endif
</ul>
</div> </div>
</nav> </form>
</header>
<!-- Right navbar links -->
<ul class="navbar-nav ml-auto">
@include('adminlte::layouts.partials.topmenu')
@if(Auth::check())
<!-- Profile Settings -->
<li class="nav-item dropdown">
<a class="nav-link" data-toggle="dropdown" href="#">
<i class="fas fa-cog"></i>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<span class="dropdown-item dropdown-header @if($user->switched) bg-danger @endif">
@if($user->switched)
SUDO (<small>{{ $user->name ?: 'User Name' }}</small>)
@else
{{ $user->name ?: 'User Name' }}
@endif
</span>
<div class="dropdown-divider"></div>
<a href="{{ url('settings') }}" class="dropdown-item">
<i class="fas fa-user mr-2"></i> Settings
</a>
<div class="dropdown-divider"></div>
@if ($user->switched)
<a href="{{ url('/admin/switch/stop') }}" class="dropdown-item" id="switch">
<i class="fas fa-sign-out-alt mr-2"></i> {{ trans('adminlte_lang::message.switchoff') }}
</a>
@else
<a href="{{ url('logout') }}" class="dropdown-item">
<i class="fas fa-sign-out-alt mr-2"></i> Log Out
</a>
@endif
</div>
</li>
@else
<a href="{{ url()->current().'?login=1' }}" class="text-muted pr-2"><i class="fas fa-lock"></i></a>
@endif
<!-- Control Side Bar -->
@isset($controlsidebar)
<li class="nav-item">
<a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#">
<i class="fas fa-th"></i>
</a>
</li>
@endisset
</ul>
</nav>
@section('page-scripts')
<style>
/* Solid border */
div.typeahead.dropdown-menu > .dropdown-header {
color: #000000;
text-align: left;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$("input[name=q]").typeahead({
autoSelect: false,
scrollHeight: 10,
theme: 'bootstrap4',
delay: 500,
minLength: 2,
items: {{ isset($search_limit) ? $search_limit : 100 }},
fitToElement: false,
selectOnBlur: false,
appendTo: "#search_results",
source: function (query,process) {
search('{{ url("search",['date'=>isset($ido) ? $ido->id : NULL]) }}',query,process);
},
matcher: function () { return true; },
// Disable sorting and just return the items (items should by the ajax method)
sorter: function(items) {
return items;
},
updater: function (item) {
window.parent.location.href = item.value;
},
})
.on('keyup keypress', function(event) {
var key = event.keyCode || event.which;
if (key === 13) {
event.preventDefault();
return false;
}
});
});
var c=0;
var search = _.debounce(function(url,query,process,icon){
$.ajax({
url : url,
type : 'GET',
data : 'term=' + query,
dataType : 'JSON',
async : true,
cache : false,
beforeSend : function() {
if (c++ == 0) {
if (icon)
$('i[name='+icon+']').addClass("fa-spin");
else {
$('span[name=searching]').removeClass("d-none");
}
}
},
success : function(data) {
// if json is null, means no match, won't do again.
if(data==null || (data.length===0)) return;
process(data);
},
complete : function() {
if (--c == 0) {
if (icon)
$('i[name='+icon+']').removeClass("fa-spin");
else {
$('span[name=searching]').addClass("d-none");
}
}
}
})
}, 500);
</script>
@append

View File

@@ -1,13 +1,91 @@
<!-- REQUIRED JS SCRIPTS --> <!-- REQUIRED JS SCRIPTS -->
<!-- JQuery and bootstrap are required by Laravel 5.7 in resources/js/bootstrap.js-->
<!-- JQuery and bootstrap are required by Laravel 5.3 in resources/assets/js/bootstrap.js-->
<!-- Laravel App --> <!-- Laravel App -->
<script src="{{ url (mix('/js/app.js')) }}" type="text/javascript"></script> <script src="{{ asset('/js/app.js') }}" type="text/javascript"></script>
<!-- AdminLTE -->
<script src="{{ asset('/js/adminlte.min.js') }}"></script>
@yield('page-scripts') <script type="text/javascript">
<!-- Optionally, you can add Slimscroll and FastClick plugins. // Our CSRF token to each interaction
Both of these plugins are recommended to enhance the $.ajaxSetup({
user experience. Slimscroll is required when using the headers: {
fixed layout. --> 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
<script src="{{ url('/plugins/jquery.slimscroll.min.js') }}" type="text/javascript"></script> }
<script src="{{ url('/plugins/fastclick/fastclick.min.js') }}" type="text/javascript"></script> });
$.AdminLTESidebarTweak = {};
$.AdminLTESidebarTweak.Open = true;
$.AdminLTESidebarTweak.ResizeDelay = 1000;
$.AdminLTESidebarTweak.options = {
EnableRemember: true,
//Removes the transition after page reload.
NoTransitionAfterReload: false
};
// Work out our 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($.AdminLTESidebarTweak.ResizeDelay).queue(function() {
window.dispatchEvent(new Event('resize'));
$(this).dequeue();
});
}
$(function () {
"use strict";
$("body").on("collapsed.lte.pushmenu", function(){
if($.AdminLTESidebarTweak.options.EnableRemember) {
document.cookie = "toggleState=closed;path=/";
$("body").queue(sidebaropenclose(false));
}
});
$("body").on("shown.lte.pushmenu", function(){
if($.AdminLTESidebarTweak.options.EnableRemember){
document.cookie = "toggleState=opened;path=/";
$("body").queue(sidebaropenclose(true));
}
});
if($.AdminLTESidebarTweak.options.EnableRemember){
var re = new RegExp('toggleState' + "=([^;]+)");
var value = re.exec(document.cookie);
var toggleState = (value != null) ? unescape(value[1]) : null;
if(toggleState == 'closed'){
if($.AdminLTESidebarTweak.options.NoTransitionAfterReload){
$("body").addClass('sidebar-collapse hold-transition').delay(100).queue(function(){
$(this).removeClass('hold-transition');
});
}else{
$("body").queue(sidebaropenclose(false,true));
}
}
}
});
</script>
@if(file_exists('js/custom.js'))
<!-- Any Custom JS -->
<script src="{{ asset('js/custom.js') }}"></script>
@endif

View File

@@ -1,2 +0,0 @@
<!-- Compiled app javascript -->
<script src="{{ url (mix('/js/app.js')) }}"></script>

View File

@@ -1,112 +1,37 @@
<!-- Left side column. contains the logo and sidebar --> <!-- Main Sidebar Container -->
<aside class="main-sidebar"> <aside class="main-sidebar sidebar-dark-primary elevation-4 d-print-none">
<!-- Brand Logo -->
<a href="{{ url('home') }}" class="brand-link">
<img src="{{ asset('/img/logo.png') }}" alt="Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
<span class="brand-text font-weight-light">{!! config('app.name_html_long','<b>App</b>Name') !!}</span>
</a>
<!-- sidebar: style can be found in sidebar.less --> <!-- Sidebar -->
<section class="sidebar"> <div class="sidebar">
<!-- Sidebar user panel (optional) -->
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image">
@if($user->exists)
<img src="{{ Gravatar::get(($user->exists AND $user->email) ? $user->email : 'nobody@example.com') }}" class="img-circle elevation-2" alt="User">
@else
<a name="login" href="{{ url()->current().'?login=1' }}" class="d-block"><i class="pl-1 fas fa-lock fa-2x"></i></a>
@endif
</div>
<!-- Sidebar user panel (optional) --> <div class="info">
@if (! Auth::guest()) <a href="{{ url('login') }}" class="d-block">{{ $user->exists ? ($user->name ?: 'No Name') : 'Login' }}</a>
<div class="user-panel"> @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 class="pull-left image"> </div>
<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image" /> </div>
</div>
<div class="pull-left info">
<p>{{ Auth::user()->name }}</p>
<!-- Status -->
<a href="#"><i class="fa fa-circle text-success"></i> {{ trans('adminlte_lang::message.online') }}</a>
</div>
</div>
@endif
<!-- search form (Optional) --> <!-- Sidebar Menu -->
<form action="#" method="get" class="sidebar-form"> <nav class="mt-2">
<div class="input-group"> <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<input type="text" name="q" class="form-control" autocomplete="off" placeholder="{{ trans('adminlte_lang::message.search') }}..."/> <!-- Add icons to the links using the .nav-icon class with font-awesome or any other icon font library -->
<span class="input-group-btn"> @include('adminlte::layouts.partials.sidebarmenu')
<button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button> </ul>
</span> </nav>
</div>
</form>
<!-- /.search form -->
<!-- Sidebar Menu -->
@include('adminlte::layouts.partials.sidebarmenu')
<!-- /.sidebar-menu --> <!-- /.sidebar-menu -->
</section> </div>
<!-- /.sidebar --> <!-- /.sidebar -->
</aside> </aside>
@section('page-scripts')
<script src="{{ url('/plugins/bootstrap3-typeahead.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function() {
$("input[name=q]").typeahead({
delay: 300,
minLength: 2,
fitToElement: false,
appendTo: "#search_results",
source: function (query,process) {
search('{{ url("search",['date'=>isset($ido) ? $ido->id : NULL]) }}',query,process);
},
matcher: function () { return true; },
updater: function (item) {
window.parent.location.href = '{{ url("/") }}'+users[item];
},
})
.on('keyup keypress', function(event) {
var key = event.keyCode || event.which;
if (key === 13) {
event.preventDefault();
return false;
}
});
});
var c=0;
var search = _.debounce(function(url,query,process,icon){
$.ajax({
url : url,
type : 'GET',
data : 'term=' + query,
dataType : 'JSON',
async : false,
cache : false,
beforeSend : function() {
if (c++ == 0) {
if (icon)
$('i[name='+icon+']').addClass("fa-spin");
else
$('i[name=searching]').removeClass("hidden");
}
},
success : function(data) {
// if json is null, means no match, won't do again.
if(data==null || (data.length===0)) return;
users = {};
userLabels = [];
_.each(data,function(item,ix,list) {
if (_.includes(users,item.label))
item.label = item.label + ' #' + item.value;
userLabels.push(item.label);
users[item.label] = item.value;
});
process(userLabels);
},
complete : function() {
if (--c == 0) {
if (icon)
$('i[name='+icon+']').removeClass("fa-spin");
else
$('i[name=searching]').addClass("hidden");
}
}
})
}, 500);
</script>
@append

View File

@@ -1,5 +1,11 @@
<ul class="sidebar-menu" data-widget="tree"> <li class="nav-header">MAIN</li>
<li class="header">Menu</li>
<!-- Optionally, you can add icons to the links --> <li class="nav-item">
<li @if(Route::current()->getName() == 'home')class="active"@endif><a href="{{ url('home',['date'=>(isset($ido) ? $ido->id : NULL)]) }}"><i class='fa fa-link'></i> <span>{{ trans('adminlte_lang::message.home') }}</span></a></li> <a href="#" class="nav-link @if(Route::current()->getName() == 'home') active @endif">
</ul> <i class="nav-icon fas fa-th"></i>
<p>
My Link Title
<span class="right badge badge-danger">New</span>
</p>
</a>
</li>

View File

@@ -0,0 +1,7 @@
{{--
@foreach ($topmenu as $url => $title)
<li class="nav-item d-none d-sm-inline-block">
<a href="{{ $url }}" class="nav-link">{{ $title }}</a>
</li>
@endforeach
--}}

View File

@@ -0,0 +1,23 @@
<!-- Success -->
@if(session()->has('success'))
<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h5><i class="icon fas fa-check"></i> Success!</h5>
<ul>
<li>{{ session()->get('success') }}</li>
</ul>
</div>
@endif
<!-- Errors -->
@if ($errors->any())
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h5><i class="icon fas fa-ban"></i> Whoops!</h5>
<ul>
@foreach ($errors->all() as $error)
<li>{!! $error !!}</li>
@endforeach
</ul>
</div>
@endif

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

@@ -0,0 +1,66 @@
<?php
namespace Leenooks\Commands;
use Illuminate\Console\Command;
use Illuminate\Console\Scheduling\Schedule;
class ScheduleList extends Command
{
protected $signature = 'schedule:list';
protected $description = 'List when scheduled commands are executed.';
/**
* @var Schedule
*/
protected $schedule;
/**
* ScheduleList constructor.
*
* @param Schedule $schedule
*/
public function __construct(Schedule $schedule)
{
parent::__construct();
$this->schedule = $schedule;
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$events = array_map(function ($event) {
return [
'cron' => $event->expression,
'command' => static::fixupCommand($event->command),
];
}, $this->schedule->events());
$this->table(
['Cron', 'Command'],
$events
);
}
/**
* If it's an artisan command, strip off the PHP
*
* @param $command
* @return string
*/
protected static function fixupCommand($command)
{
$parts = explode(' ', $command);
if (count($parts) > 2 && $parts[1] === "'artisan'") {
array_shift($parts);
}
return implode(' ', $parts);
}
}

View File

@@ -0,0 +1,54 @@
<?php
namespace Leenooks\Controllers;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Controller;
use Redirect;
use Session;
use App\User;
class AdminController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function switch_authorised($id)
{
return (method_exists(Auth::user(),'isAdmin') && Auth::user()->isAdmin($id)) ? TRUE : FALSE;
}
public function switch_session()
{
return ! Session::get('orig_user');
}
public function user_switch_start($id)
{
if ($this->switch_session() AND $this->switch_authorised($id))
{
$uo = User::find($id);
if (! $uo)
abort(404,'User not found');
Session::put('orig_user',Auth::id());
Auth::login($uo);
}
return Redirect::to('/home');
}
public function user_switch_stop()
{
if ($id = Session::pull('orig_user')) {
$uo = User::find($id);
Auth::login($uo);
}
return Redirect::to('/home');
}
}

29
src/GuestUser.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
namespace Leenooks;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class GuestUser extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
}

View File

@@ -0,0 +1,27 @@
<?php
namespace Leenooks\Http\Middleware;
use Closure;
/**
* Class GuestUser
* @package Leenooks\Laravel\Http\Middleware
*/
class GuestUser
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
view()->share('loggedin',auth()->check());
view()->share('user', auth()->user() ?: new \Leenooks\GuestUser);
return $next($request);
}
}

View File

@@ -2,6 +2,7 @@
namespace Leenooks\Providers; namespace Leenooks\Providers;
use Leenooks\Http\Middleware\GuestUser;
use Illuminate\Routing\Router; use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
@@ -12,60 +13,58 @@ use Illuminate\Support\ServiceProvider;
*/ */
class LeenooksServiceProvider extends ServiceProvider class LeenooksServiceProvider extends ServiceProvider
{ {
private $_path = ''; private $_path = '';
/** /**
* Bootstrap the application services. * Bootstrap the application services.
* *
* @param Router $router * @param Router $router
*/ */
public function boot(Router $router) public function boot(Router $router)
{ {
$this->loadViewsFrom($this->_path.'/resources/themes/adminlte/views/', 'adminlte'); $router->pushMiddlewareToGroup('web',GuestUser::class);
$this->loadTranslationsFrom($this->_path.'/resources/themes/adminlte/lang/', 'adminlte_lang');
// Enable a recusive() collection function so that we can just arrives in config/*.php $this->loadViewsFrom($this->_path.'/resources/themes/adminlte/views/', 'adminlte');
\Illuminate\Support\Collection::macro('recursive', function () { $this->loadTranslationsFrom($this->_path.'/resources/themes/adminlte/lang/', 'adminlte_lang');
return $this->map(function ($value) {
if (is_array($value) || is_object($value)) {
return collect($value)->recursive();
}
return $value; // Enable a Collect::recursive() function
\Illuminate\Support\Collection::macro('recursive', function () {
return $this->map(function ($value) {
if (is_array($value) || is_object($value)) {
return collect($value)->recursive();
}
return $value;
});
}); });
}); }
}
/** /**
* Register the application services. * Register the application services.
* *
* @return void * @return void
*/ */
public function register() public function register()
{ {
if (! $this->_path) { if (! $this->_path) {
$this->_path = realpath(__DIR__.'/../../'); $this->_path = realpath(__DIR__.'/../../');
} }
} }
/** /**
* Views copy path. * Views copy path.
* *
* @return array * @return array
*/ */
public function views() public function views()
{ {
return [ return [
$this->_path.'/resources/views/auth' => $this->_path.'/resources/views/auth' => resource_path('views/vendor/adminlte/auth'),
resource_path('views/vendor/adminlte/auth'), $this->_path.'/resources/views/errors' => resource_path('views/vendor/adminlte/errors'),
$this->_path.'/resources/views/errors' => $this->_path.'/resources/views/layouts' => resource_path('views/vendor/adminlte/layouts'),
resource_path('views/vendor/adminlte/errors'), $this->_path.'/resources/views/home.blade.php' => resource_path('views/vendor/adminlte/home.blade.php'),
$this->_path.'/resources/views/layouts' => $this->_path.'/resources/views/welcome.blade.php' => resource_path('views/welcome.blade.php'),
resource_path('views/vendor/adminlte/layouts'), ];
$this->_path.'/resources/views/home.blade.php' => }
resource_path('views/vendor/adminlte/home.blade.php'), }
$this->_path.'/resources/views/welcome.blade.php' =>
resource_path('views/welcome.blade.php'),
];
}
}

View File

@@ -0,0 +1,57 @@
<?php
namespace Leenooks\Traits;
use Illuminate\Database\Eloquent\Builder;
/**
* Trait CompositeKeys
* Enable Models to have multiple primary keys
*
* Need to add to the Model...
* public $incrementing = false;
* protected $primaryKey = [<ARRAY_OF_KEYS>];
*
* @package Leenooks\Traits
*/
trait CompositeKeys {
/**
* Set the keys for a save update query.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
protected function setKeysForSaveQuery(Builder $query)
{
$keys = $this->getKeyName();
if (! is_array($keys)) {
return parent::setKeysForSaveQuery($query);
}
foreach($keys as $keyName) {
$query->where($keyName, '=', $this->getKeyForSaveQuery($keyName));
}
return $query;
}
/**
* Get the primary key value for a save query.
*
* @param mixed $keyName
* @return mixed
*/
protected function getKeyForSaveQuery($keyName = null)
{
if (is_null($keyName)) {
$keyName = $this->getKeyName();
}
if (isset($this->original[$keyName])) {
return $this->original[$keyName];
}
return $this->getAttribute($keyName);
}
}

21
src/Traits/UserSwitch.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
/**
* Check if users have been switched
*/
namespace Leenooks\Traits;
use Session;
trait UserSwitch
{
public function getSwitchedAttribute()
{
return Session::get('orig_user');
}
public function isAdmin($id)
{
return isset($this->admin) ? $this->admin : FALSE;
}
}

29
src/helpers.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
// is_json helper
if (! function_exists('is_json')) {
function is_json($string) {
try {
json_decode($string);
} catch (\Exception $e) {
return FALSE;
}
return (json_last_error() == JSON_ERROR_NONE);
}
}
// Inverse of array_dot()
if (! function_exists('array_undot')) {
function array_undot($dotNotationArray)
{
$array = [];
foreach ($dotNotationArray as $key => $value) {
\Illuminate\Support\Arr::set($array, $key, $value);
}
return $array;
}
}