Update for laravel 5.7 and adminlte v3-alpha

This commit is contained in:
Deon George 2019-02-08 23:42:58 +11:00
parent 11a321603c
commit 062b1bce8c
20 changed files with 364 additions and 519 deletions

View File

@ -5,50 +5,72 @@
@endsection @endsection
@section('content') @section('content')
<body class="hold-transition login-page"> <div class="login-box">
<div id="app" v-cloak> <div class="login-logo">
<div class="login-box"> <a>{!! config('app.name_html_long') !!}</a>
<div class="login-logo"> </div>
<a href="{{ url('/home') }}">{!! config('app.name_html_long') !!}</a>
</div><!-- /.login-logo -->
@if (count($errors) > 0) @if (count($errors) > 0)
<div class="alert alert-danger"> <div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br> <strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
<ul> <ul>
@foreach ($errors->all() as $error) @foreach ($errors->all() as $error)
<li>{{ $error }}</li> <li>{{ $error }}</li>
@endforeach @endforeach
</ul> </ul>
</div> </div>
@endif @endif
<div class="login-box-body"> <!-- /.login-logo -->
<div class="card">
<div class="card-body login-card-body">
<p class="login-box-msg">{{ trans('adminlte_lang::message.siginsession') }}</p> <p class="login-box-msg">{{ trans('adminlte_lang::message.siginsession') }}</p>
<login-form name="{{ config('auth.providers.users.field','email') }}" <form method="post">
domain="{{ config('auth.defaults.domain','') }}"></login-form> <div class="input-group mb-3">
<input type="email" name="email" class="form-control" placeholder="Email">
<a href="{{ url('/password/reset') }}">{{ trans('adminlte_lang::message.forgotpassword') }}</a><br> <div class="input-group-append">
<span class="fa fa-envelope input-group-text"></span>
</div>
</div>
<div class="input-group mb-3">
<input type="password" name="password" class="form-control" placeholder="Password">
<div class="input-group-append">
<span class="fa fa-lock input-group-text"></span>
</div>
</div>
<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 btn-block btn-flat">Sign In</button>
</div>
<!-- /.col -->
</div>
</form>
@if(count(config('auth.social',[]))) @if(count(config('auth.social',[])))
@include('adminlte::auth.partials.social_login') @include('adminlte::auth.partials.social_login')
@endif @endif
</div><!-- /.login-box-body -->
</div><!-- /.login-box --> <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="register.html" class="text-center">Register a new membership</a>
</p>
@endisset
</div>
<!-- /.login-card-body -->
</div>
</div> </div>
<!-- /.login-box -->
@include('adminlte::layouts.partials.scripts_auth')
<script>
$(function () {
$('input').iCheck({
checkboxClass: 'icheckbox_square-blue',
radioClass: 'iradio_square-blue',
increaseArea: '20%' // optional
});
});
</script>
</body>
@endsection @endsection

View File

@ -0,0 +1,14 @@
<!-- Compiled app javascript -->
<script src="{{ url (mix('/js/app.js')) }}"></script>
<!-- iCheck -->
<script src="/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 btn-{{ $o['class'] }}">
<i class="fa fa-{{ $o['icon'] }} mr-2"></i> {{ trans('adminlte_lang::message.sign'.$o['name']) }}
</a>
@endforeach @endforeach
</div><!-- /.social-auth-links --> </div>
<!-- /.social-auth-links -->

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') }}">{!! 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
<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,44 +1,46 @@
<!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 hold-transition skin-blue sidebar-mini">
<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">
@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() !!}
@yield('page-scripts')
@show @show
</body> <body class="hold-transition sidebar-mini">
<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">
@include('adminlte::layouts.partials.contentheader')
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<!-- Your Page Content Here -->
@yield('main-content')
</div>
</section><!-- /.content -->
</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="/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,23 @@
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <div class="content-header">
<div id="search_results"></div> <div class="container-fluid">
<h1> <div class="row mb-2">
@yield('contentheader_title', 'Content Title') <div class="col-sm-6">
<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> <div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
@isset($breadcrumb) <li class="breadcrumb-item"><a href="{{ url('/home'.(isset($ido) ? '/'.$ido->id : '')) }}">Home</a></li>
@foreach ($breadcrumb as $item => $url) @isset($breadcrumb)
<li><a href="{{url($url)}}">{{ $item }}</a></li> @foreach ($breadcrumb as $item => $url)
@endforeach <li class="breadcrumb-item"><a href="{{url($url)}}">{{ $item }}</a></li>
@endisset @endforeach
</ol> <!-- /.breadcrumb --> @endisset
</section> <!-- /.content-header --> <li class="breadcrumb-item active">@yield('contentheader_title', 'Content 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 no-print"> <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>
<!-- Default to the left -->
<strong>Copyright &copy; 2014-2018 <a href="#">&copy Leenooks</a>.</strong> All rights reserved.
</footer> </footer>

View File

@ -6,47 +6,31 @@
<!-- 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 href="{{ asset('/css/app.css') }}" rel="stylesheet" type="text/css" />
<!-- Font Awesome Icons -->
<link rel="stylesheet" href="/plugin/font-awesome/css/font-awesome.min.css">
<!-- IonIcons -->
<link rel="stylesheet" href="//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="/css/adminlte.min.css">
<!-- Google Font: Source Sans Pro -->
<link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
<!-- Printing Modifications -->
<link rel="stylesheet" href="/css/print.css">
<!-- 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]-->
<style type="text/css">
@media screen, print {
body {
color: #333;
font-weight: 400;
font-size: 14px;
}
label {
font-weight: bold;
}
}
@media print {
body {
font-size: 12px;
}
tr { page-break-inside:avoid; }
thead { display:table-header-group; }
tfoot { display:table-footer-group; }
.table-responsive {
overflow: visible !important;
}
}
</style>
<script> <script>
//See https://laracasts.com/discuss/channels/vue/use-trans-in-vuejs //See https://laracasts.com/discuss/channels/vue/use-trans-in-vuejs
window.trans = window.trans =
@php @php
// @todo Cache this processing
// copy all translations from /resources/lang/CURRENT_LOCALE/* to global JS variable // copy all translations from /resources/lang/CURRENT_LOCALE/* to global JS variable
$lang_files = File::files(resource_path() . '/lang/' . App::getLocale()); $lang_files = File::files(resource_path() . '/lang/' . App::getLocale());
$trans = []; $trans = [];

View File

@ -1,104 +1,135 @@
<!-- 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="fa fa-bars"></i></a>
</li>
<!-- Logo --> </ul>
<a href="{{ url('/home') }}" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini">{!! config('app.name_html_short','<b>A</b>N') !!}</span>
<!-- logo for regular state and mobile devices -->
<span class="logo-lg">{!! config('app.name_html_long','<b>App</b>Name') !!}</span>
</a>
<!-- Header Navbar --> <!-- SEARCH FORM -->
<nav class="navbar navbar-static-top" role="navigation"> <form class="form-inline ml-3">
<!-- Sidebar toggle button--> <div class="input-group input-group-sm">
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button"> <input class="form-control form-control-navbar" name="q" type="search" placeholder="Search" aria-label="Search">
<span class="sr-only">{{ trans('adminlte_lang::message.togglenav') }}</span> <div class="input-group-append">
</a> <button class="btn btn-navbar" type="submit">
<!-- Navbar Right Menu --> <i class="fa fa-search"></i>
<div class="navbar-custom-menu"> </button>
<ul class="nav navbar-nav"> </div>
<!-- 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
<!-- Top Menu Items -->
@include('adminlte::layouts.partials.topmenu')
<li class="dropdown user user-menu @if($user->switched) bg-red @endif" 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">
@if ($user->switched)
<a href="{{ url('/admin/switch/stop') }}" class="btn btn-default btn-flat" id="switch">
{{ trans('adminlte_lang::message.switchoff') }}
</a>
@else
<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>
@endif
</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="fa fa-cog"></i>
</a>
<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
<span class="dropdown-item dropdown-header">{{ $user->name ?: 'User Name' }}</span>
<div class="dropdown-divider"></div>
<a href="{{ url('settings') }}" class="dropdown-item">
<i class="fa fa-user mr-2"></i> Settings
</a>
<div class="dropdown-divider"></div>
<a href="{{ url('logout') }}" class="dropdown-item">
<i class="fa fa-sign-out mr-2"></i> Log Out
</a>
</div>
</li>
@endif
<!-- Control Side Bar -->
@isset($controlsidebar)
<li class="nav-item">
<a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#">
<i class="fa fa-th-large"></i>
</a>
</li>
@endisset
</ul>
</nav>
@section('page-scripts')
@js('/plugin/bootstrap3-typeahead/js/bootstrap3-typeahead.min.js','bs-typeahead')
<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,8 +1,9 @@
<!-- 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="{{ url(mix('/js/app.js')) }}" type="text/javascript"></script>
<!-- AdminLTE -->
<script src="/js/adminlte.min.js"></script>
<!-- Our our CSRF token to each interaction --> <!-- Our our CSRF token to each interaction -->
{{-- @todo Test that we are validating this, also axios should be doing this for us? --}} {{-- @todo Test that we are validating this, also axios should be doing this for us? --}}
@ -12,49 +13,4 @@
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
} }
}); });
$.AdminLTESidebarTweak = {};
$.AdminLTESidebarTweak.options = {
EnableRemember: true,
//Removes the transition after page reload.
NoTransitionAfterReload: false
};
$(function () {
"use strict";
$("body").on("collapsed.pushMenu", function(){
if($.AdminLTESidebarTweak.options.EnableRemember){
document.cookie = "toggleState=closed";
}
});
$("body").on("expanded.pushMenu", function(){
if($.AdminLTESidebarTweak.options.EnableRemember){
document.cookie = "toggleState=opened";
}
});
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").addClass('sidebar-collapse');
}
}
}
});
</script> </script>
<!-- Optionally, you can add Slimscroll and FastClick plugins.
Both of these plugins are recommended to enhance the
user experience. Slimscroll is required when using the
fixed layout. -->
@js('/site/js/jquery.slimscroll.min.js','jq.slimscroll')
@js('/site/js/fastclick.min.js','jq.fastclick')

View File

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

View File

@ -1,112 +1,31 @@
<!-- Left side column. contains the logo and sidebar --> <!-- Main Sidebar Container -->
<aside class="main-sidebar"> <aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="{{ url('home') }}" class="brand-link">
<img src="/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">
<img src="{{ Gravatar::get($user->exists ? $user->email : 'nobody@example.com') }}" class="img-circle elevation-2" alt="User">
</div>
<div class="info">
<a class="d-block">{{ $user->name ?: 'Nobody' }}</a>
</div>
</div>
<!-- Sidebar user panel (optional) --> <!-- Sidebar Menu -->
@if (! Auth::guest()) <nav class="mt-2">
<div class="user-panel"> <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<div class="pull-left image"> <!-- Add icons to the links using the .nav-icon class with font-awesome or any other icon font library -->
<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image" /> @include('adminlte::layouts.partials.sidebarmenu')
</div> </ul>
<div class="pull-left info"> </nav>
<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) -->
<form action="#" method="get" class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" autocomplete="off" placeholder="{{ trans('adminlte_lang::message.search') }}..."/>
<span class="input-group-btn">
<button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i></button>
</span>
</div>
</form>
<!-- /.search form -->
<!-- Sidebar Menu -->
@include('adminlte::layouts.partials.sidebarmenu')
<!-- /.sidebar-menu --> <!-- /.sidebar-menu -->
</section> </div>
<!-- /.sidebar --> <!-- /.sidebar -->
</aside> </aside>
@section('page-scripts')
@js('/site/js/bootstrap3-typeahead.min.js','bs-typeahead')
<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"><b>MENU</b></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 fa 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
--}}