New notification page..

This commit is contained in:
Cüneyt Şentürk 2021-06-19 18:16:09 +03:00
parent 856e10a2dd
commit 4687185f4a
34 changed files with 2652 additions and 43 deletions

View File

@ -91,6 +91,6 @@ abstract class Export implements FromCollection, HasLocalePreference, ShouldAuto
public function failed(\Throwable $exception): void
{
$this->user->notify(new ExportFailed($exception));
$this->user->notify(new ExportFailed($exception->getMessage()));
}
}

File diff suppressed because it is too large Load Diff

View File

@ -18,9 +18,7 @@ class Notifications extends Controller
*/
public function index()
{
$notifications = setting('notifications');
return view('common.notifications.index', compact('notifications'));
return view('common.notifications.index');
}
/**
@ -28,11 +26,19 @@ class Notifications extends Controller
*
* @return Response
*/
public function show($path, $id)
public function readAll()
{
$notification = setting('notifications.' . $path . '.' . $id);
$notifications = user()->unreadNotifications;
return view('common.notifications.show', compact('notification'));
foreach ($notifications as $notification) {
$notification->markAsRead();
}
$message = trans('messages.success.duplicated', ['type' => trans_choice('general.items', 1)]);
flash($message)->success();
return redirect()->route('dashboard');
}
/**

View File

@ -0,0 +1,87 @@
<?php
namespace App\Http\Livewire\Common\Notifications;
use Livewire\Component;
use Livewire\WithPagination;
use Illuminate\Support\Collection;
use Illuminate\Notifications\DatabaseNotification;
use Illuminate\Support\Str;
class Exports extends Component
{
use WithPagination;
protected $listeners = [
'refreshParent' => '$notifications',
];
public function markRead($notification_id)
{
$notification = DatabaseNotification::find($notification_id);
$data = $notification->getAttribute('data');
$notification->markAsRead();
$this->dispatchBrowserEvent('mark-read', [
'type' => 'export',
'message' => trans('notifications.messages.mark_read', ['type' => $data['file_name']]),
]);
}
public function markReadAll()
{
$notifications = $this->getNotifications();
foreach ($notifications as $notification) {
$notification->markAsRead();
}
$this->dispatchBrowserEvent('mark-read-all', [
'type' => 'export',
'message' => trans('notifications.messages.mark_read_all', ['type' => trans('general.export')]),
]);
}
public function render()
{
$limit = 5;
$notifications = $this->getNotifications($limit);
return view('livewire.common.notifications.exports', compact('notifications'));
}
protected function getNotifications($limit = false)
{
$query = user()->notifications()->unread()
->where('type', 'App\Notifications\Common\ExportCompleted')
->orWhere('type', 'App\Notifications\Common\ExportFailed');
if ($limit) {
$notifications = $query->paginate($limit);
} else {
$notifications = $query->get();
}
if ($notifications->items()) {
$items = [];
foreach ($notifications->items() as $key => $notification) {
$data = (object) $notification->getAttribute('data');
$data->notification_id = $notification->getAttribute('id');
$items[] = $data;
}
$notifications->setCollection(Collection::make($items));
}
return $notifications;
}
public function paginationView()
{
return 'vendor.livewire.default';
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Http\Livewire\Common\Notifications;
use Livewire\Component;
use Livewire\WithPagination;
class Imports extends Component
{
use WithPagination;
public function render()
{
$limit = 5;
$notifications = user()->notifications()->unread()
->where('type', 'App\Notifications\Common\ImportCompleted')
->orWhere('type', 'App\Notifications\Common\ImportFailed')
->paginate($limit);
return view('livewire.common.notifications.imports', compact('notifications'));
}
public function paginationView()
{
return 'vendor.livewire.default';
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Http\Livewire\Common\Notifications;
use Livewire\Component;
class NewApps extends Component
{
public function render()
{
return view('livewire.common.notifications.new-apps');
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Http\Livewire\Common\Notifications;
use App\Abstracts\Livewire\Document as Component;
use Livewire\WithPagination;
use Illuminate\Support\Collection;
class Recurring extends Component
{
use WithPagination;
public function render()
{
$limit = 5;
$documents = user()->notifications()->unread()->where('type', 'App\Notifications\Sale\Invoice')->paginate($limit);
$documents->setCollection(Collection::make([]));
return view('livewire.common.notifications.recurring', compact('documents'));
}
public function paginationView()
{
return 'vendor.livewire.default';
}
}

View File

@ -0,0 +1,78 @@
<?php
namespace App\Http\Livewire\Common\Notifications;
use App\Abstracts\Livewire\Document as Component;
use App\Models\Document\Document;
use Livewire\WithPagination;
use Illuminate\Support\Collection;
use Illuminate\Notifications\DatabaseNotification;
use Illuminate\Support\Str;
class Reminder extends Component
{
use WithPagination;
public function markRead($notification_id)
{
$notification = DatabaseNotification::find($notification_id);
$data = $notification->getAttribute('data');
$notification->markAsRead();
$this->dispatchBrowserEvent('mark-read', [
'type' => $this->type,
'message' => trans('notifications.messages.mark_read', ['type' => $data[$this->type . '_number']]),
]);
}
public function markReadAll()
{
$type = config('type.' . $this->type . '.notification.class');
$notifications = user()->notifications()->unread()
->where('type', $type)
->get();
foreach ($notifications as $notification) {
$notification->markAsRead();
}
$this->dispatchBrowserEvent('mark-read-all', [
'type' => $this->type,
'message' => trans('notifications.messages.mark_read', ['type' => trans_choice('general.' . Str::plural($this->type) , 2)]),
]);
}
public function render()
{
$limit = 10;
$type = config('type.' . $this->type . '.notification.class');
$documents = user()->notifications()->unread()
->where('type', $type)
->paginate($limit);
$items = [];
foreach ($documents->items() as $key => $document) {
$data = $document->getAttribute('data');
$item = Document::invoice()->where('id', $data['invoice_id'])->first();
$item->notification_id = $document->getAttribute('id');
$items[] = $item;
}
$documents->setCollection(Collection::make($items));
return view('livewire.common.notifications.reminder', compact('documents'));
}
public function paginationView()
{
return 'vendor.livewire.default';
}
}

View File

@ -20,7 +20,7 @@ class Header
{
$user = user();
$invoices = $bills = [];
$invoices = $bills = $exports = $imports = [];
$updates = $notifications = 0;
$company = null;
@ -42,6 +42,22 @@ class Header
$data = $unread->getAttribute('data');
switch ($unread->getAttribute('type')) {
case 'App\Notifications\Common\ExportCompleted':
$exports['completed'][$data['file_name']] = $data['download_url'];
$notifications++;
break;
case 'App\Notifications\Common\ExportFailed':
$exports['failed'][] = $data['message'];
$notifications++;
break;
case 'App\Notifications\Common\ImportCompleted':
$import_completed[$data['bill_id']] = $data['amount'];
$notifications++;
break;
case 'App\Notifications\Common\ImportFailed':
$import_failed[$data['bill_id']] = $data['amount'];
$notifications++;
break;
case 'App\Notifications\Purchase\Bill':
$bills[$data['bill_id']] = $data['amount'];
$notifications++;
@ -64,6 +80,8 @@ class Header
$view->with([
'user' => $user,
'notifications' => $notifications,
'exports' => $exports,
'imports' => $imports,
'bills' => $bills,
'invoices' => $invoices,
'company' => $company,

View File

@ -15,16 +15,19 @@ class CreateMediableForExport extends JobShouldQueue
protected $file_name;
protected $translation;
/**
* Create a new job instance.
*
* @param $user
* @param $file_name
*/
public function __construct($user, $file_name)
public function __construct($user, $file_name, $translation)
{
$this->user = $user;
$this->file_name = $file_name;
$this->translation = $translation;
$this->onQueue('jobs');
}
@ -42,7 +45,7 @@ class CreateMediableForExport extends JobShouldQueue
$download_url = route('uploads.download', ['id' => $media->id, 'company_id' => company_id()]);
$this->user->notify(new ExportCompleted($download_url));
$this->user->notify(new ExportCompleted($this->translation, $this->file_name, $download_url));
}
public function getQueuedMedia()

View File

@ -11,6 +11,10 @@ class ExportCompleted extends Notification implements ShouldQueue
{
use Queueable;
protected $translation;
protected $file_name;
protected $download_url;
/**
@ -18,8 +22,10 @@ class ExportCompleted extends Notification implements ShouldQueue
*
* @param string $download_url
*/
public function __construct($download_url)
public function __construct($translation, $file_name, $download_url)
{
$this->translation = $translation;
$this->file_name = $file_name;
$this->download_url = $download_url;
$this->onQueue('notifications');
@ -33,7 +39,7 @@ class ExportCompleted extends Notification implements ShouldQueue
*/
public function via($notifiable)
{
return ['mail'];
return ['mail', 'database'];
}
/**
@ -49,4 +55,19 @@ class ExportCompleted extends Notification implements ShouldQueue
->line(trans('notifications.export.completed.description'))
->action(trans('general.download'), $this->download_url);
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
'translation' => $this->translation,
'file_name' => $this->file_name,
'download_url' => $this->download_url,
];
}
}

View File

@ -14,18 +14,18 @@ class ExportFailed extends Notification implements ShouldQueue
/**
* The error exception.
*
* @var object
* @var string
*/
public $exception;
public $message;
/**
* Create a notification instance.
*
* @param object $exception
* @param string $message
*/
public function __construct($exception)
public function __construct($message)
{
$this->exception = $exception;
$this->message = $message;
$this->onQueue('notifications');
}
@ -38,7 +38,7 @@ class ExportFailed extends Notification implements ShouldQueue
*/
public function via($notifiable)
{
return ['mail'];
return ['mail', 'database'];
}
/**
@ -52,6 +52,19 @@ class ExportFailed extends Notification implements ShouldQueue
return (new MailMessage)
->subject(trans('notifications.export.failed.subject'))
->line(trans('notifications.export.failed.description'))
->line($this->exception->getMessage());
->line($this->message);
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
'message' => $this->message,
];
}
}

View File

@ -86,8 +86,14 @@ class PaymentReceived extends Notification
public function toArray($notifiable)
{
return [
'template_alias' => $this->template->alias,
'invoice_id' => $this->invoice->id,
'invoice_number' => $this->invoice->document_number,
'customer_name' => $this->invoice->contact_name,
'amount' => $this->invoice->amount,
'invoice_at' => $this->invoice->issued_at,
'due_at' => $this->invoice->due_at,
'status' => $this->invoice->status,
];
}

View File

@ -57,8 +57,14 @@ class Bill extends Notification
public function toArray($notifiable)
{
return [
'template_alias' => $this->template->alias,
'bill_id' => $this->bill->id,
'bill_number' => $this->bill->document_number,
'vendor_name' => $this->bill->contact_name,
'amount' => $this->bill->amount,
'billed_date' => company_date($this->bill->issued_at),
'bill_due_date' => company_date($this->bill->due_at),
'status' => $this->bill->status,
];
}
@ -68,6 +74,7 @@ class Bill extends Notification
'{bill_number}',
'{bill_total}',
'{bill_amount_due}',
'{billed_date}',
'{bill_due_date}',
'{bill_admin_link}',
'{vendor_name}',

View File

@ -77,8 +77,14 @@ class Invoice extends Notification
public function toArray($notifiable)
{
return [
'template_alias' => $this->template->alias,
'invoice_id' => $this->invoice->id,
'invoice_number' => $this->invoice->document_number,
'customer_name' => $this->invoice->contact_name,
'amount' => $this->invoice->amount,
'invoiced_date' => company_date($this->invoice->issued_at),
'invoice_due_date' => company_date($this->invoice->due_at),
'status' => $this->invoice->status,
];
}
@ -88,6 +94,7 @@ class Invoice extends Notification
'{invoice_number}',
'{invoice_total}',
'{invoice_amount_due}',
'{invoiced_date}',
'{invoice_due_date}',
'{invoice_guest_link}',
'{invoice_admin_link}',

View File

@ -31,7 +31,7 @@ class Export
}
$class->queue($file_name, $disk)->onQueue('exports')->chain([
new CreateMediableForExport(user(), $file_name),
new CreateMediableForExport(user(), $file_name, $translation),
]);
$message = trans('messages.success.export_queued', ['type' => $translation]);

File diff suppressed because one or more lines are too long

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,23 @@ 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',
'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,13 @@ 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',
'upcoming_bills' => 'Upcoming Bills',
'recurring_invoices' => 'Recurring Invoices',
'recurring_bills' => 'Recurring Bills',
'update' => [
@ -51,4 +58,9 @@ return [
],
'messages' => [
'mark_read' => ':type is read this notification!',
'mark_read_all' => ':type is read all notification!',
'export' => ':type export is ready! The export file is ready to download from the following <a href=":url" target="_blank">:file_name</a>'
],
];

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="export">
<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,105 @@
@if ($notifications->total())
<div class="card" id="export">
<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 == '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,7 @@
<div class="card">
<div class="card-header"></div>
<div class="card-body">
</div>
</div>

View File

@ -0,0 +1,213 @@
@if ($documents->count())
<div class="card">
<div class="card-header">
<div class="row align-items-center">
<div class="col-8">
<h5 class="h3 mb-0">Card title</h5>
</div>
<div class="col-4 text-right">
<a href="#!" class="btn btn-sm btn-neutral">Action</a>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-flush table-hover" id="tbl-reminder-invoices">
<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('general.actions') }}</a>
</th>
@endif
</tr>
</thead>
<tbody>
@foreach($documents 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">
<span class="btn-inner--icon"><i class="fa fa-check"></i></span>
</button>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
@if ($documents->total() > 5)
<div class="card-footer table-action">
<div class="row">
@if ($documents->count())
<div class="col-xs-12 col-sm-5 d-flex align-items-center">
{!! Form::select('limit', ['5' => '5'], request('limit', setting('default.list_limit', '25')), ['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' => $documents->firstItem(), 'last' => $documents->lastItem(), 'total' => $documents->total()]) }}
</span>
</div>
<div class="col-xs-12 col-sm-7 pagination-xs">
<nav class="float-right">
{!! $documents->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

View File

@ -0,0 +1,249 @@
@if ($documents->count())
<div class="card">
<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($documents 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 ($documents->total() > 5)
<div class="card-footer table-action">
<div class="row">
@if ($documents->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' => $documents->firstItem(), 'last' => $documents->lastItem(), 'total' => $documents->total()]) }}
</span>
</div>
<div class="col-xs-12 col-sm-7 pagination-xs">
<nav class="float-right">
{!! $documents->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 == '{{ $type }}') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
window.addEventListener('mark-read-all', event => {
if (event.detail.type == '{{ $type }}') {
$.notify(event.detail.message, {
type: 'success',
});
}
});
</script>
@endpush

View File

@ -127,11 +127,87 @@
@endif
<div class="list-group list-group-flush">
@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-bills' }}" 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 +228,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-invoices' }}" 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 +247,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>

View File

@ -40,6 +40,8 @@ Route::group(['prefix' => 'common'], function () {
Route::resource('items', 'Common\Items', ['middleware' => ['money', 'dropzone']]);
Route::post('notifications/disable', 'Common\Notifications@disable')->name('notifications.disable');
Route::get('notifications/readAll', 'Common\Notifications@readAll')->name('notifications.read-all');
Route::resource('notifications', 'Common\Notifications');
Route::post('bulk-actions/{group}/{type}', 'Common\BulkActions@action')->name('bulk-actions.action');