1- @php
2- $pull = function (string $key ) {
3- return session ()-> has ($key ) ? session ()-> get ($key ) : null ;
4- };
5- @endphp
6-
71@if ($errors -> any () )
8- <x-alert
9- type =" danger"
10- :heading =" trans('general.notification_error')"
11- id =" validation-errors"
12- >
13- {{ trans (' general.notification_error_hint' ) } }
14- </x-alert >
2+ <div class =" col-md-12" id =" error-notification" >
3+ <div class =" alert alert-danger fade in" >
4+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
5+ <i class =" fas fa-exclamation-triangle faa-pulse animated" ></i >
6+ <strong >{{ trans (' general.notification_error' ) } } :</strong >
7+ {{ trans (' general.notification_error_hint' ) } }
8+ </div >
9+ </div >
10+
1511@endif
1612
17- @if ($msg = $pull (' status' ) )
18- <x-alert type =" success" :heading =" trans('general.notification_success')" id =" status-notification" >
19- {{ $msg } }
20- </x-alert >
13+
14+ @if ($message = session ()-> get (' status' ) )
15+ <div class =" col-md-12" id =" success-notification" >
16+ <div class =" alert alert-success fade in" >
17+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
18+ <i class =" fas fa-check faa-pulse animated" ></i >
19+ <strong >{{ trans (' general.notification_success' ) } } : </strong >
20+ {{ $message } }
21+ </div >
22+ </div >
2123@endif
2224
23- @if ($msg = $pull (' success' ) )
24- <x-alert type =" success" :heading =" trans('general.notification_success')" id =" success-notification" confetti =" true" >
25- {{ $msg } }
26- </x-alert >
25+
26+ @if ($message = session ()-> get (' success' ) )
27+ <div class =" col-md-12" id =" success-notification" >
28+ <div class =" alert alert-success fade in" >
29+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
30+ <i class =" fas fa-check faa-pulse animated" ></i >
31+ <strong >{{ trans (' general.notification_success' ) } } : </strong >
32+ {{ $message } }
33+ </div >
34+ </div >
35+ @include (' partials.confetti-js' )
2736@endif
2837
29- @if ($msg = $pull (' success-unescaped' ) )
30- <x-alert type =" success" :heading =" trans('general.notification_success')" id =" success-unescaped-notification" html =" true" confetti =" true" >
31- {!! $msg ! !}
32- </x-alert >
38+
39+ @if ($message = session ()-> get (' success-unescaped' ) )
40+ <div class =" col-md-12" id =" success-notification" >
41+ <div class =" alert alert-success fade in" >
42+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
43+ <i class =" fas fa-check faa-pulse animated" ></i >
44+ <strong >{{ trans (' general.notification_success' ) } } : </strong >
45+ {!! $message ! !}
46+ </div >
47+ </div >
48+ @include (' partials.confetti-js' )
3349@endif
3450
35- @if ($assets = $pull (' assets' ) )
51+
52+ @if ($assets = session ()-> get (' assets' ) )
3653 @foreach ($assets as $asset )
37- <x-alert type =" info" :heading =" trans('general.asset_information')" html =" true" :id =" 'asset-info-'.$loop->index" >
38- <ul style =" margin :0 ;padding-left :18px ;" >
39- @isset ($asset -> model -> name )
40- <li ><strong >{{ trans (' general.model_name' ) } } </strong > {{ $asset -> model -> name } } </li >
41- @endisset
42- @isset ($asset -> name )
43- <li ><strong >{{ trans (' general.asset_name' ) } } </strong > {{ $asset -> name } } </li >
44- @endisset
45- <li ><strong >{{ trans (' general.asset_tag' ) } } </strong > {{ $asset -> asset_tag } } </li >
46- @isset ($asset -> notes )
47- <li ><strong >{{ trans (' general.notes' ) } } </strong > {{ $asset -> notes } } </li >
48- @endisset
49- </ul >
50- </x-alert >
54+ <div class =" col-md-12" id =" multi-error-notification" >
55+ <div class =" alert alert-info fade in" >
56+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
57+ <i class =" fas fa-info-circle faa-pulse animated" ></i >
58+ <strong >{{ trans (' general.asset_information' ) } } :</strong >
59+ <ul >
60+ @isset ($asset -> model -> name )
61+ <li ><b >{{ trans (' general.model_name' ) } } </b > {{ $asset -> model -> name } } </li >
62+ @endisset
63+ @isset ($asset -> name )
64+ <li ><b >{{ trans (' general.asset_name' ) } } </b > {{ $asset -> model -> name } } </li >
65+ @endisset
66+ <li ><b >{{ trans (' general.asset_tag' ) } } </b > {{ $asset -> asset_tag } } </li >
67+ @isset ($asset -> notes )
68+ <li ><b >{{ trans (' general.notes' ) } } </b > {{ $asset -> notes } } </li >
69+ @endisset
70+ </ul >
71+
72+ </div >
73+ </div >
5174 @endforeach
5275@endif
5376
54- @if ($consumables = $pull (' consumables' ) )
77+
78+ @if ($consumables = session ()-> get (' consumables' ) )
5579 @foreach ($consumables as $consumable )
56- <x-alert type =" info" :heading =" trans('general.consumable_information')" html =" true" :id =" 'consumable-info-'.$loop->index" >
57- <ul style =" margin :0 ;padding-left :18px ;" >
58- <li ><strong >{{ trans (' general.consumable_name' ) } } </strong > {{ $consumable -> name } } </li >
59- </ul >
60- </x-alert >
80+ <div class =" col-md-12" id =" success-notification" >
81+ <div class =" alert alert-info fade in" >
82+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
83+ <i class =" fas fa-info-circle faa-pulse animated" ></i >
84+ <strong >{{ trans (' general.consumable_information' ) } } : </strong >
85+ <ul ><li ><b >{{ trans (' general.consumable_name' ) } } </b > {{ $consumable -> name } } </li ></ul >
86+ </div >
87+ </div >
6188 @endforeach
6289@endif
6390
64- @if ($accessories = $pull (' accessories' ) )
91+
92+ @if ($accessories = session ()-> get (' accessories' ) )
6593 @foreach ($accessories as $accessory )
66- <x-alert type =" info" :heading =" trans('general.accessory_information')" html =" true" :id =" 'accessory-info-'.$loop->index" >
67- <ul style =" margin :0 ;padding-left :18px ;" >
68- <li ><strong >{{ trans (' general.accessory_name' ) } } </strong > {{ $accessory -> name } } </li >
69- </ul >
70- </x-alert >
94+ <div class =" col-md-12" >
95+ <div class =" alert alert-info fade in" >
96+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
97+ <i class =" fas fa-info-circle faa-pulse animated" ></i >
98+ <strong >{{ trans (' general.accessory_information' ) } } :</strong >
99+ <ul ><li ><b >{{ trans (' general.accessory_name' ) } } </b > {{ $accessory -> name } } </li ></ul >
100+ </div >
101+ </div >
71102 @endforeach
72103@endif
73104
74- @if ($msg = $pull (' error' ) )
75- <x-alert type =" danger" :heading =" trans('general.error')" id =" error-notification" >
76- {{ $msg } }
77- </x-alert >
105+
106+ @if ($message = session ()-> get (' error' ) )
107+ <div class =" col-md-12" >
108+ <div class =" alert alert alert-danger fade in" >
109+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
110+ <i class =" fas fa-exclamation-triangle faa-pulse animated" ></i >
111+ <strong >{{ trans (' general.error' ) } } : </strong >
112+ {{ $message } }
113+ </div >
114+ </div >
78115@endif
79116
80- @if ($messages = $pull (' error_messages' ) )
81- @foreach ($messages as $message )
82- <x-alert type =" danger" :heading =" trans('general.notification_error')" :id =" 'error-msg-'.$loop->index" >
83- {{ $message } }
84- </x-alert >
85- @endforeach
117+
118+ @if ($messages = session ()-> get (' error_messages' ) )
119+ @foreach ($messages as $message )
120+ <div class =" col-md-12" >
121+ <div class =" alert alert alert-danger fade in" >
122+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
123+ <i class =" fas fa-exclamation-triangle faa-pulse animated" ></i >
124+ <strong >{{ trans (' general.notification_error' ) } } : </strong >
125+ {{ $message } }
126+ </div >
127+ </div >
128+ @endforeach
86129@endif
87130
88- @if ($bulk = $pull (' bulk_asset_errors' ) )
89- <x-alert type =" danger" :heading =" trans('general.notification_error')" html =" true" id =" bulk-asset-errors" >
90- {{ trans (' general.notification_bulk_error_hint' ) } }
91- @foreach ($bulk as $key => $set )
92- @foreach ($set as $entry )
93- <ul style =" margin :0 ;padding-left :18px ;" >
94- <li >{{ $entry } } </li >
131+
132+ @if ($messages = session ()-> get (' bulk_asset_errors' ) )
133+ <div class =" col-md-12" >
134+ <div class =" alert alert alert-danger fade in" >
135+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
136+ <i class =" fas fa-exclamation-triangle faa-pulse animated" ></i >
137+ <strong >{{ trans (' general.notification_error' ) } } : </strong >
138+ {{ trans (' general.notification_bulk_error_hint' ) } }
139+ @foreach ($messages as $key => $message )
140+ @for ($x = 0 ; $x < count ($message ); $x ++ )
141+ <ul >
142+ <li >{{ $message [$x ] } } </li >
95143 </ul >
144+ @endfor
96145 @endforeach
97- @endforeach
98- </ x-alert >
146+ </ div >
147+ </ div >
99148@endif
100149
101150@if ($messages = session ()-> get (' multi_error_messages' ) )
102151 <div class =" col-md-12" >
103- <div class =" alert alert-warning fade in" >
152+ <div class =" alert alert alert -warning fade in" >
104153 <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
105154 <i class =" fas fa-exclamation-triangle faa-pulse animated" ></i >
106155 <strong >{{ trans (' general.notification_error' ) } } : </strong >
107156 <ul >
108- @foreach (array_splice ($messages , 0 , 3 ) as $message )
157+ @foreach (array_splice ($messages , 0 ,3 ) as $key => $message )
109158 <li >{{ $message } } </li >
110159 @endforeach
111160 </ul >
112- @if (count ($messages ) > 0 )
113- <details >
114- <summary >{{ trans (' general.show_all' ) } } </summary >
115- <ul >
116- @foreach ($messages as $message )
117- <li >{{ $message } } </li >
118- @endforeach
119- </ul >
120- </details >
121- @endif
161+ <details >
162+ <summary >{{ trans (' general.show_all' ) } } </summary >
163+ <ul >
164+ @foreach (array_splice ($messages , 3 ) as $key => $message )
165+ <li >{{ $message } } </li >
166+ @endforeach
167+ </ul >
168+ </details >
122169 </div >
123170 </div >
124171@endif
125172
126- @if ($msg = $pull (' warning' ) )
127- <x-alert type =" warning" :heading =" trans('general.notification_warning')" id =" warning-notification" >
128- {{ $msg } }
129- </x-alert >
130- @endif
131173
132- @if ($msg = $pull (' info' ) )
133- <x-alert type =" info" :heading =" trans('general.notification_info')" id =" info-notification" >
134- {{ $msg } }
135- </x-alert >
174+ @if ($message = session ()-> get (' warning' ) )
175+ <div class =" col-md-12" >
176+ <div class =" alert alert-warning fade in" >
177+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
178+ <i class =" fas fa-exclamation-triangle faa-pulse animated" ></i >
179+ <strong >{{ trans (' general.notification_warning' ) } } : </strong >
180+ {{ $message } }
181+ </div >
182+ </div >
136183@endif
184+
185+
186+ @if ($message = session ()-> get (' info' ) )
187+ <div class =" col-md-12" >
188+ <div class =" alert alert-info fade in" >
189+ <button type =" button" class =" close" data-dismiss =" alert" >× ; </button >
190+ <i class =" fas fa-info-circle faa-pulse animated" ></i >
191+ <strong >{{ trans (' general.notification_info' ) } } : </strong >
192+ {{ $message } }
193+ </div >
194+ </div >
195+ @endif
0 commit comments