64 lines
2.8 KiB
PHP
64 lines
2.8 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', __('assetexchange::lang.notifications'))
|
|
|
|
@section('content')
|
|
@include('assetexchange::layouts.nav')
|
|
|
|
<section class="content mt-page">
|
|
<div class="mt-page-header">
|
|
<h1><i class="fa fa-bell"></i> @lang('assetexchange::lang.notifications')</h1>
|
|
<div>
|
|
<a href="{{ action([\Modules\AssetExchange\Http\Controllers\NotificationController::class, 'index'], ['unread' => 1]) }}" class="btn btn-default">
|
|
@lang('assetexchange::lang.show_unread') ({{ $unread_count }})
|
|
</a>
|
|
<form method="POST" action="{{ action([\Modules\AssetExchange\Http\Controllers\NotificationController::class, 'markAllRead']) }}" style="display:inline;">
|
|
@csrf
|
|
<button class="btn btn-success">@lang('assetexchange::lang.mark_all_read')</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="mt-card">
|
|
<div class="mt-card-body table-responsive">
|
|
<table class="table table-bordered table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>@lang('assetexchange::lang.status')</th>
|
|
<th>@lang('assetexchange::lang.title')</th>
|
|
<th>@lang('assetexchange::lang.message')</th>
|
|
<th>@lang('assetexchange::lang.created_at')</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($notifications as $n)
|
|
<tr class="{{ $n->read_at ? '' : 'bg-warning' }}">
|
|
<td>
|
|
@if($n->read_at)
|
|
<span class="label label-success">@lang('assetexchange::lang.read')</span>
|
|
@else
|
|
<span class="label label-warning">@lang('assetexchange::lang.unread')</span>
|
|
@endif
|
|
</td>
|
|
<td>{{ $n->title }}</td>
|
|
<td>{{ $n->message }}</td>
|
|
<td>{{ $aexUtil->formatDateTime($n->created_at) }}</td>
|
|
<td>
|
|
<form method="POST" action="{{ action([\Modules\AssetExchange\Http\Controllers\NotificationController::class, 'markRead'], [$n->id]) }}">
|
|
@csrf
|
|
<button class="btn btn-xs btn-primary">@lang('assetexchange::lang.open')</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr><td colspan="5" class="text-center text-muted">@lang('assetexchange::lang.no_records')</td></tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
{{ $notifications->links() }}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
@endsection
|
|
|