Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
b5c8e41e78 | |||
a69049c4ff | |||
fd3487f9b0 | |||
4b541857d7 | |||
4e9bdca2f5 | |||
e0333e352a | |||
f44d780e19 | |||
46df11f087 | |||
dc8983aa91 | |||
|
9db703d88f | ||
|
05d3caddf4 | ||
|
e3ebef90d9 | ||
|
d494400e7e | ||
|
61f38aefe7 | ||
|
8e9ca4c531 | ||
|
2e512cc3ed | ||
|
9ef7e8e626 | ||
|
c9cd560b36 | ||
|
b3471f31a0 | ||
|
71712d445f | ||
|
ef210651aa | ||
|
cbfd13ffce | ||
|
d9896fbe93 | ||
|
d376c79fad | ||
|
ab86ddc386 | ||
|
e3e43b87f4 | ||
|
0507dc83d8 |
@ -1,35 +1,33 @@
|
||||
{
|
||||
"name": "leenooks/laravel",
|
||||
"description": "Leenooks standard templates and tools.",
|
||||
"keywords": ["laravel", "leenooks"],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Deon George",
|
||||
"email": "deon@leenooks.net"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"igaster/laravel-theme": "^2.0.17",
|
||||
"creativeorange/gravatar": "^1.0",
|
||||
"orchestra/asset": "^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Leenooks\\": "src"
|
||||
},
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Leenooks\\Providers\\LeenooksServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
"name": "laravel/leenooks",
|
||||
"description": "Leenooks standard templates and tools.",
|
||||
"keywords": ["laravel","leenooks"],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Deon George",
|
||||
"email": "deon@dege.au"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Leenooks\\": "src"
|
||||
},
|
||||
"files": [
|
||||
"src/helpers.php"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Leenooks\\Providers\\LeenooksServiceProvider",
|
||||
"Leenooks\\Providers\\CustomBladeServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
}
|
||||
|
@ -39,9 +39,6 @@
|
||||
@section('scripts')
|
||||
@include('adminlte::layouts.partials.scripts')
|
||||
|
||||
{{-- Scripts --}}
|
||||
{!! Asset::scripts() !!}
|
||||
|
||||
@yield('page-scripts')
|
||||
@show
|
||||
</body>
|
||||
|
@ -6,16 +6,19 @@
|
||||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
|
||||
{{--
|
||||
<!-- Included in adminlte -->
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
|
||||
--}}
|
||||
|
||||
<!-- Font Awesome Icons -->
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.15.3/css/all.css">
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.15.4/css/all.css">
|
||||
{{--
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.15.3/css/v4-shims.css">
|
||||
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.15.4/css/v4-shims.css">
|
||||
--}}
|
||||
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/admin-lte@3.1.0/dist/css/adminlte.min.css">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/admin-lte@3.2.0/dist/css/adminlte.min.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">
|
||||
@ -38,9 +41,6 @@
|
||||
<![endif]-->
|
||||
--}}
|
||||
|
||||
<!-- STYLESHEETS -->
|
||||
{!! Asset::styles() !!}
|
||||
|
||||
@yield('page-styles')
|
||||
|
||||
@if(file_exists('css/fixes.css'))
|
||||
|
@ -83,7 +83,7 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("input[name=q]").typeahead({
|
||||
$('input[name=q]').typeahead({
|
||||
autoSelect: false,
|
||||
scrollHeight: 10,
|
||||
theme: 'bootstrap4',
|
||||
@ -149,6 +149,11 @@
|
||||
$('span[name=searching]').addClass("d-none");
|
||||
}
|
||||
}
|
||||
},
|
||||
statusCode: {
|
||||
401: function() {
|
||||
window.parent.location.href = '{{ route('login') }}';
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 500);
|
||||
|
@ -2,9 +2,9 @@
|
||||
<!-- Bootstrap & Jquery App -->
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ==" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-Piv4xVNRyMGpqkS2by6br4gNJ7DXjqk09RmUpJ8jgGtD7zP9yug3goQfGII0yAns" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-fQybjgWLrvvRgtW6bFlB7jaZrFsaBXjsOMm/tB9LTS58ONXgqbR9W8oWht/amnpF" crossorigin="anonymous"></script>
|
||||
<!-- AdminLTE -->
|
||||
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/admin-lte@3.1.0/dist/js/adminlte.min.js"></script>
|
||||
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/admin-lte@3.2.0/dist/js/adminlte.min.js"></script>
|
||||
|
||||
<!-- Additional Utilities -->
|
||||
<script src="{{ asset('plugin/bootstrap3-typeahead/js/bootstrap3-typeahead.min.js') }}"></script>
|
||||
@ -44,7 +44,7 @@
|
||||
$.AdminLTESidebarTweak.Open = state;
|
||||
|
||||
if (addclass !== 'undefined')
|
||||
$("body")
|
||||
$('body')
|
||||
.addClass(state ? 'sidebar-open' : 'sidebar-collapse');
|
||||
|
||||
$(this).delay($.AdminLTESidebarTweak.ResizeDelay).queue(function() {
|
||||
@ -56,7 +56,7 @@
|
||||
$(function () {
|
||||
"use strict";
|
||||
|
||||
$("body").on("collapsed.lte.pushmenu", function(){
|
||||
$('body').on('collapsed.lte.pushmenu', function(){
|
||||
if($.AdminLTESidebarTweak.options.EnableRemember) {
|
||||
document.cookie = "toggleState=closed;path=/";
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
$("body").on("shown.lte.pushmenu", function(){
|
||||
$('body').on('shown.lte.pushmenu', function(){
|
||||
if($.AdminLTESidebarTweak.options.EnableRemember){
|
||||
document.cookie = "toggleState=opened;path=/";
|
||||
|
||||
@ -89,6 +89,18 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('body')
|
||||
.addClass('sidebar-collapse')
|
||||
.delay(500)
|
||||
.queue(function () {
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
$(this).dequeue();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@if(file_exists('js/custom.js'))
|
||||
<!-- Any Custom JS -->
|
||||
<script src="{{ asset('js/custom.js') }}"></script>
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
||||
<div class="image">
|
||||
@if(isset($user) AND $user->exists)
|
||||
<img src="{{ Gravatar::get(($user->exists AND $user->email) ? $user->email : 'nobody@example.com') }}" class="img-circle elevation-2" alt="User">
|
||||
<i class="fa fa-fw fa-2x fa-user text-white"></i>
|
||||
@else
|
||||
<a name="login" href="{{ url()->current().'?login=1' }}" class="d-block"><i class="pl-1 fas fa-lock fa-2x"></i></a>
|
||||
@endif
|
||||
|
12
resources/themes/adminlte/views/widget/errors.blade.php
Normal file
12
resources/themes/adminlte/views/widget/errors.blade.php
Normal file
@ -0,0 +1,12 @@
|
||||
<!-- Errors -->
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h5><i class="icon fas fa-ban"></i> Whoops!</h5>
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{!! $error !!}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
17
resources/themes/adminlte/views/widget/form_date.blade.php
Normal file
17
resources/themes/adminlte/views/widget/form_date.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="form-group">
|
||||
<label for="{{ $id }}">{{ $label }}</label>
|
||||
<div class="input-group has-validation">
|
||||
@empty($icon)
|
||||
@else
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
|
||||
</div>
|
||||
@endempty()
|
||||
<input type="date" class="form-control @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}" value="{{ old($old,$value) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error($id)
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
39
resources/themes/adminlte/views/widget/form_file.blade.php
Normal file
39
resources/themes/adminlte/views/widget/form_file.blade.php
Normal file
@ -0,0 +1,39 @@
|
||||
<div class="form-group">
|
||||
<label for="{{ $id }}">{{ $label }}</label>
|
||||
<div class="input-group has-validation">
|
||||
@empty($icon)
|
||||
@else
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
|
||||
</div>
|
||||
@endempty()
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}">
|
||||
<label class="custom-file-label input-group-text" for="{{ $id }}">Choose file</label>
|
||||
</div>
|
||||
|
||||
{{--
|
||||
<div class="input-group-append">
|
||||
<button type="submit" class="input-group-text btn btn-success" id="">Upload</button>
|
||||
</div>
|
||||
--}}
|
||||
<span class="invalid-feedback @error($id) d-block @enderror" role="alert">
|
||||
@error($id)
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('page-scripts')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#{{ $id }}').on('change',function(){
|
||||
//get the file name
|
||||
var fileName = $(this).val();
|
||||
//replace the "Choose a file" label
|
||||
$(this).next('.custom-file-label').html(fileName);
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@append
|
57
resources/themes/adminlte/views/widget/form_select.blade.php
Normal file
57
resources/themes/adminlte/views/widget/form_select.blade.php
Normal file
@ -0,0 +1,57 @@
|
||||
<div class="form-group">
|
||||
<label for="{{ $id }}">{{ $label }}</label>
|
||||
<div class="input-group has-validation">
|
||||
@empty($icon)
|
||||
@else
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
|
||||
</div>
|
||||
@endempty()
|
||||
|
||||
<select class="form-control @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?? $id}}">
|
||||
@if(! isset($addvalues) || ! $addvalues)
|
||||
<option id="new"></option>
|
||||
@endif
|
||||
@empty($groupby)
|
||||
@foreach($options as $option)
|
||||
@empty(Arr::get($option,'value')) @continue @endempty
|
||||
<option value="{{ Arr::get($option,'id') }}" @if(Arr::get($option,'id') == old($old,$value))selected @endif>{{ Arr::get($option,'value') }}</option>
|
||||
@endforeach
|
||||
@else
|
||||
@foreach($options->groupBy($groupby) as $group)
|
||||
<optgroup label="{{ $groupby == 'active' ? (Arr::get($group->first(),$groupby) ? 'Active' : 'Not Active') : Arr::get($group->first(),$groupby) }}">
|
||||
@foreach($group as $option)
|
||||
@empty(Arr::get($option,'value')) @continue @endempty
|
||||
<option value="{{ Arr::get($option,'id') }}" @if(Arr::get($option,'id') == old($old,$value))selected @endif>{{ Arr::get($option,'value') }}</option>
|
||||
@endforeach
|
||||
</optgroup>
|
||||
@endforeach
|
||||
@endempty
|
||||
</select>
|
||||
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error($id)
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@section('page-scripts')
|
||||
@css(select2)
|
||||
@js(select2,autofocus)
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#{{ $id }}').select2({
|
||||
dropdownAutoWidth: true,
|
||||
width: 'style',
|
||||
@isset($addvalues)
|
||||
tags: true,
|
||||
placeholder: '',
|
||||
allowClear: true,
|
||||
@endisset
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@append
|
17
resources/themes/adminlte/views/widget/form_text.blade.php
Normal file
17
resources/themes/adminlte/views/widget/form_text.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="form-group">
|
||||
<label for="{{ $id }}">{{ $label }}</label>
|
||||
<div class="input-group has-validation">
|
||||
@empty($icon)
|
||||
@else
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
|
||||
</div>
|
||||
@endempty()
|
||||
<input type="text" class="form-control {{ $classes ?? ''}}@error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?: $id }}" value="{{ old($old ?? $name,$value) }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error($id)
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
11
resources/themes/adminlte/views/widget/form_toggle.blade.php
Normal file
11
resources/themes/adminlte/views/widget/form_toggle.blade.php
Normal file
@ -0,0 +1,11 @@
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-switch custom-switch-off-danger custom-switch-on-success">
|
||||
<input type="checkbox" class="custom-control-input" id="{{ $id }}" name="{{ $name ?: $id }}" {{ old($old ?? $name,$value) ? 'checked' : '' }}>
|
||||
<label class="custom-control-label" for="{{ $id }}">{{ $label }}</label>
|
||||
</div>
|
||||
<span class="invalid-feedback @error($id) d-block @enderror" role="alert">
|
||||
@error($id)
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
@ -1,23 +1,3 @@
|
||||
<!-- Success -->
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success alert-dismissible">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h5><i class="icon fas fa-check"></i> Success!</h5>
|
||||
<ul>
|
||||
<li>{{ session()->get('success') }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@include('adminlte::widget.success')
|
||||
|
||||
<!-- Errors -->
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h5><i class="icon fas fa-ban"></i> Whoops!</h5>
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{!! $error !!}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@include('adminlte::widget.errors')
|
||||
|
10
resources/themes/adminlte/views/widget/success.blade.php
Normal file
10
resources/themes/adminlte/views/widget/success.blade.php
Normal file
@ -0,0 +1,10 @@
|
||||
<!-- Success -->
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success alert-dismissible">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h5><i class="icon fas fa-check"></i> Success!</h5>
|
||||
<ul>
|
||||
<li>{{ session()->get('success') }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
@ -0,0 +1 @@
|
||||
@if(session()->has('success'))<span class="ml-3 pt-0 pb-0 pr-1 pl-1 btn btn-outline-success float-right"><small>{{ session()->get('success') }}</small></span>@endif
|
114
resources/themes/architect/views/auth/login.blade.php
Normal file
114
resources/themes/architect/views/auth/login.blade.php
Normal file
@ -0,0 +1,114 @@
|
||||
@extends('architect::layouts.auth')
|
||||
|
||||
@section('htmlheader_title')
|
||||
Log in
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<!-- /.login-logo -->
|
||||
<div class="app-container app-theme-white body-tabs-shadow">
|
||||
<div class="app-container">
|
||||
<div class="h-100 bg-animation">
|
||||
<div class="d-flex h-100 justify-content-center align-items-center">
|
||||
<div class="mx-auto app-login-box col-md-8">
|
||||
@if(file_exists('login-note.html'))
|
||||
<div class="mx-auto card text-white card-body bg-primary w-50">
|
||||
<h5 class="text-white card-title"><i class="icon fa-2x fas fa-info pr-3"></i><span class="font-size-xlg">NOTE</span></h5>
|
||||
<span class="w-100 pb-0">
|
||||
{!! file_get_contents('login-note.html') !!}
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="modal-dialog w-100 mx-auto">
|
||||
<div class="modal-content">
|
||||
<form class="needs-validation" novalidate method="post">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="h5 modal-title text-center">
|
||||
<h4 class="mt-2">
|
||||
<div class="app-logo mx-auto mb-3"><img class="w-75" src="{{ url('img/logo-h-lg.png') }}"></div>
|
||||
<small>@lang('Sign in to <strong>:server</strong>',['server'=>'Foo'])</small>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="col-md-12 mt-3">
|
||||
<label class="mb-1">Email</label>
|
||||
<input name="email" id="user" placeholder="" type="email" class="form-control" required="">
|
||||
<div class="invalid-feedback">
|
||||
@lang('Please enter your email')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mt-2">
|
||||
<label class="mb-1">@lang('Password')</label>
|
||||
<input name="password" id="password" placeholder="" type="password" class="form-control" required>
|
||||
<div class="invalid-feedback">
|
||||
@lang('Please enter your password')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
@if (count($errors) > 0)
|
||||
<div class="alert alert-danger w-100">
|
||||
<strong>Whoops!</strong> Something went wrong?<br><br>
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<div class="float-right">
|
||||
<button class="btn btn-primary btn-lg">Login</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('page-scripts')
|
||||
<style>
|
||||
label {
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
font-size: 85%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.table tr:last-child {
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// Example starter JavaScript for disabling form submissions if there are invalid fields
|
||||
(function () {
|
||||
'use strict';
|
||||
window.addEventListener('load',function () {
|
||||
// Fetch all the forms we want to apply custom Bootstrap validation styles to
|
||||
var forms = document.getElementsByClassName('needs-validation');
|
||||
// Loop over them and prevent submission
|
||||
var validation = Array.prototype.filter.call(forms, function (form) {
|
||||
form.addEventListener('submit', function (event) {
|
||||
if (form.checkValidity() === false) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
form.classList.add('was-validated');
|
||||
}, false);
|
||||
});
|
||||
}, false);
|
||||
})();
|
||||
</script>
|
||||
@append
|
@ -1,5 +1,5 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@section('htmlheader')
|
||||
@include('architect::layouts.partials.htmlheader')
|
||||
@show
|
||||
@ -8,22 +8,24 @@
|
||||
<div class="app-container app-theme-white body-tabs-shadow fixed-sidebar">
|
||||
@include('architect::layouts.partials.topmenu')
|
||||
|
||||
{{--
|
||||
@include('architect::layouts.partials.controlsidebar')
|
||||
--}}
|
||||
@includeIf('architect::layouts.partials.controlsidebar')
|
||||
|
||||
<div class="app-main">
|
||||
@include('architect::layouts.partials.sidebarmenu')
|
||||
|
||||
<div class="app-main__outer">
|
||||
<div class="app-main__inner">
|
||||
@include('architect::layouts.partials.contentheader')
|
||||
<div class="main-content">
|
||||
@if (trim($__env->yieldContent('page_title')))
|
||||
@include('architect::layouts.partials.contentheader')
|
||||
@endif
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<!-- Your Page Content Here -->
|
||||
@yield('main-content')
|
||||
<!-- Main content -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<!-- Your Page Content Here -->
|
||||
@yield('main-content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -36,10 +38,7 @@
|
||||
@section('scripts')
|
||||
@include('architect::layouts.partials.scripts')
|
||||
|
||||
{{-- Scripts --}}
|
||||
{!! Asset::scripts() !!}
|
||||
|
||||
@yield('page-scripts')
|
||||
@show
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
18
resources/themes/architect/views/layouts/auth.blade.php
Normal file
18
resources/themes/architect/views/layouts/auth.blade.php
Normal file
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@section('htmlheader')
|
||||
@include('architect::layouts.partials.htmlheader')
|
||||
@show
|
||||
|
||||
<body class="hold-transition login-page">
|
||||
<div id="app">
|
||||
@yield('content')
|
||||
</div>
|
||||
|
||||
@section('scripts')
|
||||
@include('architect::auth.partials.scripts')
|
||||
|
||||
@yield('page-scripts')
|
||||
@show
|
||||
</body>
|
||||
</html>
|
@ -5,7 +5,7 @@
|
||||
<ul class="nav">
|
||||
{{--
|
||||
<li class="nav-item">
|
||||
<a href="javascript:void(0);" class="nav-link">Footer Link 1</a>
|
||||
<a href="javascript:void(0);" class="nav-link">Footer Link</a>
|
||||
</li>
|
||||
--}}
|
||||
</ul>
|
||||
@ -18,7 +18,7 @@
|
||||
<div class="badge badge-success mr-1 ml-0">
|
||||
<small>NEW</small>
|
||||
</div>
|
||||
Footer Link 4
|
||||
Footer Link
|
||||
</a>
|
||||
</li>
|
||||
--}}
|
||||
@ -26,4 +26,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,44 +1,49 @@
|
||||
<div class="app-page-title">
|
||||
<div class="page-title-wrapper">
|
||||
<div class="page-title-heading">
|
||||
<div class="page-title-icon">
|
||||
<i class="@yield('page_icon','pe-7s-car')"></i>
|
||||
</div>
|
||||
@if (trim($__env->yieldContent('page_icon')))
|
||||
<div class="page-title-icon f32">
|
||||
<i class="@yield('page_icon','')"></i>
|
||||
</div>
|
||||
@endif
|
||||
<div>
|
||||
@yield('page_title','Page Title')
|
||||
<div class="page-title-subheading">
|
||||
@yield('page_subtitle','Page Sub Title')
|
||||
@yield('page_subtitle','')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-title-actions">
|
||||
{{--
|
||||
<button type="button" data-toggle="tooltip" title="Example Tooltip" data-placement="bottom" class="btn-shadow mr-3 btn btn-dark">
|
||||
<i class="fas fa-star"></i>
|
||||
</button>
|
||||
--}}
|
||||
<div class="d-inline-block dropdown">
|
||||
<button type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn-shadow dropdown-toggle btn btn-info">
|
||||
<span class="btn-icon-wrapper pr-2 opacity-7">
|
||||
<i class="fas fa-business-time fa-w-20"></i>
|
||||
</span>
|
||||
Item Menu
|
||||
</button>
|
||||
|
||||
<div tabindex="-1" role="menu" aria-hidden="true" class="dropdown-menu dropdown-menu-right">
|
||||
<ul class="nav flex-column">
|
||||
{{--
|
||||
<li class="nav-item">
|
||||
<a href="javascript:void(0);" class="nav-link">
|
||||
<i class="nav-link-icon lnr-inbox"></i>
|
||||
<span>Inbox</span>
|
||||
<div class="ml-auto badge badge-pill badge-secondary">86</div>
|
||||
</a>
|
||||
</li>
|
||||
--}}
|
||||
</ul>
|
||||
@isset($page_actions)
|
||||
<div class="page-title-actions">
|
||||
{{--
|
||||
<button type="button" data-toggle="tooltip" title="Example Tooltip" data-placement="bottom" class="btn-shadow mr-3 btn btn-dark">
|
||||
<i class="fa fa-star"></i>
|
||||
</button>
|
||||
--}}
|
||||
<div class="d-inline-block dropdown">
|
||||
<button type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn-shadow dropdown-toggle btn btn-info">
|
||||
<span class="btn-icon-wrapper pr-2 opacity-7">
|
||||
<i class="fa fa-business-time fa-w-20"></i>
|
||||
</span>
|
||||
Item Menu
|
||||
</button>
|
||||
|
||||
<div tabindex="-1" role="menu" aria-hidden="true" class="dropdown-menu dropdown-menu-right">
|
||||
<ul class="nav flex-column">
|
||||
{{--
|
||||
<li class="nav-item">
|
||||
<a href="javascript:void(0);" class="nav-link">
|
||||
<i class="nav-link-icon lnr-inbox"></i>
|
||||
<span>Inbox</span>
|
||||
<div class="ml-auto badge badge-pill badge-secondary">86</div>
|
||||
</a>
|
||||
</li>
|
||||
--}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
@ -35,9 +35,6 @@
|
||||
<link rel="stylesheet" href="{{ asset('/css/print.css') }}">
|
||||
@endif
|
||||
|
||||
<!-- STYLESHEETS -->
|
||||
{!! Asset::styles() !!}
|
||||
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="{{ asset('/css/architect.min.css') }}">
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
{{--
|
||||
<li class="nav-item">
|
||||
<a href="javascript:void(0);" class="nav-link">
|
||||
<i class="nav-link-icon fas fa-database"></i> Statistics
|
||||
<i class="nav-link-icon fas fa-database"></i> Link
|
||||
</a>
|
||||
</li>
|
||||
--}}
|
||||
@ -70,7 +70,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget-content-left ml-3 header-user-info">
|
||||
<div class="widget-content-left ml-3 header-user-info">
|
||||
<div class="widget-heading">
|
||||
{{ $user->name ?? 'John Smith' }}
|
||||
</div>
|
||||
|
@ -38,9 +38,6 @@
|
||||
@section('scripts')
|
||||
@include('metronic::layouts.partials.scripts')
|
||||
|
||||
{{-- Scripts --}}
|
||||
{!! Asset::scripts() !!}
|
||||
|
||||
@yield('page-scripts')
|
||||
@show
|
||||
</body>
|
||||
|
@ -14,10 +14,10 @@
|
||||
--}}
|
||||
|
||||
<!-- Theme style -->
|
||||
@css('css/components.css')
|
||||
@css('css/style.css')
|
||||
@css('css/style-responsive.css')
|
||||
@css('css/themes/blue.css')
|
||||
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/components.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/style.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/style-responsive.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/themes/blue.css') }}">
|
||||
|
||||
<!-- Google Font: Source Sans Pro -->
|
||||
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|PT+Sans+Narrow|Source+Sans+Pro:200,300,400,600,700,900&subset=all" rel="stylesheet" type="text/css">
|
||||
@ -32,10 +32,7 @@
|
||||
<link rel="shortcut icon" href="{{ object_get($site,'favicon','favicon.ico') }}" />
|
||||
|
||||
<!-- Custom CSS -->
|
||||
@css('css/custom.css')
|
||||
|
||||
<!-- STYLESHEETS -->
|
||||
{!! Asset::styles() !!}
|
||||
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/custom.css') }}">
|
||||
|
||||
@yield('page-styles')
|
||||
</head>
|
@ -18,5 +18,5 @@
|
||||
|
||||
@if(file_exists('js/custom.js'))
|
||||
<!-- Any Custom JS -->
|
||||
<script src="{{ asset('js/custom.js') }}"></script>
|
||||
<script type="text/javascript" src="{{ asset('js/custom.js') }}"></script>
|
||||
@endif
|
@ -13,7 +13,7 @@ class Carbon extends CarbonBase
|
||||
{
|
||||
const MONTHS_PER_HALF = 6;
|
||||
|
||||
public function __get($name)
|
||||
public function __get(string $name): mixed
|
||||
{
|
||||
switch ($name) {
|
||||
case 'half':
|
||||
@ -57,7 +57,7 @@ class Carbon extends CarbonBase
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function startOfHalf($dayOfWeek = null)
|
||||
public function startOfHalf(int $dayOfWeek=NULL)
|
||||
{
|
||||
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF - 5, 1)->firstOfMonth($dayOfWeek);
|
||||
}
|
||||
@ -72,7 +72,7 @@ class Carbon extends CarbonBase
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function endOfHalf($dayOfWeek = null)
|
||||
public function endOfHalf(int $dayOfWeek=NULL)
|
||||
{
|
||||
return $this->setDate($this->year, $this->half * static::MONTHS_PER_HALF, 1)->lastOfMonth($dayOfWeek);
|
||||
}
|
||||
|
@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Leenooks\Controllers;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Redirect;
|
||||
use Session;
|
||||
|
||||
use App\Models\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');
|
||||
}
|
||||
}
|
61
src/Controllers/SwitchUserController.php
Normal file
61
src/Controllers/SwitchUserController.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace Leenooks\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Redirect;
|
||||
use Session;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
class SwitchUserController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorised to switch to another user
|
||||
*
|
||||
* @param User $user
|
||||
* @return bool
|
||||
*/
|
||||
public function switch_authorised(User $user): bool
|
||||
{
|
||||
return (method_exists(Auth::user(),'isAdmin') && Auth::user()->isAdmin($user)) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch to a different user
|
||||
*
|
||||
* @param User $user
|
||||
* @return mixed
|
||||
*/
|
||||
public function switch_start(User $user)
|
||||
{
|
||||
if ($user->switched)
|
||||
abort(403,'User already switched');
|
||||
|
||||
if ($this->switch_authorised($user)) {
|
||||
Session::put('orig_user',Auth::user());
|
||||
Auth::login($user);
|
||||
}
|
||||
|
||||
return Redirect::to('/home');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return back from the switch users
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function switch_stop()
|
||||
{
|
||||
if ($user = Session::pull('orig_user'))
|
||||
Auth::login($user);
|
||||
|
||||
return Redirect::to('/home');
|
||||
}
|
||||
}
|
318
src/Providers/CustomBladeServiceProvider.php
Normal file
318
src/Providers/CustomBladeServiceProvider.php
Normal file
@ -0,0 +1,318 @@
|
||||
<?php
|
||||
|
||||
namespace Leenooks\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class CustomBladeServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Blade::directive('css',function(string $expression,array $args=[]) {
|
||||
return $this->resolve('css',$expression);
|
||||
});
|
||||
|
||||
Blade::directive('js',function($expression,string $options=NULL) {
|
||||
return $this->resolve('js',$expression);
|
||||
});
|
||||
}
|
||||
|
||||
private function resolve(string $content,string $expression): string
|
||||
{
|
||||
if (str_contains($expression,',')) {
|
||||
[$type,$arguments] = explode(',',$expression,2);
|
||||
$arguments = explode('|',$arguments);
|
||||
|
||||
} else {
|
||||
$type = $expression;
|
||||
$arguments = [];
|
||||
}
|
||||
|
||||
$return = collect();
|
||||
$css = collect();
|
||||
$js = collect();
|
||||
|
||||
switch ($type) {
|
||||
case 'datatables':
|
||||
switch ($content) {
|
||||
case 'css':
|
||||
// Base
|
||||
$css->put($type,'https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css');
|
||||
|
||||
foreach ($arguments as $option) {
|
||||
$key = $type.':'.$option;
|
||||
switch ($option) {
|
||||
case 'bootstrap4':
|
||||
$css->put($key,'/plugin/dataTables/dataTables.bootstrap4.css');
|
||||
break;
|
||||
|
||||
case 'buttons':
|
||||
$css->put($key,'https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css');
|
||||
break;
|
||||
|
||||
case 'fixedheader':
|
||||
$css->put($key,'https://cdn.datatables.net/fixedheader/3.1.7/css/fixedHeader.dataTables.min.css');
|
||||
break;
|
||||
|
||||
case 'rowgroup':
|
||||
$css->put($key,'https://cdn.datatables.net/rowgroup/1.1.2/css/rowGroup.dataTables.min.css');
|
||||
break;
|
||||
|
||||
case 'responsive':
|
||||
$css->put($key,'http://cdn.datatables.net/responsive/2.2.6/css/responsive.dataTables.min.css');
|
||||
break;
|
||||
|
||||
case 'searchpanes':
|
||||
$css->put($key,'https://cdn.datatables.net/searchpanes/1.2.1/css/searchPanes.dataTables.min.css');
|
||||
break;
|
||||
|
||||
case 'searchpanes-left':
|
||||
$css->put('searchpanes:searchpanes-left','/plugin/dataTables/leftSearchPanes.css');
|
||||
break;
|
||||
|
||||
case 'select':
|
||||
$css->put($key,'https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css');
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \Exception(sprintf('Unknown [%s] option: [%s:%s]',$type,$content,$option));
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'js':
|
||||
// Base
|
||||
$js->put($type,'https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js');
|
||||
|
||||
foreach ($arguments as $option) {
|
||||
$key = $type.':'.$option;
|
||||
|
||||
switch ($option) {
|
||||
case 'bootstrap4':
|
||||
$js->put($key,'/plugin/dataTables/dataTables.bootstrap4.js');
|
||||
break;
|
||||
|
||||
case 'buttons':
|
||||
$js->put($key,'https://cdn.datatables.net/buttons/1.6.5/js/dataTables.buttons.min.js');
|
||||
$js->put($key.'html5','https://cdn.datatables.net/buttons/1.6.5/js/buttons.html5.min.js');
|
||||
$js->put($key.'jszip','https://cdnjs.cloudflare.com/ajax/libs/jszip/3.2.0/jszip.min.js');
|
||||
break;
|
||||
|
||||
case 'fixedheader':
|
||||
$js->put($key,'https://cdn.datatables.net/fixedheader/3.1.7/js/dataTables.fixedHeader.min.js');
|
||||
break;
|
||||
|
||||
case 'responsive':
|
||||
$js->put($key,'https://cdn.datatables.net/responsive/2.2.6/js/dataTables.responsive.min.js');
|
||||
break;
|
||||
|
||||
case 'rowgroup':
|
||||
$js->put($key,'https://cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js');
|
||||
break;
|
||||
|
||||
case 'searchpanes':
|
||||
$js->put($key,'https://cdn.datatables.net/searchpanes/1.2.1/js/dataTables.searchPanes.min.js');
|
||||
break;
|
||||
|
||||
case 'select':
|
||||
$js->put($key,'https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js');
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \Exception(sprintf('Unknown [%s] option: [%s:%s]',$type,$content,$option));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'datepick':
|
||||
switch ($content) {
|
||||
case 'css':
|
||||
$css->put($type,'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css');
|
||||
break;
|
||||
|
||||
case 'js':
|
||||
$js->put($type,'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'debounce':
|
||||
switch ($content) {
|
||||
case 'js':
|
||||
$js->put($type,'js/debounce.js');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'highcharts':
|
||||
switch ($content) {
|
||||
case 'js':
|
||||
// Base
|
||||
$js->put($type,'https://code.highcharts.com/highcharts.js');
|
||||
|
||||
foreach ($arguments as $option) {
|
||||
$key = $type.':'.$option;
|
||||
switch ($option) {
|
||||
case '3d':
|
||||
$js->put($key,'https://code.highcharts.com/highcharts-3d.js');
|
||||
$js->put($key.'mouseover','/plugin/highcharts/3dmouseover.js');
|
||||
break;
|
||||
|
||||
case 'data':
|
||||
$js->put($key,'https://code.highcharts.com/modules/data.js');
|
||||
break;
|
||||
|
||||
case 'defaults':
|
||||
$js->put($key,'/plugin/highcharts/defaults.js');
|
||||
break;
|
||||
|
||||
case 'drilldown':
|
||||
$js->put($key,'https://code.highcharts.com/modules/drilldown.js');
|
||||
break;
|
||||
|
||||
case 'export':
|
||||
$js->put($key,'https://code.highcharts.com/modules/exporting.js');
|
||||
$js->put($key.'data','https://code.highcharts.com/modules/export-data.js');
|
||||
break;
|
||||
|
||||
case 'funnel':
|
||||
$js->put($key,'https://code.highcharts.com/modules/funnel.js');
|
||||
break;
|
||||
|
||||
case 'heatmap':
|
||||
$js->put($key,'https://code.highcharts.com/modules/heatmap.js');
|
||||
break;
|
||||
|
||||
case 'solidguage':
|
||||
$js->put($key,'https://code.highcharts.com/highcharts-more.js');
|
||||
$js->put($key.'accessiblity','https://code.highcharts.com/modules/accessibility.js');
|
||||
$js->put($key.'solid-guage','https://code.highcharts.com/modules/solid-gauge.js');
|
||||
break;
|
||||
|
||||
case 'theme-dark':
|
||||
$js->put($key,'https://code.highcharts.com/themes/dark-unica.js');
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \Exception(sprintf('Unknown [%s] option: [%s:%s]',$type,$content,$option));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'highcharts-stock':
|
||||
switch ($content) {
|
||||
case 'js':
|
||||
// Base
|
||||
$js->put($type,'https://code.highcharts.com/stock/highstock.js');
|
||||
|
||||
foreach ($arguments as $option) {
|
||||
$key = $type.':'.$option;
|
||||
switch ($option) {
|
||||
case 'data':
|
||||
$js->put($key,'https://code.highcharts.com/stock/modules/data.js');
|
||||
break;
|
||||
|
||||
case 'export':
|
||||
$js->put($key,'https://code.highcharts.com/stock/modules/exporting.js');
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \Exception(sprintf('Unknown [%s] option: [%s:%s]',$type,$content,$option));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'select2':
|
||||
switch ($content) {
|
||||
case 'css':
|
||||
// Base
|
||||
$css->put($type,'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css');
|
||||
|
||||
break;
|
||||
|
||||
case 'js':
|
||||
// Base
|
||||
$js->put($type,'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js');
|
||||
|
||||
foreach ($arguments as $option) {
|
||||
$key = $type.':'.$option;
|
||||
switch ($option) {
|
||||
case 'autofocus':
|
||||
$js->put($key,'/plugin/select2/fix-autofocus.js');
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \Exception(sprintf('Unknown [%s] option: [%s:%s]',$type,$content,$option));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'simplemde':
|
||||
switch ($content) {
|
||||
case 'css':
|
||||
// Base
|
||||
$css->put($type,'https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css');
|
||||
|
||||
break;
|
||||
|
||||
case 'js':
|
||||
// Base
|
||||
$js->put($type,'https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'summernote':
|
||||
switch ($content) {
|
||||
case 'css':
|
||||
// Base
|
||||
$css->put($type,'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.css');
|
||||
|
||||
break;
|
||||
|
||||
case 'js':
|
||||
// Base
|
||||
$js->put($type,'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.js');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'validation':
|
||||
switch ($content) {
|
||||
case 'js':
|
||||
// Base
|
||||
$js->put('validate','https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/jquery.validate.min.js');
|
||||
$js->put('validate.additional','https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/additional-methods.min.js');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \Exception(sprintf('Unknown Expression: [%s]',$expression));
|
||||
}
|
||||
|
||||
if ($js->count())
|
||||
$return = $return->merge($js->map(fn($item)=>sprintf('<script type="text/javascript" src="%s"></script>',$item)));
|
||||
|
||||
if ($css->count())
|
||||
$return = $return->merge($css->map(fn($item)=>sprintf('<link rel="stylesheet" href="%s">',$item)));
|
||||
|
||||
return $return->join('');
|
||||
}
|
||||
}
|
@ -32,8 +32,8 @@ trait SingleOrFail
|
||||
return NULL;
|
||||
});
|
||||
|
||||
// When a query should return 1 object, or NULL if it doesnt
|
||||
Builder::macro('singleOrNew',function ($args) {
|
||||
// When a query should return 1 object, or setup to create a new object
|
||||
Builder::macro('singleOrNew',function (array $args=[]) {
|
||||
$result = $this->where($args)->get();
|
||||
|
||||
if ($result->count() == 1)
|
||||
|
@ -7,14 +7,27 @@ namespace Leenooks\Traits;
|
||||
|
||||
use Session;
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
trait UserSwitch
|
||||
{
|
||||
/**
|
||||
* Return if this is a switched user
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getSwitchedAttribute()
|
||||
{
|
||||
return Session::get('orig_user');
|
||||
}
|
||||
|
||||
public function isAdmin($id)
|
||||
/**
|
||||
* If the user record has an admin attribute, we'll return that
|
||||
*
|
||||
* @param User|null $user
|
||||
* @return false|mixed
|
||||
*/
|
||||
public function isAdmin(User $user=NULL)
|
||||
{
|
||||
return isset($this->admin) ? $this->admin : FALSE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user