Skip to content

Commit d8f6bb5

Browse files
committed
Laracasts/flash got updated so are views need fixing
New modal view is not working yet as I can’t get the foundation reveal stuff to work Use to trigger a overlay flash `flash()->overlay('Modal Message', 'Modal Title’);` but we need something like ``` <script> $('#flash-overlay-modal’).foundation(‘open’); </script> ``` But I’m just getting errors
1 parent c53eb29 commit d8f6bb5

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed
Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1-
@if (session('flash_notification.message'))
2-
<div class="callout {{ Session::has('flash_notification.level') ? session('flash_notification.level') : '' }}" data-closable>
3-
{!! session('flash_notification.message') !!}
4-
<button class="close-button" aria-label="Dismiss alert" type="button" data-close>
5-
<span aria-hidden="true">&times;</span>
6-
</button>
7-
</div>
8-
@endif
1+
@foreach ((array) session('flash_notification') as $message)
2+
@if ($message['overlay'])
3+
@include('partials.flashModal', [
4+
'modalClass' => 'flash-modal',
5+
'title' => $message['title'],
6+
'body' => $message['message']
7+
])
8+
@else
9+
<div class="callout
10+
{{ Session::has('flash_notification.level') ? session('flash_notification.level') : '' }}"
11+
data-closable
12+
>
13+
{!! $message['message'] !!}
14+
<button class="close-button" aria-label="Dismiss alert" type="button" data-close>
15+
<span aria-hidden="true">&times;</span>
16+
</button>
17+
</div>
18+
@endif
19+
@endforeach
20+
21+
{{ session()->forget('flash_notification') }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- TODO: fix JS for this -->
2+
<div id="flash-overlay-modal" class="reveal" data-reveal aria-labelledby="flash-overlay-modalTitle" aria-hidden="true" role="dialog">
3+
<h2 id="flash-overlay-modalTitle">{{ $title }}</h2>
4+
5+
<p>{{ $body }}</p>
6+
7+
<a class="close-reveal-modal" aria-label="Close">Close</a>
8+
</div>

0 commit comments

Comments
 (0)