From d15d212ad13aea400d5bd34ac98f5b4363ec12a6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 5 Aug 2019 12:02:32 +1000 Subject: [PATCH] Working on select 2 --- app/Http/Middleware/QueryLogging.php | 4 +-- .../portal/default/invoices/index.blade.php | 27 +++++++++++++++++++ .../portal/default/layouts/master.blade.php | 5 ---- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/app/Http/Middleware/QueryLogging.php b/app/Http/Middleware/QueryLogging.php index fc0ba7af6..78861d5b8 100644 --- a/app/Http/Middleware/QueryLogging.php +++ b/app/Http/Middleware/QueryLogging.php @@ -47,9 +47,9 @@ class QueryLogging $count = count($queries); $timeEnd = microtime(true); $time = $timeEnd - $timeStart; - Log::info($request->method() . ' - ' . $request->url() . ": $count queries - " . $time); + //Log::info($request->method() . ' - ' . $request->url() . ": $count queries - " . $time); - // if($count > 16) + if($count > 16) Log::info($queries); } diff --git a/resources/views/portal/default/invoices/index.blade.php b/resources/views/portal/default/invoices/index.blade.php index 0d7ee2f42..22d896ef0 100644 --- a/resources/views/portal/default/invoices/index.blade.php +++ b/resources/views/portal/default/invoices/index.blade.php @@ -18,6 +18,12 @@ {!! Former::dark_button(ctrans('texts.download'))->addClass('download_invoices') !!} {!! Former::success_button(ctrans('texts.pay_now'))->addClass('pay_invoices') !!} + + @@ -143,6 +149,7 @@ $(document).ready(function() { alert('download'); }); + }); @@ -151,6 +158,26 @@ function filterTable() { table_filter = $('#table_filter').val(); data_table.ajax.reload(); } + +// Setup status filter +$('#statuses').select2({ + placeholder: "{{ ctrans('texts.status') }}", + //allowClear: true, + templateSelection: function(data, container) { + if (data.id == 'paid') { + $(container).css('color', '#fff'); + $(container).css('background-color', '#f0ad4e'); + $(container).css('border-color', '#eea236'); + } else if (data.id == 'unpaid') { + $(container).css('color', '#fff'); + $(container).css('background-color', '#d9534f'); + $(container).css('border-color', '#d43f3a'); + } + return data.text; + } +}); + + @endsection diff --git a/resources/views/portal/default/layouts/master.blade.php b/resources/views/portal/default/layouts/master.blade.php index f6de9bffa..ce973b864 100644 --- a/resources/views/portal/default/layouts/master.blade.php +++ b/resources/views/portal/default/layouts/master.blade.php @@ -44,17 +44,12 @@ @yield('head') - @include('portal.default.header') @yield('header') - @include('portal.default.sidebar') @yield('sidebar') - @section('body') @yield('body') - @include('portal.default.footer') @yield('footer') - \ No newline at end of file