Client portal improvements (#3607)

* Remove Html\Builder dependency from controllers

* Remove: yajra/laravel-datatables-html

- yajra/laravel-datatables-oracle as main non-dev dependency

* Added sorting to tables
This commit is contained in:
Benjamin Beganović 2020-04-09 04:18:07 +02:00 committed by GitHub
parent 2103758d36
commit 8f4fa5e80d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 10774 additions and 79 deletions

View File

@ -21,6 +21,8 @@ use App\Utils\Traits\MakesDates;
use App\Utils\Traits\MakesHash; use App\Utils\Traits\MakesHash;
use Cache; use Cache;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Yajra\DataTables\Facades\DataTables;
/** /**
* Class PaymentController * Class PaymentController
* @package App\Http\Controllers\ClientPortal\PaymentController * @package App\Http\Controllers\ClientPortal\PaymentController

View File

@ -17,6 +17,7 @@ use App\Http\Requests\ClientPortal\CreatePaymentMethodRequest;
use App\Models\ClientGatewayToken; use App\Models\ClientGatewayToken;
use App\Utils\Traits\MakesDates; use App\Utils\Traits\MakesDates;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class PaymentMethodController extends Controller class PaymentMethodController extends Controller
{ {

View File

@ -22,6 +22,7 @@ use App\Utils\Traits\MakesHash;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Notification;
use Yajra\DataTables\Facades\DataTables;
/** /**
* Class InvoiceController * Class InvoiceController
@ -36,7 +37,6 @@ class RecurringInvoiceController extends Controller
/** /**
* Show the list of recurring invoices. * Show the list of recurring invoices.
* *
* @param Builder $builder
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/ */
public function index() public function index()

View File

@ -47,7 +47,8 @@
"staudenmeir/eloquent-has-many-deep": "^1.11", "staudenmeir/eloquent-has-many-deep": "^1.11",
"stripe/stripe-php": "^7.0", "stripe/stripe-php": "^7.0",
"superbalist/laravel-google-cloud-storage": "^2.2", "superbalist/laravel-google-cloud-storage": "^2.2",
"webpatser/laravel-countries": "dev-master#75992ad" "webpatser/laravel-countries": "dev-master#75992ad",
"yajra/laravel-datatables-oracle": "~9.0"
}, },
"require-dev": { "require-dev": {
"laravelcollective/html": "^6", "laravelcollective/html": "^6",

2
public/css/app.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"/js/app.js": "/js/app.js?id=8b49701583f407403ddf", "/js/app.js": "/js/app.js?id=8b49701583f407403ddf",
"/css/app.css": "/css/app.css?id=422c8d1b7e15aa054cd7", "/css/app.css": "/css/app.css?id=94397d09115c3157cc49",
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=caec43815d9a13168a38", "/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=caec43815d9a13168a38",
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=af49e24958be5fc00c92", "/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=af49e24958be5fc00c92",
"/js/clients/payment_methods/authorize-stripe-card.js": "/js/clients/payment_methods/authorize-stripe-card.js?id=f4c45f0da9868d840799", "/js/clients/payment_methods/authorize-stripe-card.js": "/js/clients/payment_methods/authorize-stripe-card.js?id=f4c45f0da9868d840799",

View File

@ -9,6 +9,7 @@
@import 'components/inputs'; @import 'components/inputs';
@import 'components/alerts'; @import 'components/alerts';
@import 'components/badge'; @import 'components/badge';
@import 'components/datatables';
.active-page { .active-page {
@apply bg-blue-900 #{!important}; @apply bg-blue-900 #{!important};

View File

@ -0,0 +1,37 @@
.dataTables_wrapper.no-footer {
@apply bg-gray-50 #{!important};
}
.dataTables_wrapper select,
.dataTables_wrapper .dataTables_filter input {
@apply text-gray-700 px-4 py-2 #{!important};
}
.dataTables_length {
@apply p-3 #{!important};
}
.dataTables_filter {
@apply p-3 #{!important};
input {
@apply items-center border border-gray-300 rounded px-4 text-sm py-1 #{!important};
}
}
table.dataTable thead th,
table.dataTable thead td {
@apply border-b border-gray-200 #{!important};
}
.dataTables_info {
@apply p-3 text-sm #{!important};
}
.dataTables_paginate {
@apply text-sm #{!important};
}
.dataTable.no-footer {
@apply border-none #{!important};
}

View File

@ -1,6 +1,10 @@
@extends('portal.ninja2020.layout.app') @extends('portal.ninja2020.layout.app')
@section('meta_title', ctrans('texts.credits')) @section('meta_title', ctrans('texts.credits'))
@push('head')
<link rel="stylesheet" href="{{ asset('js/vendor/datatables/datatables.min.css') }}">
@endpush
@section('header') @section('header')
{{ Breadcrumbs::render('credits') }} {{ Breadcrumbs::render('credits') }}
@ -85,3 +89,14 @@
</div> </div>
</div> </div>
@endsection @endsection
@push('footer')
<script src="{{ asset('js/clients/quotes/action-selectors.js') }}"></script>
<script src="{{ asset('js/vendor/datatables/datatables.min.js') }}"></script>
<script>
$(document).ready(function() {
$('table').DataTable();
});
</script>
@endpush

View File

@ -1,16 +1,20 @@
@extends('portal.ninja2020.layout.app') @extends('portal.ninja2020.layout.app')
@section('meta_title', ctrans('texts.invoices')) @section('meta_title', ctrans('texts.invoices'))
@push('head')
<link rel="stylesheet" href="{{ asset('js/vendor/datatables/datatables.min.css') }}">
@endpush
@section('header') @section('header')
{{ Breadcrumbs::render('invoices') }} {{ Breadcrumbs::render('invoices') }}
@if($errors->any()) @if($errors->any())
<div class="alert alert-failure mb-4"> <div class="alert alert-failure mb-4">
@foreach($errors->all() as $error) @foreach($errors->all() as $error)
<p>{{ $error }}</p> <p>{{ $error }}</p>
@endforeach @endforeach
</div> </div>
@endif @endif
<div class="bg-white shadow rounded mb-4" translate> <div class="bg-white shadow rounded mb-4" translate>
<div class="px-4 py-5 sm:p-6"> <div class="px-4 py-5 sm:p-6">
@ -35,81 +39,74 @@
<span>{{ ctrans('texts.with_selected') }}</span> <span>{{ ctrans('texts.with_selected') }}</span>
<form action="{{ route('client.invoices.bulk') }}" method="post" id="bulkActions"> <form action="{{ route('client.invoices.bulk') }}" method="post" id="bulkActions">
@csrf @csrf
<button type="submit" class="button button-primary" name="action" <button type="submit" class="button button-primary" name="action" value="download">{{ ctrans('texts.download') }}</button>
value="download">{{ ctrans('texts.download') }}</button> <button type="submit" class="button button-primary" name="action" value="payment">{{ ctrans('texts.pay_now') }}</button>
<button type="submit" class="button button-primary" name="action"
value="payment">{{ ctrans('texts.pay_now') }}</button>
</form> </form>
</div> </div>
<div class="flex flex-col mt-4"> <div class="flex flex-col mt-4">
<div class="-my-2 py-2 overflow-x-auto sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8"> <div class="-my-2 py-2 overflow-x-auto sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8">
<div <div class="align-middle inline-block min-w-full shadow overflow-hidden rounded border-b border-gray-200">
class="align-middle inline-block min-w-full shadow overflow-hidden rounded border-b border-gray-200">
<table class="min-w-full"> <table class="min-w-full">
<thead> <thead>
<tr> <tr>
<th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"> <th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider">
<label> <label>
<input type="checkbox" class="form-check form-check-parent"> <input type="checkbox" class="form-check form-check-parent">
</label> </label>
</th> </th>
<th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"> <th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider">
{{ ctrans('texts.invoice_number') }} {{ ctrans('texts.invoice_number') }}
</th> </th>
<th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"> <th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider">
{{ ctrans('texts.invoice_date') }} {{ ctrans('texts.invoice_date') }}
</th> </th>
<th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"> <th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider">
{{ ctrans('texts.balance') }} {{ ctrans('texts.balance') }}
</th> </th>
<th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"> <th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider">
{{ ctrans('texts.due_date') }} {{ ctrans('texts.due_date') }}
</th> </th>
<th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider"> <th class="px-6 py-3 border-b border-gray-200 bg-gray-50 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider">
{{ ctrans('texts.status') }} {{ ctrans('texts.status') }}
</th> </th>
<th class="px-6 py-3 border-b border-gray-200 bg-gray-50"></th> <th class="px-6 py-3 border-b border-gray-200 bg-gray-50"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($invoices as $invoice) @foreach($invoices as $invoice)
<tr class="bg-white group hover:bg-gray-100"> <tr class="bg-white group hover:bg-gray-100">
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 font-medium text-gray-900"> <td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 font-medium text-gray-900">
<label> <label>
<input type="checkbox" class="form-check form-check-child" <input type="checkbox" class="form-check form-check-child ml-2" data-value="{{ $invoice->hashed_id }}">
data-value="{{ $invoice->hashed_id }}"> </label>
</label> </td>
</td> <td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500"> {{ $invoice->number }}
{{ $invoice->number }} </td>
</td> <td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500"> {{ $invoice->due_date }} <!-- $invoice->formatDate($invoice->date, $invoice->client->date_format())-->
{{ $invoice->due_date }} <!-- $invoice->formatDate($invoice->date, $invoice->client->date_format())--> </td>
</td> <td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500"> {{ App\Utils\Number::formatMoney($invoice->balance, $invoice->client) }}
{{ App\Utils\Number::formatMoney($invoice->balance, $invoice->client) }} </td>
</td> <td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500"> {{ $invoice->formatDate($invoice->due_date, $invoice->client->date_format()) }}
{{ $invoice->formatDate($invoice->due_date, $invoice->client->date_format()) }} </td>
</td> <td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500"> {!! App\Models\Invoice::badgeForStatus($invoice->status) !!}
{!! App\Models\Invoice::badgeForStatus($invoice->status) !!} </td>
</td> <td class="px-6 py-4 whitespace-no-wrap flex items-center justify-end text-sm leading-5 font-medium">
<td class="px-6 py-4 whitespace-no-wrap flex items-center justify-end text-sm leading-5 font-medium"> @if($invoice->isPayable())
@if($invoice->isPayable()) <button class="button button-primary py-1 px-2 text-xs uppercase mr-3 pay-now-button" data-value="{{ $invoice->hashed_id }}">
<button @lang('texts.pay_now')
class="button button-primary py-1 px-2 text-xs uppercase mr-3 pay-now-button" </button>
data-value="{{ $invoice->hashed_id }}"> @endif
@lang('texts.pay_now') <a href="{{ route('client.invoice.show', $invoice->hashed_id) }}" class="button-link">
</button> @lang('texts.view')
@endif </a>
<a href="{{ route('client.invoice.show', $invoice->hashed_id) }}" </td>
class="button-link"> </tr>
@lang('texts.view') @endforeach
</a>
</td>
</tr>
@endforeach
</tbody> </tbody>
</table> </table>
</div> </div>
@ -121,5 +118,13 @@
@endsection @endsection
@push('footer') @push('footer')
<script src="{{ asset('js/vendor/jquery-3.3.1/jquery-3.3.1.min.js') }}"></script>
<script src="{{ asset('js/vendor/datatables/datatables.min.js') }}"></script>
<script src="{{ asset('js/clients/invoices/action-selectors.js') }}"></script> <script src="{{ asset('js/clients/invoices/action-selectors.js') }}"></script>
@endpush
<script>
$(document).ready(function() {
$('table').DataTable();
});
</script>
@endpush

View File

@ -1,6 +1,10 @@
@extends('portal.ninja2020.layout.app') @extends('portal.ninja2020.layout.app')
@section('meta_title', ctrans('texts.payment_methods')) @section('meta_title', ctrans('texts.payment_methods'))
@push('head')
<link rel="stylesheet" href="{{ asset('js/vendor/datatables/datatables.min.css') }}">
@endpush
@section('header') @section('header')
{{ Breadcrumbs::render('payment_methods') }} {{ Breadcrumbs::render('payment_methods') }}
@ -108,3 +112,13 @@
</div> </div>
</div> </div>
@endsection @endsection
@push('footer')
<script src="{{ asset('js/vendor/datatables/datatables.min.js') }}"></script>
<script>
$(document).ready(function() {
$('table').DataTable();
});
</script>
@endpush

View File

@ -1,6 +1,10 @@
@extends('portal.ninja2020.layout.app') @extends('portal.ninja2020.layout.app')
@section('meta_title', ctrans('texts.payments')) @section('meta_title', ctrans('texts.payments'))
@push('head')
<link rel="stylesheet" href="{{ asset('js/vendor/datatables/datatables.min.css') }}">
@endpush
@section('header') @section('header')
{{ Breadcrumbs::render('payments') }} {{ Breadcrumbs::render('payments') }}
@ -83,3 +87,13 @@
</div> </div>
</div> </div>
@endsection @endsection
@push('footer')
<script src="{{ asset('js/vendor/datatables/datatables.min.js') }}"></script>
<script>
$(document).ready(function() {
$('table').DataTable();
});
</script>
@endpush

View File

@ -1,6 +1,10 @@
@extends('portal.ninja2020.layout.app') @extends('portal.ninja2020.layout.app')
@section('meta_title', ctrans('texts.quotes')) @section('meta_title', ctrans('texts.quotes'))
@push('head')
<link rel="stylesheet" href="{{ asset('js/vendor/datatables/datatables.min.css') }}">
@endpush
@section('header') @section('header')
{{ Breadcrumbs::render('quotes') }} {{ Breadcrumbs::render('quotes') }}
@ -114,4 +118,11 @@
@push('footer') @push('footer')
<script src="{{ asset('js/clients/quotes/action-selectors.js') }}"></script> <script src="{{ asset('js/clients/quotes/action-selectors.js') }}"></script>
<script src="{{ asset('js/vendor/datatables/datatables.min.js') }}"></script>
<script>
$(document).ready(function() {
$('table').DataTable();
});
</script>
@endpush @endpush

View File

@ -1,6 +1,10 @@
@extends('portal.ninja2020.layout.app') @extends('portal.ninja2020.layout.app')
@section('meta_title', ctrans('texts.recurring_invoices')) @section('meta_title', ctrans('texts.recurring_invoices'))
@push('head')
<link rel="stylesheet" href="{{ asset('js/vendor/datatables/datatables.min.css') }}">
@endpush
@section('header') @section('header')
{{ Breadcrumbs::render('recurring_invoices') }} {{ Breadcrumbs::render('recurring_invoices') }}
@ -83,3 +87,14 @@
</div> </div>
</div> </div>
@endsection @endsection
@push('footer')
<script src="{{ asset('js/vendor/datatables/datatables.min.js') }}"></script>
<script src="{{ asset('js/clients/invoices/action-selectors.js') }}"></script>
<script>
$(document).ready(function() {
$('table').DataTable();
});
</script>
@endpush