Compare commits

...

8 Commits

16 changed files with 82 additions and 97 deletions

View File

@@ -10,8 +10,6 @@
}
],
"require": {
"creativeorange/gravatar": "^1.0",
"orchestra/asset": "^6.0"
},
"require-dev": {
},
@@ -26,8 +24,6 @@
"extra": {
"laravel": {
"providers": [
"Orchestra\\Asset\\AssetServiceProvider",
"Collective\\Html\\HtmlServiceProvider",
"Leenooks\\Providers\\LeenooksServiceProvider",
"Leenooks\\Providers\\CustomBladeServiceProvider"
]

View File

@@ -39,9 +39,6 @@
@section('scripts')
@include('adminlte::layouts.partials.scripts')
{{-- Scripts --}}
{!! Asset::scripts() !!}
@yield('page-scripts')
@show
</body>

View File

@@ -41,9 +41,6 @@
<![endif]-->
--}}
<!-- STYLESHEETS -->
{!! Asset::styles() !!}
@yield('page-styles')
@if(file_exists('css/fixes.css'))

View File

@@ -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>

View File

@@ -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

View File

@@ -12,7 +12,7 @@
@if(! isset($addvalues) || ! $addvalues)
<option id="new"></option>
@endif
@empty($groupby))
@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>

View File

@@ -7,11 +7,11 @@
<span class="input-group-text"><i class="fa-fw {{ $icon }}"></i></span>
</div>
@endempty()
<input type="text" class="form-control @error($id) is-invalid @enderror" id="{{ $id }}" name="{{ $name ?: $id }}" value="{{ old($old ?? $name,$value) }}">
<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>
</div>

View File

@@ -38,9 +38,6 @@
@section('scripts')
@include('architect::layouts.partials.scripts')
{{-- Scripts --}}
{!! Asset::scripts() !!}
@yield('page-scripts')
@show
</body>

View File

@@ -12,9 +12,6 @@
@section('scripts')
@include('architect::auth.partials.scripts')
{{-- Scripts --}}
{!! Asset::scripts() !!}
@yield('page-scripts')
@show
</body>

View File

@@ -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') }}">

View File

@@ -38,9 +38,6 @@
@section('scripts')
@include('metronic::layouts.partials.scripts')
{{-- Scripts --}}
{!! Asset::scripts() !!}
@yield('page-scripts')
@show
</body>

View File

@@ -14,10 +14,10 @@
--}}
<!-- Theme style -->
@themecss('/css/components.css','components-css')
@themecss('/css/style.css','style-css')
@themecss('/css/style-responsive.css','style-responsive-css')
@themecss('/css/themes/blue.css','theme-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&amp;subset=all" rel="stylesheet" type="text/css">
@@ -32,10 +32,7 @@
<link rel="shortcut icon" href="{{ object_get($site,'favicon','favicon.ico') }}" />
<!-- Custom CSS -->
@php(Asset::add('custom-css','/css/custom.css'))
<!-- STYLESHEETS -->
{!! Asset::styles() !!}
<link rel="stylesheet" href="{{ asset('theme/frontend/metronic/css/custom.css') }}">
@yield('page-styles')
</head>

View File

@@ -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

View File

@@ -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);
}

View File

@@ -3,7 +3,6 @@
namespace Leenooks\Controllers;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Support\Facades\Auth;
use Redirect;
use Session;
@@ -57,6 +56,6 @@ class SwitchUserController extends Controller
if ($user = Session::pull('orig_user'))
Auth::login($user);
return Redirect::to(RouteServiceProvider::HOME);
return Redirect::to('/home');
}
}

View File

@@ -5,7 +5,6 @@ namespace Leenooks\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\ServiceProvider;
use Orchestra\Support\Facades\Asset;
class CustomBladeServiceProvider extends ServiceProvider
{
@@ -37,48 +36,49 @@ class CustomBladeServiceProvider extends ServiceProvider
}
$return = collect();
$urls = collect();
$css = collect();
$js = collect();
switch ($type) {
case 'datatables':
switch ($content) {
case 'css':
// Base
$urls->put($type,'https://cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css');
$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':
$urls->put($key,'/plugin/dataTables/dataTables.bootstrap4.css');
$css->put($key,'/plugin/dataTables/dataTables.bootstrap4.css');
break;
case 'buttons':
$urls->put($key,'https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css');
$css->put($key,'https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css');
break;
case 'fixedheader':
$urls->put($key,'https://cdn.datatables.net/fixedheader/3.1.7/css/fixedHeader.dataTables.min.css');
$css->put($key,'https://cdn.datatables.net/fixedheader/3.1.7/css/fixedHeader.dataTables.min.css');
break;
case 'rowgroup':
$urls->put($key,'https://cdn.datatables.net/rowgroup/1.1.2/css/rowGroup.dataTables.min.css');
$css->put($key,'https://cdn.datatables.net/rowgroup/1.1.2/css/rowGroup.dataTables.min.css');
break;
case 'responsive':
$urls->put($key,'http://cdn.datatables.net/responsive/2.2.6/css/responsive.dataTables.min.css');
$css->put($key,'http://cdn.datatables.net/responsive/2.2.6/css/responsive.dataTables.min.css');
break;
case 'searchpanes':
$urls->put($key,'https://cdn.datatables.net/searchpanes/1.2.1/css/searchPanes.dataTables.min.css');
$css->put($key,'https://cdn.datatables.net/searchpanes/1.2.1/css/searchPanes.dataTables.min.css');
break;
case 'searchpanes-left':
$urls->put('searchpanes:searchpanes-left','/plugin/dataTables/leftSearchPanes.css');
$css->put('searchpanes:searchpanes-left','/plugin/dataTables/leftSearchPanes.css');
break;
case 'select':
$urls->put($key,'https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css');
$css->put($key,'https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css');
break;
default:
@@ -90,40 +90,40 @@ class CustomBladeServiceProvider extends ServiceProvider
case 'js':
// Base
$urls->put($type,'https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js');
$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':
$urls->put($key,'/plugin/dataTables/dataTables.bootstrap4.js');
$js->put($key,'/plugin/dataTables/dataTables.bootstrap4.js');
break;
case 'buttons':
$urls->put($key,'https://cdn.datatables.net/buttons/1.6.5/js/dataTables.buttons.min.js');
$urls->put($key.'html5','https://cdn.datatables.net/buttons/1.6.5/js/buttons.html5.min.js');
$urls->put($key.'jszip','https://cdnjs.cloudflare.com/ajax/libs/jszip/3.2.0/jszip.min.js');
$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':
$urls->put($key,'https://cdn.datatables.net/fixedheader/3.1.7/js/dataTables.fixedHeader.min.js');
$js->put($key,'https://cdn.datatables.net/fixedheader/3.1.7/js/dataTables.fixedHeader.min.js');
break;
case 'responsive':
$urls->put($key,'https://cdn.datatables.net/responsive/2.2.6/js/dataTables.responsive.min.js');
$js->put($key,'https://cdn.datatables.net/responsive/2.2.6/js/dataTables.responsive.min.js');
break;
case 'rowgroup':
$urls->put($key,'https://cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js');
$js->put($key,'https://cdn.datatables.net/rowgroup/1.1.2/js/dataTables.rowGroup.min.js');
break;
case 'searchpanes':
$urls->put($key,'https://cdn.datatables.net/searchpanes/1.2.1/js/dataTables.searchPanes.min.js');
$js->put($key,'https://cdn.datatables.net/searchpanes/1.2.1/js/dataTables.searchPanes.min.js');
break;
case 'select':
$urls->put($key,'https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js');
$js->put($key,'https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js');
break;
default:
@@ -137,11 +137,11 @@ class CustomBladeServiceProvider extends ServiceProvider
case 'datepick':
switch ($content) {
case 'css':
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css');
$css->put($type,'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css');
break;
case 'js':
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js');
$js->put($type,'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js');
}
break;
@@ -149,7 +149,7 @@ class CustomBladeServiceProvider extends ServiceProvider
case 'debounce':
switch ($content) {
case 'js':
$urls->put($type,'js/debounce.js');
$js->put($type,'js/debounce.js');
}
break;
@@ -158,49 +158,49 @@ class CustomBladeServiceProvider extends ServiceProvider
switch ($content) {
case 'js':
// Base
$urls->put($type,'https://code.highcharts.com/highcharts.js');
$js->put($type,'https://code.highcharts.com/highcharts.js');
foreach ($arguments as $option) {
$key = $type.':'.$option;
switch ($option) {
case '3d':
$urls->put($key,'https://code.highcharts.com/highcharts-3d.js');
$urls->put($key.'mouseover','/plugin/highcharts/3dmouseover.js');
$js->put($key,'https://code.highcharts.com/highcharts-3d.js');
$js->put($key.'mouseover','/plugin/highcharts/3dmouseover.js');
break;
case 'data':
$urls->put($key,'https://code.highcharts.com/modules/data.js');
$js->put($key,'https://code.highcharts.com/modules/data.js');
break;
case 'defaults':
$urls->put($key,'/plugin/highcharts/defaults.js');
$js->put($key,'/plugin/highcharts/defaults.js');
break;
case 'drilldown':
$urls->put($key,'https://code.highcharts.com/modules/drilldown.js');
$js->put($key,'https://code.highcharts.com/modules/drilldown.js');
break;
case 'export':
$urls->put($key,'https://code.highcharts.com/modules/exporting.js');
$urls->put($key.'data','https://code.highcharts.com/modules/export-data.js');
$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':
$urls->put($key,'https://code.highcharts.com/modules/funnel.js');
$js->put($key,'https://code.highcharts.com/modules/funnel.js');
break;
case 'heatmap':
$urls->put($key,'https://code.highcharts.com/modules/heatmap.js');
$js->put($key,'https://code.highcharts.com/modules/heatmap.js');
break;
case 'solidguage':
$urls->put($key,'https://code.highcharts.com/highcharts-more.js');
$urls->put($key.'accessiblity','https://code.highcharts.com/modules/accessibility.js');
$urls->put($key.'solid-guage','https://code.highcharts.com/modules/solid-gauge.js');
$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':
$urls->put($key,'https://code.highcharts.com/themes/dark-unica.js');
$js->put($key,'https://code.highcharts.com/themes/dark-unica.js');
break;
default:
@@ -215,17 +215,17 @@ class CustomBladeServiceProvider extends ServiceProvider
switch ($content) {
case 'js':
// Base
$urls->put($type,'https://code.highcharts.com/stock/highstock.js');
$js->put($type,'https://code.highcharts.com/stock/highstock.js');
foreach ($arguments as $option) {
$key = $type.':'.$option;
switch ($option) {
case 'data':
$urls->put($key,'https://code.highcharts.com/stock/modules/data.js');
$js->put($key,'https://code.highcharts.com/stock/modules/data.js');
break;
case 'export':
$urls->put($key,'https://code.highcharts.com/stock/modules/exporting.js');
$js->put($key,'https://code.highcharts.com/stock/modules/exporting.js');
break;
default:
@@ -240,19 +240,19 @@ class CustomBladeServiceProvider extends ServiceProvider
switch ($content) {
case 'css':
// Base
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css');
$css->put($type,'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css');
break;
case 'js':
// Base
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js');
$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':
$urls->put($key,'plugin/select2/fix-autofocus.js');
$js->put($key,'/plugin/select2/fix-autofocus.js');
break;
default:
@@ -267,13 +267,13 @@ class CustomBladeServiceProvider extends ServiceProvider
switch ($content) {
case 'css':
// Base
$urls->put($type,'https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css');
$css->put($type,'https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css');
break;
case 'js':
// Base
$urls->put($type,'https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js');
$js->put($type,'https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js');
}
break;
@@ -282,13 +282,13 @@ class CustomBladeServiceProvider extends ServiceProvider
switch ($content) {
case 'css':
// Base
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.css');
$css->put($type,'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.css');
break;
case 'js':
// Base
$urls->put($type,'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.js');
$js->put($type,'https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.js');
}
break;
@@ -297,8 +297,8 @@ class CustomBladeServiceProvider extends ServiceProvider
switch ($content) {
case 'js':
// Base
$urls->put('validate','https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/jquery.validate.min.js');
$urls->put('validate.additional','https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/additional-methods.min.js');
$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;
@@ -307,13 +307,12 @@ class CustomBladeServiceProvider extends ServiceProvider
throw new \Exception(sprintf('Unknown Expression: [%s]',$expression));
}
if ($urls->count())
return $urls->map(function($item,$key) {
$dependancy='';
if (str_contains($key,':'))
[$dependancy,$key] = explode(':',$key);
if ($js->count())
$return = $return->merge($js->map(fn($item)=>sprintf('<script type="text/javascript" src="%s"></script>',$item)));
return "<?php Asset::add('$key','$item','$dependancy'); ?>";
})->join('');
if ($css->count())
$return = $return->merge($css->map(fn($item)=>sprintf('<link rel="stylesheet" href="%s">',$item)));
return $return->join('');
}
}