Merge pull request #2149 from cuneytsenturk/master

Notification page styling
This commit is contained in:
Cüneyt Şentürk 2021-06-27 18:07:26 +03:00 committed by GitHub
commit 1161b8cf86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 769 additions and 581 deletions

View File

@ -34,7 +34,19 @@ class Notifications extends Controller
$notification->markAsRead(); $notification->markAsRead();
} }
$message = trans('messages.success.duplicated', ['type' => trans_choice('general.items', 1)]); // Hide New Apps Notifications
$module_notifications = $this->getNotifications('new-apps' );
foreach ($module_notifications as $module_notification) {
setting()->set('notifications.'. user()->id . '.' . $module_notification->alias . '.name', $module_notification->name);
setting()->set('notifications.'. user()->id . '.' . $module_notification->alias . '.message', $module_notification->alias);
setting()->set('notifications.'. user()->id . '.' . $module_notification->alias . '.date', Date::now());
setting()->set('notifications.'. user()->id . '.' . $module_notification->alias . '.status', '0');
}
setting()->save();
$message = trans('messages.success.duplicated', ['type' => trans_choice('general.notificatinos', 1)]);
flash($message)->success(); flash($message)->success();

View File

@ -2,6 +2,7 @@
namespace App\Http\Livewire\Common\Notifications; namespace App\Http\Livewire\Common\Notifications;
use Date;
use App\Traits\Modules; use App\Traits\Modules;
use Livewire\Component; use Livewire\Component;
@ -9,10 +10,91 @@ class NewApps extends Component
{ {
use Modules; use Modules;
public function markRead($alias)
{
$notifications = $this->getNotifications('new-apps' );
foreach ($notifications as $notification) {
if ($notification->alias != $alias) {
continue;
}
$readed = $notification;
}
setting()->set('notifications.'. user()->id . '.' . $alias . '.name', $readed->name);
setting()->set('notifications.'. user()->id . '.' . $alias . '.message', $readed->alias);
setting()->set('notifications.'. user()->id . '.' . $alias . '.date', Date::now());
setting()->set('notifications.'. user()->id . '.' . $alias . '.status', '0');
setting()->save();
$this->dispatchBrowserEvent('mark-read', [
'type' => 'new-apps',
'message' => trans('notifications.messages.mark_read', ['type' => $notification->name]),
]);
}
public function markReadAll()
{
$notifications = $this->getNotifications('new-apps' );
foreach ($notifications as $notification) {
setting()->set('notifications.'. user()->id . '.' . $notification->alias . '.name', $notification->name);
setting()->set('notifications.'. user()->id . '.' . $notification->alias . '.message', $notification->alias);
setting()->set('notifications.'. user()->id . '.' . $notification->alias . '.date', Date::now());
setting()->set('notifications.'. user()->id . '.' . $notification->alias . '.status', '0');
}
setting()->save();
$this->dispatchBrowserEvent('mark-read-all', [
'type' => 'new-apps',
'message' => trans('notifications.messages.mark_read_all', ['type' => trans_choice('notifications.new_apps', 2)]),
]);
}
public function render() public function render()
{ {
$notifications = $this->getNotifications('new-apps'); $notifications = $this->getNotifications('new-apps');
$this->clearReadNotifications($notifications);
return view('livewire.common.notifications.new-apps', compact('notifications')); return view('livewire.common.notifications.new-apps', compact('notifications'));
} }
protected function clearReadNotifications(&$notifications)
{
$hide_notifications = setting('notifications.' . user()->id);
if (!$hide_notifications) {
return;
}
if (!$notifications) {
return;
}
$aliases = [];
// MarkRead app notification
foreach ($notifications as $index => $notification) {
$aliases[] = $notification->alias;
if (setting('notifications.' . user()->id . '.' . $notification->alias)) {
unset($notifications[$index]);
}
}
// Clear setting table missing notification
foreach ($hide_notifications as $alias => $hide_notification) {
if (in_array($alias, $aliases)) {
continue;
}
setting()->forget('notifications.' . user()->id . '.' . $alias);
setting()->save();
}
}
} }

View File

@ -31,7 +31,7 @@
@stack('bills_recurring') @stack('bills_recurring')
<livewire:common.notifications.recurring type="bill" text-title="widgets.recurring_bills" /> <livewire:common.notifications.recurring type="bill" text-title="notifications.recurring_bills" />
@stack('bills_reminder') @stack('bills_reminder')
@ -48,6 +48,9 @@
document.getElementById(hash_split[1]).scrollIntoView({ document.getElementById(hash_split[1]).scrollIntoView({
behavior: 'smooth' behavior: 'smooth'
}); });
document.getElementById('collapse-' + hash_split[1]).classList.add('show');
document.getElementById('heading-' + hash_split[1]).ariaExpanded = 'true';
} }
</script> </script>
@endpush @endpush

View File

@ -1,83 +1,95 @@
@if ($notifications->total()) <div class="accordion" id="exports">
<div class="card" id="exports"> <div class="card">
<div class="card-header"> <div class="card-header" id="heading-exports" data-toggle="collapse" data-target="#collapse-exports"
aria-expanded="false" aria-controls="collapse-exports">
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col-8"> <div class="col-12">
<h5 class="h3 mb-0">{{ trans('general.export') }}</h5> <h3 class="mb-0">
</div> {{ trans('general.export') }}
<div class="col-4 text-right"> @if ($notifications->total())
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2" <button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm ml-2 d-none"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="right" data-placement="right"
title="{{ trans('notifications.mark_read_all') }}" title="{{ trans('notifications.mark_read_all') }}"
wire:click="markReadAll()" wire:click="markReadAll()"
> >
<span class="btn-inner--icon"><i class="fas fa-check-double"></i></span> <span class="btn-inner--icon"><i class="fas fa-check-double"></i></span>
</button> </button>
@endif
</h3>
</div> </div>
</div> </div>
</div> </div>
<div class="table-responsive"> <div id="collapse-exports" class="collapse" aria-labelledby="heading-exports" data-parent="#exports">
<table class="table table-flush table-hover" id="tbl-export"> @if ($notifications->total())
<tbody> <div class="table-responsive">
@foreach ($notifications as $notification) <table class="table table-flush table-hover" id="tbl-export">
<tr class="row align-items-center border-top-1"> <tbody>
<td class="col-xs-8 col-sm-10 col-md-10 col-lg-11 col-xl-11 text-left text-wrap"> @foreach ($notifications as $notification)
@if (empty($notification->message)) <tr class="row align-items-center border-top-1">
{!! trans('notifications.messages.export', [ <td class="col-xs-8 col-sm-10 col-md-10 col-lg-11 col-xl-11 text-left text-wrap">
'type' => $notification->translation, @if (empty($notification->message))
'file_name' => $notification->file_name, {!! trans('notifications.messages.export', [
'url' => $notification->download_url 'type' => $notification->translation,
]) !!} 'file_name' => $notification->file_name,
@else 'url' => $notification->download_url
{!! $notification->message !!} ]) !!}
@endif @else
</td> {!! $notification->message !!}
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center"> <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" <button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="right" data-placement="right"
title="{{ trans('notifications.mark_read') }}" title="{{ trans('notifications.mark_read') }}"
wire:click="markRead('{{ $notification->notification_id }}')" wire:click="markRead('{{ $notification->notification_id }}')"
> >
<span class="btn-inner--icon"><i class="fa fa-check"></i></span> <span class="btn-inner--icon"><i class="fa fa-check"></i></span>
</button> </button>
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </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>
</div>
@endif @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
@else
<div class="col-xs-12 col-sm-12 mt-4 mb-4 text-center">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
</div> </div>
</div>
@push('body_js') @push('body_js')
<script type="text/javascript"> <script type="text/javascript">
@ -98,5 +110,3 @@
}); });
</script> </script>
@endpush @endpush
@endif

View File

@ -1,102 +1,113 @@
@if ($notifications->total()) <div class="accordion" id="imports">
<div class="card" id="imports"> <div class="card">
<div class="card-header"> <div class="card-header" id="heading-imports" data-toggle="collapse" data-target="#collapse-imports"
aria-expanded="false" aria-controls="collapse-imports">
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col-8"> <div class="col-12">
<h5 class="h3 mb-0">{{ trans('import.import') }}</h5> <h3 class="mb-0">
</div> {{ trans('import.import') }}
<div class="col-4 text-right"> @if ($notifications->total())
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2" <button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2 d-none"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="right" data-placement="right"
title="{{ trans('notifications.mark_read_all') }}" title="{{ trans('notifications.mark_read_all') }}"
wire:click="markReadAll()" wire:click="markReadAll()"
> >
<span class="btn-inner--icon"><i class="fas fa-check-double"></i></span> <span class="btn-inner--icon"><i class="fas fa-check-double"></i></span>
</button> </button>
@endif
</h3>
</div> </div>
</div> </div>
</div> </div>
<div class="table-responsive"> <div id="collapse-imports" class="collapse" aria-labelledby="heading-imports" data-parent="#imports">
<table class="table table-flush table-hover" id="tbl-import"> @if ($notifications->total())
<tbody> <div class="table-responsive">
@foreach ($notifications as $notification) <table class="table table-flush table-hover" id="tbl-import">
<tr class="row align-items-center border-top-1"> <tbody>
<td class="col-xs-8 col-sm-10 col-md-10 col-lg-11 col-xl-11 text-left text-wrap"> @foreach ($notifications as $notification)
@if (empty($notification->errors)) <tr class="row align-items-center border-top-1">
{!! trans('notifications.messages.import', [ <td class="col-xs-8 col-sm-10 col-md-10 col-lg-11 col-xl-11 text-left text-wrap">
'type' => $notification->translation, @if (empty($notification->errors))
'count' => $notification->total_rows {!! trans('notifications.messages.import', [
]) !!} 'type' => $notification->translation,
@else 'count' => $notification->total_rows
@foreach ($notification->errors as $error) ]) !!}
{!! $error !!} @else
@endforeach @foreach ($notification->errors as $error)
@endif {!! $error !!}
</td> @endforeach
@endif
</td>
<td class="col-xs-4 col-sm-2 col-md-2 col-lg-1 col-xl-1 text-center"> <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" <button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="right" data-placement="right"
title="{{ trans('notifications.mark_read') }}" title="{{ trans('notifications.mark_read') }}"
wire:click="markRead('{{ $notification->notification_id }}')" wire:click="markRead('{{ $notification->notification_id }}')"
> >
<span class="btn-inner--icon"><i class="fa fa-check"></i></span> <span class="btn-inner--icon"><i class="fa fa-check"></i></span>
</button> </button>
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </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>
</div>
@endif @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
@else
<div class="col-xs-12 col-sm-12 mt-4 mb-4 text-center">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
</div> </div>
</div>
@push('body_js') @push('body_js')
<script type="text/javascript"> <script type="text/javascript">
window.addEventListener('mark-read', event => { window.addEventListener('mark-read', event => {
if (event.detail.type == 'import') { if (event.detail.type == 'import') {
$.notify(event.detail.message, { $.notify(event.detail.message, {
type: 'success', type: 'success',
}); });
} }
}); });
window.addEventListener('mark-read-all', event => { window.addEventListener('mark-read-all', event => {
if (event.detail.type == 'import') { if (event.detail.type == 'import') {
$.notify(event.detail.message, { $.notify(event.detail.message, {
type: 'success', type: 'success',
}); });
} }
}); });
</script> </script>
@endpush @endpush
@endif

View File

@ -1,27 +1,76 @@
@if ($notifications) <div class="accordion" id="new-apps">
<div class="accordion" id="new-apps"> <div class="card">
<div class="card"> <div class="card-header" id="heading-new-apps" data-toggle="collapse" data-target="#collapse-new-apps"
<div class="card-header" id="heading-new-apps" data-toggle="collapse" data-target="#collapse-new-apps" aria-expanded="true" aria-controls="collapse-new-apps"> aria-expanded="{{ ($notifications) ? 'true' : 'false' }}" aria-controls="collapse-new-apps">
<div class="align-items-center"> <div class="align-items-center">
<h4 class="mb-0">{{ trans_choice('notifications.new_apps', 2) }}</h4> <h3 class="mb-0">
</div> {{ trans_choice('notifications.new_apps', 2) }}
</div>
<div id="collapse-new-apps" class="collapse show" aria-labelledby="heading-new-apps" data-parent="#new-apps"> @if ($notifications)
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm ml-2 d-none"
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>
@endif
</h3>
</div>
</div>
<div id="collapse-new-apps" class="collapse{{ ($notifications) ? ' show' : '' }}" aria-labelledby="heading-new-apps" data-parent="#new-apps">
@if ($notifications)
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-export"> <table class="table table-flush table-hover" id="tbl-export">
<tbody> <tbody>
@foreach ($notifications as $notification) @foreach ($notifications as $notification)
<tr class="row align-items-center border-top-1"> <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"> <td class="col-xs-8 col-sm-10 col-md-10 col-lg-11 col-xl-11 text-left text-wrap">
{!! $notification->message !!} {!! $notification->message !!}
</td> </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->alias }}')"
>
<span class="btn-inner--icon"><i class="fa fa-check"></i></span>
</button>
</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div> </div>
</div> @else
<div class="col-xs-12 col-sm-12 mt-4 mb-4 text-center">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div> </div>
</div> </div>
@endif </div>
@push('body_js')
<script type="text/javascript">
window.addEventListener('mark-read', event => {
if (event.detail.type == 'new-apps') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
window.addEventListener('mark-read-all', event => {
if (event.detail.type == 'new-apps') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
</script>
@endpush

View File

@ -1,245 +1,256 @@
@if ($notifications->count()) <div class="accordion" id="recurring-{{$type}}">
<div class="card" id="recurring-{{$type}}"> <div class="card">
<div class="card-header"> <div class="card-header" id="heading-recurring-{{$type}}" data-toggle="collapse" data-target="#collapse-recurring-{{$type}}"
aria-expanded="false" aria-controls="collapse-recurring-{{$type}}">
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col-8"> <div class="col-12">
<h5 class="h3 mb-0">{{ trans($textTitle) }}</h5> <h3 class="mb-0">
</div> {{ trans($textTitle) }}
<div class="col-4 text-right"> @if ($notifications->total())
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2" <button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2 d-none"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="right" data-placement="right"
title="{{ trans('notifications.mark_read_all') }}" title="{{ trans('notifications.mark_read_all') }}"
wire:click="markReadAll()" wire:click="markReadAll()"
> >
<span class="btn-inner--icon"><i class="fas fa-check-double"></i></span> <span class="btn-inner--icon"><i class="fas fa-check-double"></i></span>
</button> </button>
@endif
</h3>
</div> </div>
</div> </div>
</div> </div>
<div class="table-responsive"> <div id="collapse-recurring-{{$type}}" class="collapse" aria-labelledby="heading-recurring-{{$type}}" data-parent="#recurring-{{$type}}">
<table class="table table-flush table-hover" id="tbl-recurring-{{ $type }}"> @if ($notifications->total())
<thead class="thead-light"> <div class="table-responsive">
<tr class="row table-head-line"> <table class="table table-flush table-hover" id="tbl-recurring-{{ $type }}">
@stack('document_number_th_start') <thead class="thead-light">
@if (!$hideDocumentNumber) <tr class="row table-head-line">
<th class="{{ $classDocumentNumber }}"> @stack('document_number_th_start')
@stack('document_number_th_inside_start') @if (!$hideDocumentNumber)
<th class="{{ $classDocumentNumber }}">
@stack('document_number_th_inside_start')
{{ trans_choice($textDocumentNumber, 1) }} {{ trans_choice($textDocumentNumber, 1) }}
@stack('document_number_th_inside_end') @stack('document_number_th_inside_end')
</th> </th>
@endif @endif
@stack('document_number_th_end') @stack('document_number_th_end')
@stack('contact_name_th_start') @stack('contact_name_th_start')
@if (!$hideContactName) @if (!$hideContactName)
<th class="{{ $classContactName }}"> <th class="{{ $classContactName }}">
@stack('contact_name_th_inside_start') @stack('contact_name_th_inside_start')
{{ trans_choice($textContactName, 1) }} {{ trans_choice($textContactName, 1) }}
@stack('contact_name_th_inside_end') @stack('contact_name_th_inside_end')
</th> </th>
@endif @endif
@stack('contact_name_th_end') @stack('contact_name_th_end')
@stack('amount_th_start') @stack('amount_th_start')
@if (!$hideAmount) @if (!$hideAmount)
<th class="{{ $classAmount }}"> <th class="{{ $classAmount }}">
@stack('amount_th_inside_start') @stack('amount_th_inside_start')
{{ trans('general.amount') }} {{ trans('general.amount') }}
@stack('amount_th_inside_end') @stack('amount_th_inside_end')
</th> </th>
@endif @endif
@stack('amount_th_end') @stack('amount_th_end')
@stack('issued_at_th_start') @stack('issued_at_th_start')
@if (!$hideIssuedAt) @if (!$hideIssuedAt)
<th class="{{ $classIssuedAt }}"> <th class="{{ $classIssuedAt }}">
@stack('issued_at_th_inside_start') @stack('issued_at_th_inside_start')
{{ trans($textIssuedAt) }} {{ trans($textIssuedAt) }}
@stack('issued_at_th_inside_end') @stack('issued_at_th_inside_end')
</th> </th>
@endif @endif
@stack('issued_at_th_end') @stack('issued_at_th_end')
@stack('due_at_th_start') @stack('due_at_th_start')
@if (!$hideDueAt) @if (!$hideDueAt)
<th class="{{ $classDueAt }}"> <th class="{{ $classDueAt }}">
@stack('due_at_th_inside_start') @stack('due_at_th_inside_start')
{{ trans($textDueAt) }} {{ trans($textDueAt) }}
@stack('due_at_th_inside_end') @stack('due_at_th_inside_end')
</th> </th>
@endif @endif
@stack('due_at_th_end') @stack('due_at_th_end')
@stack('status_th_start') @stack('status_th_start')
@if (!$hideStatus) @if (!$hideStatus)
<th class="{{ $classStatus }}"> <th class="{{ $classStatus }}">
@stack('status_th_inside_start') @stack('status_th_inside_start')
{{ trans_choice('general.statuses', 1) }} {{ trans_choice('general.statuses', 1) }}
@stack('status_th_inside_end') @stack('status_th_inside_end')
</th> </th>
@endif @endif
@stack('status_th_end') @stack('status_th_end')
@if (!$hideActions) @if (!$hideActions)
<th class="{{ $classActions }}"> <th class="{{ $classActions }}">
<a>{{ trans_choice('notifications.reads', 1) }}</a> <a>{{ trans_choice('notifications.reads', 1) }}</a>
</th> </th>
@endif @endif
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($notifications as $item) @foreach($notifications as $item)
<tr class="row align-items-center border-top-1"> <tr class="row align-items-center border-top-1">
@stack('document_number_td_start') @stack('document_number_td_start')
@if (!$hideDocumentNumber) @if (!$hideDocumentNumber)
<td class="{{ $classDocumentNumber }}"> <td class="{{ $classDocumentNumber }}">
@stack('document_number_td_inside_start') @stack('document_number_td_inside_start')
<a href="{{ route($routeButtonShow , $item->id) }}" target="_blank">{{ $item->document_number }}</a> <a href="{{ route($routeButtonShow , $item->id) }}" target="_blank">{{ $item->document_number }}</a>
@stack('document_number_td_inside_end') @stack('document_number_td_inside_end')
</td> </td>
@endif @endif
@stack('document_number_td_end') @stack('document_number_td_end')
@stack('contact_name_td_start') @stack('contact_name_td_start')
@if (!$hideContactName) @if (!$hideContactName)
<td class="{{ $classContactName }}"> <td class="{{ $classContactName }}">
@stack('contact_name_td_inside_start') @stack('contact_name_td_inside_start')
{{ $item->contact_name }} {{ $item->contact_name }}
@stack('contact_name_td_inside_end') @stack('contact_name_td_inside_end')
</td> </td>
@endif @endif
@stack('contact_name_td_end') @stack('contact_name_td_end')
@stack('amount_td_start') @stack('amount_td_start')
@if (!$hideAmount) @if (!$hideAmount)
<td class="{{ $classAmount }}"> <td class="{{ $classAmount }}">
@stack('amount_td_inside_start') @stack('amount_td_inside_start')
@money($item->amount, $item->currency_code, true) @money($item->amount, $item->currency_code, true)
@stack('amount_td_inside_end') @stack('amount_td_inside_end')
</td> </td>
@endif @endif
@stack('amount_td_end') @stack('amount_td_end')
@stack('issued_at_td_start') @stack('issued_at_td_start')
@if (!$hideIssuedAt) @if (!$hideIssuedAt)
<td class="{{ $classIssuedAt }}"> <td class="{{ $classIssuedAt }}">
@stack('issued_at_td_inside_start') @stack('issued_at_td_inside_start')
@date($item->issued_at) @date($item->issued_at)
@stack('issued_at_td_inside_end') @stack('issued_at_td_inside_end')
</td> </td>
@endif @endif
@stack('issued_at_td_end') @stack('issued_at_td_end')
@stack('due_at_td_start') @stack('due_at_td_start')
@if (!$hideDueAt) @if (!$hideDueAt)
<td class="{{ $classDueAt }}"> <td class="{{ $classDueAt }}">
@stack('due_at_td_inside_start') @stack('due_at_td_inside_start')
@date($item->due_at) @date($item->due_at)
@stack('due_at_td_inside_end') @stack('due_at_td_inside_end')
</td> </td>
@endif @endif
@stack('due_at_td_end') @stack('due_at_td_end')
@stack('status_td_start') @stack('status_td_start')
@if (!$hideStatus) @if (!$hideStatus)
<td class="{{ $classStatus }}"> <td class="{{ $classStatus }}">
@stack('status_td_inside_start') @stack('status_td_inside_start')
<span class="badge badge-pill badge-{{ $item->status_label }}">{{ trans($textDocumentStatus . $item->status) }}</span> <span class="badge badge-pill badge-{{ $item->status_label }}">{{ trans($textDocumentStatus . $item->status) }}</span>
@stack('status_td_inside_end') @stack('status_td_inside_end')
</td> </td>
@endif @endif
@stack('status_td_end') @stack('status_td_end')
@if (!$hideActions) @if (!$hideActions)
<td class="{{ $classActions }}"> <td class="{{ $classActions }}">
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm" <button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="right" data-placement="right"
title="{{ trans('notifications.mark_read') }}" title="{{ trans('notifications.mark_read') }}"
wire:click="markRead('{{ $item->notification_id }}')" wire:click="markRead('{{ $item->notification_id }}')"
> >
<span class="btn-inner--icon"><i class="fa fa-check"></i></span> <span class="btn-inner--icon"><i class="fa fa-check"></i></span>
</button> </button>
</td> </td>
@endif @endif
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </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>
</div>
@endif @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
@else
<div class="col-xs-12 col-sm-12 mt-4 mb-4 text-center">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
</div> </div>
</div>
@push('body_js') @push('body_js')
<script type="text/javascript"> <script type="text/javascript">
window.addEventListener('mark-read', event => { window.addEventListener('mark-read', event => {
if (event.detail.type == 'recurring-{{ $type }}') { if (event.detail.type == 'recurring-{{ $type }}') {
$.notify(event.detail.message, { $.notify(event.detail.message, {
type: 'success', type: 'success',
}); });
} }
}); });
window.addEventListener('mark-read-all', event => { window.addEventListener('mark-read-all', event => {
if (event.detail.type == 'recurring-{{ $type }}') { if (event.detail.type == 'recurring-{{ $type }}') {
$.notify(event.detail.message, { $.notify(event.detail.message, {
type: 'success', type: 'success',
}); });
} }
}); });
</script> </script>
@endpush @endpush
@endif

View File

@ -1,227 +1,239 @@
@if ($notifications->count()) <div class="accordion" id="reminder-{{$type}}">
<div class="card" id="reminder-{{$type}}"> <div class="card">
<div class="card-header"> <div class="card-header" id="heading-reminder-{{$type}}" data-toggle="collapse" data-target="#collapse-reminder-{{$type}}"
aria-expanded="false" aria-controls="collapse-reminder-{{$type}}">
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col-8"> <div class="col-12">
<h5 class="h3 mb-0">{{ trans($textTitle) }}</h5> <h3 class="mb-0">
</div> {{ trans($textTitle) }}
<div class="col-4 text-right"> @if ($notifications->total())
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2" <button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm mr-2 d-none"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="right" data-placement="right"
title="{{ trans('notifications.mark_read_all') }}" title="{{ trans('notifications.mark_read_all') }}"
wire:click="markReadAll()" wire:click="markReadAll()"
> >
<span class="btn-inner--icon"><i class="fas fa-check-double"></i></span> <span class="btn-inner--icon"><i class="fas fa-check-double"></i></span>
</button> </button>
@endif
</h3>
</div> </div>
</div> </div>
</div> </div>
<div class="table-responsive"> <div id="collapse-reminder-{{$type}}" class="collapse" aria-labelledby="heading-reminder-{{$type}}" data-parent="#reminder-{{$type}}">
<table class="table table-flush table-hover" id="tbl-reminder-{{ $type }}"> @if ($notifications->total())
<thead class="thead-light"> <div class="table-responsive">
<tr class="row table-head-line"> <table class="table table-flush table-hover" id="tbl-reminder-{{ $type }}">
@stack('document_number_th_start') <thead class="thead-light">
@if (!$hideDocumentNumber) <tr class="row table-head-line">
<th class="{{ $classDocumentNumber }}"> @stack('document_number_th_start')
@stack('document_number_th_inside_start') @if (!$hideDocumentNumber)
<th class="{{ $classDocumentNumber }}">
@stack('document_number_th_inside_start')
{{ trans_choice($textDocumentNumber, 1) }} {{ trans_choice($textDocumentNumber, 1) }}
@stack('document_number_th_inside_end') @stack('document_number_th_inside_end')
</th> </th>
@endif @endif
@stack('document_number_th_end') @stack('document_number_th_end')
@stack('contact_name_th_start') @stack('contact_name_th_start')
@if (!$hideContactName) @if (!$hideContactName)
<th class="{{ $classContactName }}"> <th class="{{ $classContactName }}">
@stack('contact_name_th_inside_start') @stack('contact_name_th_inside_start')
{{ trans_choice($textContactName, 1) }} {{ trans_choice($textContactName, 1) }}
@stack('contact_name_th_inside_end') @stack('contact_name_th_inside_end')
</th> </th>
@endif @endif
@stack('contact_name_th_end') @stack('contact_name_th_end')
@stack('amount_th_start') @stack('amount_th_start')
@if (!$hideAmount) @if (!$hideAmount)
<th class="{{ $classAmount }}"> <th class="{{ $classAmount }}">
@stack('amount_th_inside_start') @stack('amount_th_inside_start')
{{ trans('general.amount') }} {{ trans('general.amount') }}
@stack('amount_th_inside_end') @stack('amount_th_inside_end')
</th> </th>
@endif @endif
@stack('amount_th_end') @stack('amount_th_end')
@stack('issued_at_th_start') @stack('issued_at_th_start')
@if (!$hideIssuedAt) @if (!$hideIssuedAt)
<th class="{{ $classIssuedAt }}"> <th class="{{ $classIssuedAt }}">
@stack('issued_at_th_inside_start') @stack('issued_at_th_inside_start')
{{ trans($textIssuedAt) }} {{ trans($textIssuedAt) }}
@stack('issued_at_th_inside_end') @stack('issued_at_th_inside_end')
</th> </th>
@endif @endif
@stack('issued_at_th_end') @stack('issued_at_th_end')
@stack('due_at_th_start') @stack('due_at_th_start')
@if (!$hideDueAt) @if (!$hideDueAt)
<th class="{{ $classDueAt }}"> <th class="{{ $classDueAt }}">
@stack('due_at_th_inside_start') @stack('due_at_th_inside_start')
{{ trans($textDueAt) }} {{ trans($textDueAt) }}
@stack('due_at_th_inside_end') @stack('due_at_th_inside_end')
</th> </th>
@endif @endif
@stack('due_at_th_end') @stack('due_at_th_end')
@stack('status_th_start') @stack('status_th_start')
@if (!$hideStatus) @if (!$hideStatus)
<th class="{{ $classStatus }}"> <th class="{{ $classStatus }}">
@stack('status_th_inside_start') @stack('status_th_inside_start')
{{ trans_choice('general.statuses', 1) }} {{ trans_choice('general.statuses', 1) }}
@stack('status_th_inside_end') @stack('status_th_inside_end')
</th> </th>
@endif @endif
@stack('status_th_end') @stack('status_th_end')
@if (!$hideActions) @if (!$hideActions)
<th class="{{ $classActions }}"> <th class="{{ $classActions }}">
<a>{{ trans_choice('notifications.reads', 1) }}</a> <a>{{ trans_choice('notifications.reads', 1) }}</a>
</th> </th>
@endif @endif
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach($notifications as $item) @foreach($notifications as $item)
<tr class="row align-items-center border-top-1"> <tr class="row align-items-center border-top-1">
@stack('document_number_td_start') @stack('document_number_td_start')
@if (!$hideDocumentNumber) @if (!$hideDocumentNumber)
<td class="{{ $classDocumentNumber }}"> <td class="{{ $classDocumentNumber }}">
@stack('document_number_td_inside_start') @stack('document_number_td_inside_start')
<a href="{{ route($routeButtonShow , $item->id) }}" target="_blank">{{ $item->document_number }}</a> <a href="{{ route($routeButtonShow , $item->id) }}" target="_blank">{{ $item->document_number }}</a>
@stack('document_number_td_inside_end') @stack('document_number_td_inside_end')
</td> </td>
@endif @endif
@stack('document_number_td_end') @stack('document_number_td_end')
@stack('contact_name_td_start') @stack('contact_name_td_start')
@if (!$hideContactName) @if (!$hideContactName)
<td class="{{ $classContactName }}"> <td class="{{ $classContactName }}">
@stack('contact_name_td_inside_start') @stack('contact_name_td_inside_start')
{{ $item->contact_name }} {{ $item->contact_name }}
@stack('contact_name_td_inside_end') @stack('contact_name_td_inside_end')
</td> </td>
@endif @endif
@stack('contact_name_td_end') @stack('contact_name_td_end')
@stack('amount_td_start') @stack('amount_td_start')
@if (!$hideAmount) @if (!$hideAmount)
<td class="{{ $classAmount }}"> <td class="{{ $classAmount }}">
@stack('amount_td_inside_start') @stack('amount_td_inside_start')
@money($item->amount, $item->currency_code, true) @money($item->amount, $item->currency_code, true)
@stack('amount_td_inside_end') @stack('amount_td_inside_end')
</td> </td>
@endif @endif
@stack('amount_td_end') @stack('amount_td_end')
@stack('issued_at_td_start') @stack('issued_at_td_start')
@if (!$hideIssuedAt) @if (!$hideIssuedAt)
<td class="{{ $classIssuedAt }}"> <td class="{{ $classIssuedAt }}">
@stack('issued_at_td_inside_start') @stack('issued_at_td_inside_start')
@date($item->issued_at) @date($item->issued_at)
@stack('issued_at_td_inside_end') @stack('issued_at_td_inside_end')
</td> </td>
@endif @endif
@stack('issued_at_td_end') @stack('issued_at_td_end')
@stack('due_at_td_start') @stack('due_at_td_start')
@if (!$hideDueAt) @if (!$hideDueAt)
<td class="{{ $classDueAt }}"> <td class="{{ $classDueAt }}">
@stack('due_at_td_inside_start') @stack('due_at_td_inside_start')
@date($item->due_at) @date($item->due_at)
@stack('due_at_td_inside_end') @stack('due_at_td_inside_end')
</td> </td>
@endif @endif
@stack('due_at_td_end') @stack('due_at_td_end')
@stack('status_td_start') @stack('status_td_start')
@if (!$hideStatus) @if (!$hideStatus)
<td class="{{ $classStatus }}"> <td class="{{ $classStatus }}">
@stack('status_td_inside_start') @stack('status_td_inside_start')
<span class="badge badge-pill badge-{{ $item->status_label }}">{{ trans($textDocumentStatus . $item->status) }}</span> <span class="badge badge-pill badge-{{ $item->status_label }}">{{ trans($textDocumentStatus . $item->status) }}</span>
@stack('status_td_inside_end') @stack('status_td_inside_end')
</td> </td>
@endif @endif
@stack('status_td_end') @stack('status_td_end')
@if (!$hideActions) @if (!$hideActions)
<td class="{{ $classActions }}"> <td class="{{ $classActions }}">
<button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm" <button type="button" class="btn btn-outline-success rounded-circle btn-icon-only btn-sm"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="right" data-placement="right"
title="{{ trans('notifications.mark_read') }}" title="{{ trans('notifications.mark_read') }}"
wire:click="markRead('{{ $item->notification_id }}')" wire:click="markRead('{{ $item->notification_id }}')"
> >
<span class="btn-inner--icon"><i class="fa fa-check"></i></span> <span class="btn-inner--icon"><i class="fa fa-check"></i></span>
</button> </button>
</td> </td>
@endif @endif
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </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>
</div>
@endif @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
@else
<div class="col-xs-12 col-sm-12 mt-4 mb-4 text-center">
<small>{{ trans('general.no_records') }}</small>
</div>
@endif
</div>
</div> </div>
</div>
@push('body_js') @push('body_js')
<script type="text/javascript"> <script type="text/javascript">
@ -242,5 +254,3 @@
}); });
</script> </script>
@endpush @endpush
@endif