Merge pull request #2120 from cuneytsenturk/master

Added Notification page
This commit is contained in:
Cüneyt Şentürk
2021-06-20 13:43:05 +03:00
committed by GitHub
37 changed files with 2933 additions and 49 deletions

View File

@ -51,6 +51,7 @@ return [
'templates' => 'Template|Templates',
'sales' => 'Sale|Sales',
'purchases' => 'Purchase|Purchases',
'notifications' => 'Notification|Notifications',
'welcome' => 'Welcome',
'banking' => 'Banking',

View File

@ -4,12 +4,24 @@ return [
'change_language' => 'Change Language',
'last_login' => 'Last login :time',
'notifications' => [
'counter' => '{0} You have no notification|{1} You have :count notification|[2,*] You have :count notifications',
'new_apps' => '{1} :count published app|[2,*] :count published apps',
'overdue_invoices' => '{1} :count overdue invoice|[2,*] :count overdue invoices',
'upcoming_bills' => '{1} :count upcoming bill|[2,*] :count upcoming bills',
'view_all' => 'View All'
'view_all' => 'View All',
'exports' => [
'completed' => '{1} :count finished export|[2,*] :count finished exports',
'failed' => '{1} :count failed export|[2,*] :count failed exports',
],
'imports' => [
'completed' => '{1} :count finished import|[2,*] :count finished imports',
'failed' => '{1} :count failed import|[2,*] :count failed imports',
],
],
'docs_link' => 'https://akaunting.com/docs',
'support_link' => 'https://akaunting.com/support',

View File

@ -6,6 +6,14 @@ return [
'hello' => 'Hello!',
'salutation' => 'Regards,<br> :company_name',
'subcopy' => 'If youre having trouble clicking the ":text" button, copy and paste the URL below into your web browser: [:url](:url)',
'reads' => 'Read|Reads',
'read_all' => 'Read All',
'mark_read' => 'Mark Read',
'mark_read_all' => 'Mark Read All',
'new_apps' => 'New App|New Apps',
'upcoming_bills' => 'Upcoming Bills',
'recurring_invoices' => 'Recurring Invoices',
'recurring_bills' => 'Recurring Bills',
'update' => [
@ -27,28 +35,45 @@ return [
'import' => [
'completed' => [
'subject' => 'Import completed',
'description' => 'The import has been completed and the records are available in your panel.',
],
'failed' => [
'subject' => 'Import failed',
'description' => 'Not able to import the file due to the following issues:',
],
],
'export' => [
'completed' => [
'subject' => 'Export is ready',
'description' => 'The export file is ready to download from the following link:',
],
'failed' => [
'subject' => 'Export failed',
'description' => 'Not able to create the export file due to the following issue:',
],
],
'messages' => [
'mark_read' => ':type is read this notification!',
'mark_read_all' => ':type is read all notification!',
'new_app' => ':type app published.',
'export' => 'Your <b>:type</b> export file is ready to <a href=":url" target="_blank"><b>download</b></a>.',
'import' => 'Your <b>:type</b> lined <b>:count</b> data is imported successfully.',
],
];

View File

@ -2,23 +2,52 @@
@section('title', trans_choice('general.notifications', 2))
@section('content')
<div class="card">
<div class="card-header"></div>
<div class="card-body">
<div class="table-responsive">
<table class="table align-items-center table-flush">
<thead class="thead-light">
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<div class="card-footer">
@include('partials.admin.pagination', ['items' => $notifications])
</div>
</div>
@section('new_button')
<a href="{{ route('notifications.read-all') }}" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm" data-toggle="tooltip" data-placement="right" title="{{ trans('notifications.mark_read_all') }}">
<span class="btn-inner--icon"><i class="fas fa-check-double pt-2"></i></span>
</a>
@endsection
@section('content')
@stack('new_apps')
<livewire:common.notifications.new-apps />
@stack('exports')
<livewire:common.notifications.exports />
@stack('imports')
<livewire:common.notifications.imports />
@stack('invoices_recurring')
<livewire:common.notifications.recurring type="invoice" text-title="notifications.recurring_invoices" />
@stack('invoices_reminder')
<livewire:common.notifications.reminder type="invoice" text-title="widgets.overdue_invoices" />
@stack('bills_recurring')
<livewire:common.notifications.recurring type="bill" text-title="widgets.recurring_bills" />
@stack('bills_reminder')
<livewire:common.notifications.reminder type="bill" text-title="notifications.upcoming_bills" />
@stack('end')
@endsection
@push('body_js')
<script type="text/javascript">
var hash_split = location.hash.split('#');
if (hash_split[1] != undefined) {
document.getElementById(hash_split[1]).scrollIntoView({
behavior: 'smooth'
});
}
</script>
@endpush

View File

@ -0,0 +1,105 @@
@if ($notifications->total())
<div class="card" id="exports">
<div class="card-header">
<div class="row align-items-center">
<div class="col-8">
<h5 class="h3 mb-0">{{ trans('general.export') }}</h5>
</div>
<div class="col-4 text-right">
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2"
data-toggle="tooltip"
data-placement="right"
title="{{ trans('notifications.mark_read_all') }}"
wire:click="markReadAll()"
>
<span class="btn-inner--icon"><i class="fas fa-check-double"></i></span>
</button>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-export">
<tbody>
@foreach ($notifications as $notification)
<tr class="row align-items-center border-top-1">
<td class="col-xs-8 col-sm-10 col-md-10 col-lg-11 col-xl-11 text-left">
@if (empty($notification->message))
{!! trans('notifications.messages.export', [
'type' => $notification->translation,
'file_name' => $notification->file_name,
'url' => $notification->download_url
]) !!}
@else
{!! $notification->message !!}
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm"
data-toggle="tooltip"
data-placement="right"
title="{{ trans('notifications.mark_read') }}"
wire:click="markRead('{{ $notification->notification_id }}')"
>
<span class="btn-inner--icon"><i class="fa fa-check"></i></span>
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@if ($notifications->total() > 5)
<div class="card-footer table-action">
<div class="row">
@if ($notifications->count())
<div class="col-xs-12 col-sm-5 d-flex align-items-center">
{!! Form::select('limit', ['5' => '5'], request('limit', 5), ['class' => 'disabled form-control form-control-sm d-inline-block w-auto d-none d-md-block', 'disabled' => 'disabled']) !!}
<span class="table-text d-none d-lg-block ml-2">
{{ trans('pagination.page') }}
{{ trans('pagination.showing', ['first' => $notifications->firstItem(), 'last' => $notifications->lastItem(), 'total' => $notifications->total()]) }}
</span>
</div>
<div class="col-xs-12 col-sm-7 pagination-xs">
<nav class="float-right">
{!! $notifications->withPath(request()->url())->withQueryString()->links() !!}
</nav>
</div>
@else
<div class="col-xs-12 col-sm-12" id="datatable-basic_info" role="status" aria-live="polite">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
</div>
@endif
</div>
@endif
@push('scripts_start')
<script src="{{ asset('public/vendor/bootstrap-notify/bootstrap-notify.min.js') }}"></script>
@endpush
@push('body_js')
<script type="text/javascript">
window.addEventListener('mark-read', event => {
if (event.detail.type == 'export') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
window.addEventListener('mark-read-all', event => {
if (event.detail.type == 'export') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
</script>
@endpush

View File

@ -0,0 +1,106 @@
@if ($notifications->total())
<div class="card" id="imports">
<div class="card-header">
<div class="row align-items-center">
<div class="col-8">
<h5 class="h3 mb-0">{{ trans('import.import') }}</h5>
</div>
<div class="col-4 text-right">
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2"
data-toggle="tooltip"
data-placement="right"
title="{{ trans('notifications.mark_read_all') }}"
wire:click="markReadAll()"
>
<span class="btn-inner--icon"><i class="fas fa-check-double"></i></span>
</button>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-import">
<tbody>
@foreach ($notifications as $notification)
<tr class="row align-items-center border-top-1">
<td class="col-xs-8 col-sm-10 col-md-10 col-lg-11 col-xl-11 text-left">
@if (empty($notification->message))
{!! trans('notifications.messages.import', [
'type' => $notification->translation,
'count' => $notification->total_rows
]) !!}
@else
@foreach ($notification->errors as $error)
{!! $error !!}
@endforeach
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center">
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm"
data-toggle="tooltip"
data-placement="right"
title="{{ trans('notifications.mark_read') }}"
wire:click="markRead('{{ $notification->notification_id }}')"
>
<span class="btn-inner--icon"><i class="fa fa-check"></i></span>
</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@if ($notifications->total() > 5)
<div class="card-footer table-action">
<div class="row">
@if ($notifications->count())
<div class="col-xs-12 col-sm-5 d-flex align-items-center">
{!! Form::select('limit', ['5' => '5'], request('limit', 5), ['class' => 'disabled form-control form-control-sm d-inline-block w-auto d-none d-md-block', 'disabled' => 'disabled']) !!}
<span class="table-text d-none d-lg-block ml-2">
{{ trans('pagination.page') }}
{{ trans('pagination.showing', ['first' => $notifications->firstItem(), 'last' => $notifications->lastItem(), 'total' => $notifications->total()]) }}
</span>
</div>
<div class="col-xs-12 col-sm-7 pagination-xs">
<nav class="float-right">
{!! $notifications->withPath(request()->url())->withQueryString()->links() !!}
</nav>
</div>
@else
<div class="col-xs-12 col-sm-12" id="datatable-basic_info" role="status" aria-live="polite">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
</div>
@endif
</div>
@endif
@push('scripts_start')
<script src="{{ asset('public/vendor/bootstrap-notify/bootstrap-notify.min.js') }}"></script>
@endpush
@push('body_js')
<script type="text/javascript">
window.addEventListener('mark-read', event => {
if (event.detail.type == 'import') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
window.addEventListener('mark-read-all', event => {
if (event.detail.type == 'import') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
</script>
@endpush

View File

@ -0,0 +1,27 @@
@if ($notifications)
<div class="accordion" id="new-apps">
<div class="card">
<div class="card-header" id="heading-new-apps" data-toggle="collapse" data-target="#collapse-new-apps" aria-expanded="true" aria-controls="collapse-new-apps">
<div class="align-items-center">
<h4 class="mb-0">{{ trans_choice('notifications.new_apps', 2) }}</h4>
</div>
</div>
<div id="collapse-new-apps" class="collapse show" aria-labelledby="heading-new-apps" data-parent="#new-apps">
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-export">
<tbody>
@foreach ($notifications as $notification)
<tr class="row align-items-center border-top-1">
<td class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 text-left">
{!! $notification->message !!}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endif

View File

@ -0,0 +1,249 @@
@if ($notifications->count())
<div class="card" id="recurring-{{$type}}">
<div class="card-header">
<div class="row align-items-center">
<div class="col-8">
<h5 class="h3 mb-0">{{ trans($textTitle) }}</h5>
</div>
<div class="col-4 text-right">
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2"
data-toggle="tooltip"
data-placement="right"
title="{{ trans('notifications.mark_read_all') }}"
wire:click="markReadAll()"
>
<span class="btn-inner--icon"><i class="fas fa-check-double"></i></span>
</button>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-recurring-{{ $type }}">
<thead class="thead-light">
<tr class="row table-head-line">
@stack('document_number_th_start')
@if (!$hideDocumentNumber)
<th class="{{ $classDocumentNumber }}">
@stack('document_number_th_inside_start')
{{ trans_choice($textDocumentNumber, 1) }}
@stack('document_number_th_inside_end')
</th>
@endif
@stack('document_number_th_end')
@stack('contact_name_th_start')
@if (!$hideContactName)
<th class="{{ $classContactName }}">
@stack('contact_name_th_inside_start')
{{ trans_choice($textContactName, 1) }}
@stack('contact_name_th_inside_end')
</th>
@endif
@stack('contact_name_th_end')
@stack('amount_th_start')
@if (!$hideAmount)
<th class="{{ $classAmount }}">
@stack('amount_th_inside_start')
{{ trans('general.amount') }}
@stack('amount_th_inside_end')
</th>
@endif
@stack('amount_th_end')
@stack('issued_at_th_start')
@if (!$hideIssuedAt)
<th class="{{ $classIssuedAt }}">
@stack('issued_at_th_inside_start')
{{ trans($textIssuedAt) }}
@stack('issued_at_th_inside_end')
</th>
@endif
@stack('issued_at_th_end')
@stack('due_at_th_start')
@if (!$hideDueAt)
<th class="{{ $classDueAt }}">
@stack('due_at_th_inside_start')
{{ trans($textDueAt) }}
@stack('due_at_th_inside_end')
</th>
@endif
@stack('due_at_th_end')
@stack('status_th_start')
@if (!$hideStatus)
<th class="{{ $classStatus }}">
@stack('status_th_inside_start')
{{ trans_choice('general.statuses', 1) }}
@stack('status_th_inside_end')
</th>
@endif
@stack('status_th_end')
@if (!$hideActions)
<th class="{{ $classActions }}">
<a>{{ trans_choice('notifications.reads', 1) }}</a>
</th>
@endif
</tr>
</thead>
<tbody>
@foreach($notifications as $item)
<tr class="row align-items-center border-top-1">
@stack('document_number_td_start')
@if (!$hideDocumentNumber)
<td class="{{ $classDocumentNumber }}">
@stack('document_number_td_inside_start')
<a href="{{ route($routeButtonShow , $item->id) }}" target="_blank">{{ $item->document_number }}</a>
@stack('document_number_td_inside_end')
</td>
@endif
@stack('document_number_td_end')
@stack('contact_name_td_start')
@if (!$hideContactName)
<td class="{{ $classContactName }}">
@stack('contact_name_td_inside_start')
{{ $item->contact_name }}
@stack('contact_name_td_inside_end')
</td>
@endif
@stack('contact_name_td_end')
@stack('amount_td_start')
@if (!$hideAmount)
<td class="{{ $classAmount }}">
@stack('amount_td_inside_start')
@money($item->amount, $item->currency_code, true)
@stack('amount_td_inside_end')
</td>
@endif
@stack('amount_td_end')
@stack('issued_at_td_start')
@if (!$hideIssuedAt)
<td class="{{ $classIssuedAt }}">
@stack('issued_at_td_inside_start')
@date($item->issued_at)
@stack('issued_at_td_inside_end')
</td>
@endif
@stack('issued_at_td_end')
@stack('due_at_td_start')
@if (!$hideDueAt)
<td class="{{ $classDueAt }}">
@stack('due_at_td_inside_start')
@date($item->due_at)
@stack('due_at_td_inside_end')
</td>
@endif
@stack('due_at_td_end')
@stack('status_td_start')
@if (!$hideStatus)
<td class="{{ $classStatus }}">
@stack('status_td_inside_start')
<span class="badge badge-pill badge-{{ $item->status_label }}">{{ trans($textDocumentStatus . $item->status) }}</span>
@stack('status_td_inside_end')
</td>
@endif
@stack('status_td_end')
@if (!$hideActions)
<td class="{{ $classActions }}">
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm"
data-toggle="tooltip"
data-placement="right"
title="{{ trans('notifications.mark_read') }}"
wire:click="markRead('{{ $item->notification_id }}')"
>
<span class="btn-inner--icon"><i class="fa fa-check"></i></span>
</button>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
@if ($notifications->total() > 5)
<div class="card-footer table-action">
<div class="row">
@if ($notifications->count())
<div class="col-xs-12 col-sm-5 d-flex align-items-center">
{!! Form::select('limit', ['5' => '5'], request('limit', 5), ['class' => 'disabled form-control form-control-sm d-inline-block w-auto d-none d-md-block', 'disabled' => 'disabled']) !!}
<span class="table-text d-none d-lg-block ml-2">
{{ trans('pagination.page') }}
{{ trans('pagination.showing', ['first' => $notifications->firstItem(), 'last' => $notifications->lastItem(), 'total' => $notifications->total()]) }}
</span>
</div>
<div class="col-xs-12 col-sm-7 pagination-xs">
<nav class="float-right">
{!! $notifications->withPath(request()->url())->withQueryString()->links() !!}
</nav>
</div>
@else
<div class="col-xs-12 col-sm-12" id="datatable-basic_info" role="status" aria-live="polite">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
</div>
@endif
</div>
@endif
@push('scripts_start')
<script src="{{ asset('public/vendor/bootstrap-notify/bootstrap-notify.min.js') }}"></script>
@endpush
@push('body_js')
<script type="text/javascript">
window.addEventListener('mark-read', event => {
if (event.detail.type == 'recurring-{{ $type }}') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
window.addEventListener('mark-read-all', event => {
if (event.detail.type == 'recurring-{{ $type }}') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
</script>
@endpush

View File

@ -0,0 +1,249 @@
@if ($notifications->count())
<div class="card" id="reminder-{{$type}}">
<div class="card-header">
<div class="row align-items-center">
<div class="col-8">
<h5 class="h3 mb-0">{{ trans($textTitle) }}</h5>
</div>
<div class="col-4 text-right">
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2"
data-toggle="tooltip"
data-placement="right"
title="{{ trans('notifications.mark_read_all') }}"
wire:click="markReadAll()"
>
<span class="btn-inner--icon"><i class="fas fa-check-double"></i></span>
</button>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-reminder-{{ $type }}">
<thead class="thead-light">
<tr class="row table-head-line">
@stack('document_number_th_start')
@if (!$hideDocumentNumber)
<th class="{{ $classDocumentNumber }}">
@stack('document_number_th_inside_start')
{{ trans_choice($textDocumentNumber, 1) }}
@stack('document_number_th_inside_end')
</th>
@endif
@stack('document_number_th_end')
@stack('contact_name_th_start')
@if (!$hideContactName)
<th class="{{ $classContactName }}">
@stack('contact_name_th_inside_start')
{{ trans_choice($textContactName, 1) }}
@stack('contact_name_th_inside_end')
</th>
@endif
@stack('contact_name_th_end')
@stack('amount_th_start')
@if (!$hideAmount)
<th class="{{ $classAmount }}">
@stack('amount_th_inside_start')
{{ trans('general.amount') }}
@stack('amount_th_inside_end')
</th>
@endif
@stack('amount_th_end')
@stack('issued_at_th_start')
@if (!$hideIssuedAt)
<th class="{{ $classIssuedAt }}">
@stack('issued_at_th_inside_start')
{{ trans($textIssuedAt) }}
@stack('issued_at_th_inside_end')
</th>
@endif
@stack('issued_at_th_end')
@stack('due_at_th_start')
@if (!$hideDueAt)
<th class="{{ $classDueAt }}">
@stack('due_at_th_inside_start')
{{ trans($textDueAt) }}
@stack('due_at_th_inside_end')
</th>
@endif
@stack('due_at_th_end')
@stack('status_th_start')
@if (!$hideStatus)
<th class="{{ $classStatus }}">
@stack('status_th_inside_start')
{{ trans_choice('general.statuses', 1) }}
@stack('status_th_inside_end')
</th>
@endif
@stack('status_th_end')
@if (!$hideActions)
<th class="{{ $classActions }}">
<a>{{ trans_choice('notifications.reads', 1) }}</a>
</th>
@endif
</tr>
</thead>
<tbody>
@foreach($notifications as $item)
<tr class="row align-items-center border-top-1">
@stack('document_number_td_start')
@if (!$hideDocumentNumber)
<td class="{{ $classDocumentNumber }}">
@stack('document_number_td_inside_start')
<a href="{{ route($routeButtonShow , $item->id) }}" target="_blank">{{ $item->document_number }}</a>
@stack('document_number_td_inside_end')
</td>
@endif
@stack('document_number_td_end')
@stack('contact_name_td_start')
@if (!$hideContactName)
<td class="{{ $classContactName }}">
@stack('contact_name_td_inside_start')
{{ $item->contact_name }}
@stack('contact_name_td_inside_end')
</td>
@endif
@stack('contact_name_td_end')
@stack('amount_td_start')
@if (!$hideAmount)
<td class="{{ $classAmount }}">
@stack('amount_td_inside_start')
@money($item->amount, $item->currency_code, true)
@stack('amount_td_inside_end')
</td>
@endif
@stack('amount_td_end')
@stack('issued_at_td_start')
@if (!$hideIssuedAt)
<td class="{{ $classIssuedAt }}">
@stack('issued_at_td_inside_start')
@date($item->issued_at)
@stack('issued_at_td_inside_end')
</td>
@endif
@stack('issued_at_td_end')
@stack('due_at_td_start')
@if (!$hideDueAt)
<td class="{{ $classDueAt }}">
@stack('due_at_td_inside_start')
@date($item->due_at)
@stack('due_at_td_inside_end')
</td>
@endif
@stack('due_at_td_end')
@stack('status_td_start')
@if (!$hideStatus)
<td class="{{ $classStatus }}">
@stack('status_td_inside_start')
<span class="badge badge-pill badge-{{ $item->status_label }}">{{ trans($textDocumentStatus . $item->status) }}</span>
@stack('status_td_inside_end')
</td>
@endif
@stack('status_td_end')
@if (!$hideActions)
<td class="{{ $classActions }}">
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm"
data-toggle="tooltip"
data-placement="right"
title="{{ trans('notifications.mark_read') }}"
wire:click="markRead('{{ $item->notification_id }}')"
>
<span class="btn-inner--icon"><i class="fa fa-check"></i></span>
</button>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
@if ($notifications->total() > 5)
<div class="card-footer table-action">
<div class="row">
@if ($notifications->count())
<div class="col-xs-12 col-sm-5 d-flex align-items-center">
{!! Form::select('limit', ['5' => '5'], request('limit', 5), ['class' => 'disabled form-control form-control-sm d-inline-block w-auto d-none d-md-block', 'disabled' => 'disabled']) !!}
<span class="table-text d-none d-lg-block ml-2">
{{ trans('pagination.page') }}
{{ trans('pagination.showing', ['first' => $notifications->firstItem(), 'last' => $notifications->lastItem(), 'total' => $notifications->total()]) }}
</span>
</div>
<div class="col-xs-12 col-sm-7 pagination-xs">
<nav class="float-right">
{!! $notifications->withPath(request()->url())->withQueryString()->links() !!}
</nav>
</div>
@else
<div class="col-xs-12 col-sm-12" id="datatable-basic_info" role="status" aria-live="polite">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
</div>
@endif
</div>
@endif
@push('scripts_start')
<script src="{{ asset('public/vendor/bootstrap-notify/bootstrap-notify.min.js') }}"></script>
@endpush
@push('body_js')
<script type="text/javascript">
window.addEventListener('mark-read', event => {
if (event.detail.type == 'reminder-{{ $type }}') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
window.addEventListener('mark-read-all', event => {
if (event.detail.type == 'reminder-{{ $type }}') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
</script>
@endpush

View File

@ -127,11 +127,106 @@
@endif
<div class="list-group list-group-flush">
@stack('notification_new_apps_start')
@if (!empty($new_apps) && count($new_apps))
<a href="{{ route('notifications.index') . '#new-apps' }}" class="list-group-item list-group-item-action">
<div class="row align-items-center">
<div class="col-auto">
<i class="fa fa-rocket"></i>
</div>
<div class="col ml--2">
<div class="d-flex justify-content-between align-items-center">
<h4 class="mb-0 text-sm">{{ trans_choice('header.notifications.new_apps', count($new_apps), ['count' => count($new_apps)]) }}</h4>
</div>
</div>
</div>
</a>
@endif
@stack('notification_new_apps_end')
@stack('notification_exports_completed_start')
@if (!empty($exports['completed']) && count($exports['completed']))
<a href="{{ route('notifications.index') . '#exports' }}" class="list-group-item list-group-item-action">
<div class="row align-items-center">
<div class="col-auto">
<i class="fas fa-file-export"></i>
</div>
<div class="col ml--2">
<div class="d-flex justify-content-between align-items-center">
<h4 class="mb-0 text-sm">{{ trans_choice('header.notifications.exports.completed', count($exports['completed']), ['count' => count($exports['completed'])]) }}</h4>
</div>
</div>
</div>
</a>
@endif
@stack('notification_exports_completed_end')
@stack('notification_exports_failed_start')
@if (!empty($exports['failed']) && count($exports['failed']))
<a href="{{ route('notifications.index') . '#exports' }}" class="list-group-item list-group-item-action">
<div class="row align-items-center">
<div class="col-auto">
<i class="fas fa-file-export"></i>
</div>
<div class="col ml--2">
<div class="d-flex justify-content-between align-items-center">
<h4 class="mb-0 text-sm">{{ trans_choice('header.notifications.exports.failed', count($exports['failed']), ['count' => count($exports['failed'])]) }}</h4>
</div>
</div>
</div>
</a>
@endif
@stack('notification_exports_failed_end')
@stack('notification_imports_completed_start')
@if (!empty($imports['completed']) && count($imports['completed']))
<a href="{{ route('notifications.index') . '#imports' }}" class="list-group-item list-group-item-action">
<div class="row align-items-center">
<div class="col-auto">
<i class="fas fa-file-import"></i>
</div>
<div class="col ml--2">
<div class="d-flex justify-content-between align-items-center">
<h4 class="mb-0 text-sm">{{ trans_choice('header.notifications.imports.completed', count($imports['completed']), ['count' => count($imports['completed'])]) }}</h4>
</div>
</div>
</div>
</a>
@endif
@stack('notification_imports_completed_end')
@stack('notification_imports_failed_start')
@if (!empty($imports['failed']) && count($imports['failed']))
<a href="{{ route('notifications.index') . '#imports' }}" class="list-group-item list-group-item-action">
<div class="row align-items-center">
<div class="col-auto">
<i class="fas fa-file-import"></i>
</div>
<div class="col ml--2">
<div class="d-flex justify-content-between align-items-center">
<h4 class="mb-0 text-sm">{{ trans_choice('header.notifications.imports.failed', count($imports['failed']), ['count' => count($imports['failed'])]) }}</h4>
</div>
</div>
</div>
</a>
@endif
@stack('notification_imports_failed_end')
@stack('notification_bills_start')
@can('read-purchases-bills')
@if (count($bills))
<a href="{{ route('users.read.bills', $user->id) }}" class="list-group-item list-group-item-action">
<a href="{{ route('notifications.index') . '#reminder-bill' }}" class="list-group-item list-group-item-action">
<div class="row align-items-center">
<div class="col-auto">
<i class="fa fa-shopping-cart"></i>
@ -152,7 +247,7 @@
@can('read-sales-invoices')
@if (count($invoices))
<a href="{{ route('users.read.invoices', $user->id) }}" class="list-group-item list-group-item-action">
<a href="{{ route('notifications.index') . '#reminder-invoice' }}" class="list-group-item list-group-item-action">
<div class="row align-items-center">
<div class="col-auto">
<i class="fa fa-money-bill"></i>
@ -171,7 +266,7 @@
</div>
@if ($notifications)
<a href="#" class="dropdown-item text-center text-primary font-weight-bold py-3">{{ trans('header.notifications.view_all') }}</a>
<a href="{{ route('notifications.index') }}" class="dropdown-item text-center text-primary font-weight-bold py-3">{{ trans('header.notifications.view_all') }}</a>
@else
<a class="dropdown-item text-center text-primary font-weight-bold py-3">{{ trans_choice('header.notifications.counter', $notifications, ['count' => $notifications]) }}</a>
@endif

View File

@ -124,6 +124,12 @@
}
})
})();
$(document).ready(function () {
if ($("[data-toggle=tooltip]").length) {
$("[data-toggle=tooltip]").tooltip();
}
});
</script>
@stack('body_css')

View File

@ -0,0 +1,48 @@
<div>
@if ($paginator->hasPages())
<nav>
<ul class="pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
<span class="page-link" aria-hidden="true">&lsaquo;</span>
</li>
@else
<li class="page-item">
<button type="button" dusk="previousPage" class="page-link" wire:click="previousPage" wire:loading.attr="disabled" rel="prev" aria-label="@lang('pagination.previous')">&lsaquo;</button>
</li>
@endif
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
@endif
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<li class="page-item active" wire:key="paginator-page-{{ $page }}" aria-current="page"><span class="page-link">{{ $page }}</span></li>
@else
<li class="page-item" wire:key="paginator-page-{{ $page }}"><button type="button" class="page-link" wire:click="gotoPage({{ $page }})">{{ $page }}</button></li>
@endif
@endforeach
@endif
@endforeach
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<li class="page-item">
<button type="button" dusk="nextPage" class="page-link" wire:click="nextPage" wire:loading.attr="disabled" rel="next" aria-label="@lang('pagination.next')">&rsaquo;</button>
</li>
@else
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
<span class="page-link" aria-hidden="true">&rsaquo;</span>
</li>
@endif
</ul>
</nav>
@endif
</div>

View File

@ -0,0 +1,48 @@
<ul class="pagination justify-content-end mb-0">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="page-item disabled">
<a class="page-link" href="#" tabindex="-1">
<i class="fas fa-angle-left"></i>
</a>
</li>
@else
<li class="page-item">
<button type="button" dusk="previousPage" class="page-link" wire:click="previousPage" wire:loading.attr="disabled" rel="prev" aria-label="@lang('pagination.previous')">
<i class="fas fa-angle-left"></i>
</button>
</li>
@endif
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
@endif
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<li class="page-item active" wire:key="paginator-page-{{ $page }}" aria-current="page"><span class="page-link">{{ $page }}</span></li>
@else
<li class="page-item" wire:key="paginator-page-{{ $page }}"><button type="button" class="page-link" wire:click="gotoPage({{ $page }})">{{ $page }}</button></li>
@endif
@endforeach
@endif
@endforeach
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<li class="page-item">
<button type="button" dusk="nextPage" class="page-link" wire:click="nextPage" wire:loading.attr="disabled" rel="next" aria-label="@lang('pagination.next')">
<i class="fas fa-angle-right"></i>
</button>
</li>
@else
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
<span class="page-link" aria-hidden="true"><i class="fas fa-angle-right"></i></span>
</li>
@endif
</ul>

View File

@ -0,0 +1,29 @@
<div>
@if ($paginator->hasPages())
<nav>
<ul class="pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="page-item disabled" aria-disabled="true">
<span class="page-link">@lang('pagination.previous')</span>
</li>
@else
<li class="page-item">
<button type="button" class="page-link" wire:click="previousPage" wire:loading.attr="disabled" rel="prev">@lang('pagination.previous')</button>
</li>
@endif
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<li class="page-item">
<button type="button" class="page-link" wire:click="nextPage" wire:loading.attr="disabled" rel="next">@lang('pagination.next')</button>
</li>
@else
<li class="page-item disabled" aria-disabled="true">
<span class="page-link">@lang('pagination.next')</span>
</li>
@endif
</ul>
</nav>
@endif
</div>

View File

@ -0,0 +1,31 @@
<div>
@if ($paginator->hasPages())
<nav role="navigation" aria-label="Pagination Navigation" class="flex justify-between">
<span>
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
{!! __('pagination.previous') !!}
</span>
@else
<button wire:click="previousPage" wire:loading.attr="disabled" rel="prev" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
{!! __('pagination.previous') !!}
</button>
@endif
</span>
<span>
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<button wire:click="nextPage" wire:loading.attr="disabled" rel="next" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
{!! __('pagination.next') !!}
</button>
@else
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
{!! __('pagination.next') !!}
</span>
@endif
</span>
</nav>
@endif
</div>

View File

@ -0,0 +1,114 @@
<div>
@if ($paginator->hasPages())
<nav role="navigation" aria-label="Pagination Navigation" class="flex items-center justify-between">
<div class="flex justify-between flex-1 sm:hidden">
<span>
@if ($paginator->onFirstPage())
<span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
{!! __('pagination.previous') !!}
</span>
@else
<button wire:click="previousPage" wire:loading.attr="disabled" dusk="previousPage.before" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
{!! __('pagination.previous') !!}
</button>
@endif
</span>
<span>
@if ($paginator->hasMorePages())
<button wire:click="nextPage" wire:loading.attr="disabled" dusk="nextPage.before" class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
{!! __('pagination.next') !!}
</button>
@else
<span class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
{!! __('pagination.next') !!}
</span>
@endif
</span>
</div>
<div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
<div>
<p class="text-sm text-gray-700 leading-5">
<span>{!! __('Showing') !!}</span>
<span class="font-medium">{{ $paginator->firstItem() }}</span>
<span>{!! __('to') !!}</span>
<span class="font-medium">{{ $paginator->lastItem() }}</span>
<span>{!! __('of') !!}</span>
<span class="font-medium">{{ $paginator->total() }}</span>
<span>{!! __('results') !!}</span>
</p>
</div>
<div>
<span class="relative z-0 inline-flex shadow-sm">
<span>
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<span aria-disabled="true" aria-label="{{ __('pagination.previous') }}">
<span class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-l-md leading-5" aria-hidden="true">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
</svg>
</span>
</span>
@else
<button wire:click="previousPage" dusk="previousPage.after" rel="prev" class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.previous') }}">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
</svg>
</button>
@endif
</span>
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<span aria-disabled="true">
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 cursor-default leading-5">{{ $element }}</span>
</span>
@endif
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
<span wire:key="paginator-page{{ $page }}">
@if ($page == $paginator->currentPage())
<span aria-current="page">
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">{{ $page }}</span>
</span>
@else
<button wire:click="gotoPage({{ $page }})" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-500 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
{{ $page }}
</button>
@endif
</span>
@endforeach
@endif
@endforeach
<span>
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<button wire:click="nextPage" dusk="nextPage.after" rel="next" class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.next') }}">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</button>
@else
<span aria-disabled="true" aria-label="{{ __('pagination.next') }}">
<span class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-r-md leading-5" aria-hidden="true">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
</svg>
</span>
</span>
@endif
</span>
</span>
</div>
</div>
</nav>
@endif
</div>