58 lines
2.1 KiB
PHP
58 lines
2.1 KiB
PHP
@extends('layouts.master')
|
|
|
|
@section('content')
|
|
|
|
<div class="page-header">
|
|
<h1 class="page-title">{{ __("Notifications") }}</h1>
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="{{ route('dashboard') }}">{{ __("Dashboard") }}</a></li>
|
|
<li class="breadcrumb-item active">{{ __("Notifications") }}</li>
|
|
</ol>
|
|
</div>
|
|
|
|
|
|
<div class="page-content">
|
|
<div class="panel">
|
|
<div class="panel-body">
|
|
@php
|
|
$notification_number ='';
|
|
if(Session::has('unread_notification_number')){
|
|
$notification_number = Session::get('unread_notification_number');
|
|
}
|
|
@endphp
|
|
<p class="page-search-count">
|
|
<button type="button" class="btn btn-warning" onclick="window.location.href = '{{ route('notification') }}'"><i class="icon wb-chat" aria-hidden="true"></i> <b><span id="notification_number">{{ $notification_number }}</span> {{ __("Notifications") }}</b></button>
|
|
</p>
|
|
<ul class="list-group list-group-full list-group-dividered">
|
|
@if($notifications)
|
|
@foreach($notifications as $notification)
|
|
@php
|
|
$workflow_document = App\WorkflowDocument::where('id', $notification->workflow_document_id)->first();
|
|
@endphp
|
|
<li class="list-group-item flex-column align-items-start">
|
|
@if($notification->read_at == null)
|
|
<h4><a href="{{ $notification->data['link'] }}" target="_blank">{{ $notification->data['action']}} :: {{ $workflow_document->getRegNumber() }}</a></h4>
|
|
@else
|
|
<h4><a href="{{ $notification->data['link'] }}" target="_blank">{{ $notification->data['type']}} :: {{ $workflow_document->getRegNumber() }}</a></h4>
|
|
@endif
|
|
</li>
|
|
@endforeach
|
|
@endif
|
|
</ul>
|
|
<nav>
|
|
{!! $notifications->render() !!}
|
|
</nav>
|
|
<script>
|
|
$('.bg-red-600').click(function(){
|
|
$(this).removeClass('bg-red-600');
|
|
$(this).addClass('bg-primary');
|
|
headerNotifications();
|
|
var xy = $('#notification_number').text();
|
|
$('#notification_number').text(eval(xy)-1);
|
|
});
|
|
</script>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|