-
Notifications
You must be signed in to change notification settings - Fork 149
/
broadcast.tt
96 lines (89 loc) · 3.73 KB
/
broadcast.tt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
[% PROCESS _header.tt %]
[% PROCESS _message.tt %]
[% PROCESS _infobox.tt %]
<h1 class="mt-5">Broadcasts</h1>
<div class="card w-full min-w-[420px] mt-2">
<div class="head justify-between">
<div>
[% PROCESS _table_search_field.tt ids=["statusTable"] %]
</div>
<div class="flex justify-end">
<a href="broadcast.cgi?action=edit&id=new" class="button green">Create broadcast</a>
</div>
</div>
<div class="mainTable [% IF main_table_full %]fullsize[% END %] border-t-0">
<table class="mainTable striped" id="statusTable">
<thead>
<tr>
<th>Name</th>
<th>Author</th>
<th class="text-center">Hide Before</th>
<th class="text-center">Expires After</th>
<th class="text-center">Public</th>
<th>Contacts</th>
<th>Contactgroups</th>
<th class="text-center">Actions</th>
</tr>
</thead>
<tbody>
[% IF all_broadcasts.size == 0 %]
<tr>
<td colspan="8" class="textALERT text-center">No broadcasts defined</td>
</tr>
[% ELSE %]
[% FOREACH b = all_broadcasts %]
<tr>
<td>
<a href="broadcast.cgi?id=[% b.basefile | uri %]&action=edit">
[% IF b.name %]
[% b.name | html %]
[% ELSE %]
[% b.raw_text.split('<br>').0.substr(0, 100) | html %]
[% END %]
[% IF b.template %]<span class="textALERT">(TEMPLATE)</span>[% END %]
</a>
</td>
<td>[% b.author %]</td>
<td class="text-center">[% IF b.hide_before_ts > 0; date_format(c, b.hide_before_ts); END %]</td>
<td class="text-center">[% IF b.expires_ts > 0; date_format(c, b.expires_ts); END %]</td>
<td class="text-center">[% IF b.loginpage %]Yes[% END %]</td>
<td class="max-w-sm truncate">[% b.contacts.join(', ') | html %]</td>
<td class="max-w-sm truncate">[% b.contactgroups.join(', ') | html %]</td>
<td>
<div class="flex gap-1 justify-center">
<a href="broadcast.cgi?id=[% b.basefile | uri %]&action=clone">
<i class="fa-solid fa-copy small" title='Clone Broadcast'></i>
</a>
<a href="broadcast.cgi?id=[% b.basefile | uri %]&action=edit">
<i class="fa-solid fa-pencil small" title='Edit Broadcast'></i>
</a>
<form action="broadcast.cgi" method="POST">
<input type="hidden" name="id" value="[% b.basefile | html %]">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="CSRFtoken" value="[% get_user_token(c) %]">
<button type="submit" onclick="return confirm('Do you really want to delete this broadcast?')" title="Delete broadcast" class="iconOnly">
<i class="fa-solid fa-trash small"></i>
</button>
</form>
</div>
</td>
</tr>
[% END %]
[% END %]
</tbody>
</table>
</div>
<div class="mainTableFooter">
<div class="flex-1 self-center">
[% PROCESS _pager_total_items.tt pager = { total_items => all_broadcasts.size } data=all_broadcasts %]
</div>
</div>
</div>
<script>
<!--
jQuery(document).ready(function() {
table_search("table_search_input", ["statusTable"], 1);
});
-->
</script>
[% PROCESS _footer.tt %]