Skip to content

Commit 0ea6cd9

Browse files
author
Яценко Андрей
committed
Add: empty list
1 parent 08eae51 commit 0ea6cd9

File tree

2 files changed

+83
-67
lines changed

2 files changed

+83
-67
lines changed

src/views/dashboard.blade.php

+56-47
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,63 @@
11
@extends('local-mailer::_template')
22

33
@section('content')
4-
5-
<table class="table mt-4">
6-
<thead class="table-light">
7-
<tr>
8-
<td>Logs</td>
9-
<td class="text-center">Count</td>
10-
<td></td>
11-
</tr>
12-
</thead>
13-
<tbody>
14-
@foreach ($files as $file)
4+
@if (count($files) > 0)
5+
<table class="table mt-4">
6+
<thead class="table-light">
157
<tr>
16-
<td>
17-
<a href="{{ route('local-mailer::show-by-date',$file['date']) }}">
18-
{{ $file['file'] }}
19-
</a>
20-
</td>
21-
<td class="text-center">
22-
<a href="{{ route('local-mailer::show-by-date',$file['date']) }}">
23-
{{ $file['count'] }}
24-
</a>
25-
</td>
26-
<td class="text-right">
27-
<a class="btn-success mr-2" href="{{ route('local-mailer::download-log',$file['date']) }}"
28-
target="_blank">
29-
<svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2"
30-
fill="none" stroke-linecap="round" stroke-linejoin="round"
31-
class="css-i6dzq1">
32-
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
33-
<polyline points="7 10 12 15 17 10"></polyline>
34-
<line x1="12" y1="15" x2="12" y2="3"></line>
35-
</svg>
36-
</a>
37-
<a class="btn-danger" href="{{ route('local-mailer::delete-log',$file['date']) }}">
38-
<svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2"
39-
fill="none" stroke-linecap="round" stroke-linejoin="round">
40-
<polyline points="3 6 5 6 21 6"></polyline>
41-
<path
42-
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
43-
<line x1="10" y1="11" x2="10" y2="17"></line>
44-
<line x1="14" y1="11" x2="14" y2="17"></line>
45-
</svg>
46-
</a>
47-
</td>
8+
<td>Logs</td>
9+
<td class="text-center">Count</td>
10+
<td></td>
4811
</tr>
49-
@endforeach
50-
</tbody>
51-
</table>
52-
12+
</thead>
13+
<tbody>
14+
@foreach ($files as $file)
15+
<tr>
16+
<td>
17+
<a href="{{ route('local-mailer::show-by-date',$file['date']) }}">
18+
{{ $file['file'] }}
19+
</a>
20+
</td>
21+
<td class="text-center">
22+
<a href="{{ route('local-mailer::show-by-date',$file['date']) }}">
23+
{{ $file['count'] }}
24+
</a>
25+
</td>
26+
<td class="text-right">
27+
<a class="btn-success mr-2" href="{{ route('local-mailer::download-log',$file['date']) }}"
28+
target="_blank">
29+
<svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2"
30+
fill="none" stroke-linecap="round" stroke-linejoin="round"
31+
class="css-i6dzq1">
32+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
33+
<polyline points="7 10 12 15 17 10"></polyline>
34+
<line x1="12" y1="15" x2="12" y2="3"></line>
35+
</svg>
36+
</a>
37+
<a class="btn-danger" href="{{ route('local-mailer::delete-log',$file['date']) }}">
38+
<svg viewBox="0 0 24 24" width="16" height="16" stroke="currentColor" stroke-width="2"
39+
fill="none" stroke-linecap="round" stroke-linejoin="round">
40+
<polyline points="3 6 5 6 21 6"></polyline>
41+
<path
42+
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
43+
<line x1="10" y1="11" x2="10" y2="17"></line>
44+
<line x1="14" y1="11" x2="14" y2="17"></line>
45+
</svg>
46+
</a>
47+
</td>
48+
</tr>
49+
@endforeach
50+
</tbody>
51+
</table>
52+
@else
53+
<div class="mailbox">
54+
<div class="mailbox-head">
55+
<h2 class="mailbox-head_title">Mail logs</h2>
56+
</div>
57+
<div class="box-center">
58+
<h2>List empty</h2>
59+
</div>
60+
</div>
61+
@endif
5362

5463
@endsection

src/views/mails.blade.php

+27-20
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
@section('content')
44
<a href="{{ route('local-mailer::dashboard') }}" class="back-link">
5-
<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
5+
<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none"
6+
stroke-linecap="round" stroke-linejoin="round">
67
<line x1="19" y1="12" x2="5" y2="12"></line>
78
<polyline points="12 19 5 12 12 5"></polyline>
89
</svg>
@@ -13,30 +14,36 @@
1314
<div class="mailbox-head">
1415
<h2 class="mailbox-head_title">Mail for {{$date}}</h2>
1516
</div>
16-
<div class="mailbox-body">
17-
<div class="mail-list">
18-
@foreach ($mails as $mail)
19-
<div class="mail-preview" data-mail-frame="{{$mail->body}}"
20-
data-mail-recipient="{{json_encode($mail->to)}}">
21-
<div class="mail-preview_subject">
22-
{{$mail->subject}}
17+
@if (count($mails) > 0)
18+
<div class="mailbox-body">
19+
<div class="mail-list">
20+
@foreach ($mails as $mail)
21+
<div class="mail-preview" data-mail-frame="{{$mail->body}}"
22+
data-mail-recipient="{{json_encode($mail->to)}}">
23+
<div class="mail-preview_subject">
24+
{{$mail->subject}}
25+
</div>
26+
<div class="mail-preview_date">
27+
{{date_format(date_create($mail->date), 'H:i:s')}}
28+
</div>
2329
</div>
24-
<div class="mail-preview_date">
25-
{{date_format(date_create($mail->date), 'H:i:s')}}
30+
@endforeach
31+
</div>
32+
<div class="mail-content">
33+
<div class="mail-recipient">
34+
Recipient
35+
<div class="mail-recipient_list" id="mailRecipient">
2636
</div>
2737
</div>
28-
@endforeach
29-
</div>
30-
<div class="mail-content">
31-
<div class="mail-recipient">
32-
Recipient
33-
<div class="mail-recipient_list" id="mailRecipient">
34-
</div>
38+
<iframe class="mail-frame" id="mailFrame">
39+
</iframe>
3540
</div>
36-
<iframe class="mail-frame" id="mailFrame">
37-
</iframe>
3841
</div>
39-
</div>
42+
@else
43+
<div class="box-center">
44+
<h2>List empty</h2>
45+
</div>
46+
@endif
4047
</div>
4148
</div>
4249
<script>

0 commit comments

Comments
 (0)