Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f131db31c6 | ||
|
8b83990a66 | ||
|
4472202afb | ||
|
2040266ab2 | ||
|
1774987dea | ||
|
6c60298e8f | ||
|
41b320a5b9 | ||
|
1096f0e28d | ||
|
b0730b9ed3 | ||
|
163a7f2587 | ||
|
4f2707a374 | ||
|
0ca66c6d1c | ||
|
5833122ab5 | ||
|
a946ce4418 | ||
|
e5ff189d3e | ||
|
1efdfca55f |
@@ -10,10 +10,9 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"igaster/laravel-theme": "^2.0",
|
"igaster/laravel-theme": "^2.0.15",
|
||||||
"acacha/user": "^0.2.2",
|
|
||||||
"creativeorange/gravatar": "^1.0",
|
"creativeorange/gravatar": "^1.0",
|
||||||
"orchestra/asset": "^3.6"
|
"orchestra/asset": "^4.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
},
|
},
|
||||||
|
@@ -29,11 +29,11 @@ return [
|
|||||||
'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',
|
'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',
|
||||||
|
@@ -5,7 +5,16 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="login-box">
|
@if(isset($login_note) AND $login_note)
|
||||||
|
<div class="alert alert-info alert-dismissible m-auto">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
<h5><i class="icon fa fa-info"></i> NOTE!</h5>
|
||||||
|
{!! $login_note !!}
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
@endisset
|
||||||
|
|
||||||
|
<div class="login-box m-auto">
|
||||||
<div class="login-logo">
|
<div class="login-logo">
|
||||||
<a>{!! config('app.name_html_long') !!}</a>
|
<a>{!! config('app.name_html_long') !!}</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,6 +30,15 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if (Session::has('error'))
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
|
||||||
|
<ul>
|
||||||
|
<li>{{ Session::get('error') }}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<!-- /.login-logo -->
|
<!-- /.login-logo -->
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body login-card-body">
|
<div class="card-body login-card-body">
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<!-- Compiled app javascript -->
|
<!-- Compiled app javascript -->
|
||||||
<script src="{{ url (mix('/js/app.js')) }}"></script>
|
<script src="{{ asset('/js/app.js') }}"></script>
|
||||||
<!-- iCheck -->
|
<!-- iCheck -->
|
||||||
<script src="{{ asset('/plugin/iCheck/icheck.min.js') }}"></script>
|
<script src="{{ asset('/plugin/iCheck/icheck.min.js') }}"></script>
|
||||||
|
|
||||||
|
@@ -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)
|
||||||
|
@@ -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)
|
||||||
|
@@ -12,10 +12,10 @@
|
|||||||
<link rel="stylesheet" href="{{ asset('/plugin/font-awesome/css/font-awesome.min.css') }}">
|
<link rel="stylesheet" href="{{ asset('/plugin/font-awesome/css/font-awesome.min.css') }}">
|
||||||
<!-- IonIcons -->
|
<!-- IonIcons -->
|
||||||
<link rel="stylesheet" href="{{ request()->getScheme() }}://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
|
<link rel="stylesheet" href="{{ request()->getScheme() }}://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
|
||||||
<!-- Theme style -->
|
|
||||||
<link rel="stylesheet" href="{{ asset('/css/adminlte.min.css') }}">
|
|
||||||
<!-- Google Font: Source Sans Pro -->
|
<!-- Google Font: Source Sans Pro -->
|
||||||
<link href="{{ request()->getScheme() }}://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
|
<link href="{{ request()->getScheme() }}://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
|
||||||
|
|
||||||
@if(file_exists('css/social.css'))
|
@if(file_exists('css/social.css'))
|
||||||
<!-- Social Logins -->
|
<!-- Social Logins -->
|
||||||
<link rel="stylesheet" href="{{ asset('/css/social.css') }}">
|
<link rel="stylesheet" href="{{ asset('/css/social.css') }}">
|
||||||
@@ -32,28 +32,19 @@
|
|||||||
<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
|
|
||||||
// @todo Cache this processing
|
|
||||||
// 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>
|
|
||||||
|
|
||||||
<!-- STYLESHEETS -->
|
<!-- STYLESHEETS -->
|
||||||
{!! Asset::styles() !!}
|
{!! Asset::styles() !!}
|
||||||
|
|
||||||
|
<!-- Theme style -->
|
||||||
|
<link rel="stylesheet" href="{{ asset('/css/adminlte.min.css') }}">
|
||||||
|
|
||||||
@if(file_exists('css/fixes.css'))
|
@if(file_exists('css/fixes.css'))
|
||||||
<!-- CSS Fixes -->
|
<!-- CSS Fixes -->
|
||||||
<link rel="stylesheet" href="{{ asset('/css/fixes.css') }}">
|
<link rel="stylesheet" href="{{ asset('/css/fixes.css') }}">
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if(file_exists('css/custom.css'))
|
||||||
|
<!-- Custom CSS -->
|
||||||
|
<link rel="stylesheet" href="{{ asset('/css/custom.css') }}">
|
||||||
|
@endif
|
||||||
</head>
|
</head>
|
@@ -11,7 +11,7 @@
|
|||||||
<!-- SEARCH FORM -->
|
<!-- SEARCH FORM -->
|
||||||
<form class="form-inline ml-3">
|
<form class="form-inline ml-3">
|
||||||
<div class="input-group input-group-sm">
|
<div class="input-group input-group-sm">
|
||||||
<input class="form-control form-control-navbar" name="q" type="search" placeholder="Search" aria-label="Search">
|
<input class="form-control form-control-navbar" name="q" type="search" placeholder="Search" aria-label="Search" autocomplete="off">
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
<button class="btn btn-navbar" type="submit">
|
<button class="btn btn-navbar" type="submit">
|
||||||
<i class="fa fa-search"></i>
|
<i class="fa fa-search"></i>
|
||||||
@@ -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 -->
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<!-- 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.7 in resources/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 -->
|
<!-- AdminLTE -->
|
||||||
<script src="{{ asset('/js/adminlte.min.js') }}"></script>
|
<script src="{{ asset('/js/adminlte.min.js') }}"></script>
|
||||||
|
|
||||||
@@ -21,6 +21,9 @@
|
|||||||
NoTransitionAfterReload: false
|
NoTransitionAfterReload: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Work out our timezone.
|
||||||
|
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
@@ -57,9 +60,19 @@
|
|||||||
$(this).removeClass('hold-transition');
|
$(this).removeClass('hold-transition');
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
$("body").addClass('sidebar-collapse');
|
$("body")
|
||||||
|
.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
|
@@ -11,10 +11,16 @@
|
|||||||
<!-- Sidebar user panel (optional) -->
|
<!-- Sidebar user panel (optional) -->
|
||||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||||
<div class="image">
|
<div class="image">
|
||||||
<img src="{{ Gravatar::get(($user->exists AND $user->email) ? $user->email : 'nobody@example.com') }}" class="img-circle elevation-2" alt="User">
|
@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 fa fa-3x fa-lock"></i></a>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<a href="{{ url('login') }}" class="d-block">{{ $user->name ?: 'Nobody' }}</a>
|
<a href="{{ url('login') }}" class="d-block">{{ $user->exists ? ($user->name ?: 'No Name') : 'Login' }}</a>
|
||||||
|
@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>
|
||||||
|
|
||||||
|
29
src/GuestUser.php
Normal file
29
src/GuestUser.php
Normal 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',
|
||||||
|
];
|
||||||
|
}
|
27
src/Http/Middleware/GuestUser.php
Normal file
27
src/Http/Middleware/GuestUser.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
@@ -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'),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user