Update the flash messages #739 (#742)

This commit is contained in:
Nabeel S 2020-06-04 03:11:57 -07:00 committed by GitHub
parent 3a07e34259
commit 82bae9cc74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 13 deletions

View File

@ -1,19 +1,27 @@
@if (session()->has('flash_notification.message'))
@if (session()->has('flash_notification.overlay'))
@foreach (session('flash_notification', collect())->toArray() as $message)
@if ($message['overlay'])
@include('flash::modal', [
'modalClass' => 'flash-modal',
'title' => session('flash_notification.title'),
'body' => session('flash_notification.message')
'title' => $message['title'],
'body' => $message['message']
])
@else
<div class="alert
alert-{{ session('flash_notification.level') }}
{{ session()->has('flash_notification.important') ? 'alert-important' : '' }}">
@if(session()->has('flash_notification.important'))
<button type="button" class="close" data-dismiss="alert">&times;</button>
alert-{{ $message['level'] }}
{{ $message['important'] ? 'alert-important' : '' }}"
role="alert">
@if ($message['important'])
<button type="button"
class="close"
data-dismiss="alert"
aria-hidden="true"
>&times;
</button>
@endif
{{ session('flash_notification.message') }}
{!! $message['message'] !!}
</div>
@endif
@endif
@endforeach
{{ session()->forget('flash_notification') }}

View File

@ -1,4 +1,4 @@
<div id="flash-overlay-modal" class="modal fade {{ $modalClass or '' }}">
<div id="flash-overlay-modal" class="modal fade {{ isset($modalClass) ? $modalClass : '' }}">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@ -8,11 +8,11 @@
</div>
<div class="modal-body">
<p>{{ $body }}</p>
<p>{!! $body !!}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">@lang('common.close')</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>