Files
maacom/templs/trusted-list.html.ep
ziggi dd17acb51f
2017-12-11 18:48:58 +00:00

75 lines
1.5 KiB
Plaintext

%#
%# $Id$
%#
% layout 'default';
% title 'Maacom';
% use Mojo::Util qw(dumper);
% my $u = $c->app->user;
<h5 class="text-center">
Hosts <a href="/trusted/list"><i class="fi-refresh"></i></a>
<a class="float-right button tiny" href="/trusted/add/form">
<i class="fi-plus"></i>
</a>
</h5>
% my $list = $u->trusted_list;
% unless ($list) {
<div class="callout alert">
Cannot list hosts. May be wrong database?
</div>
% }
<table class="hover" id="table">
<thead>
<tr>
<th>#</th>
<th>host</th>
<th><i class="fi-pencil"></i></th>
<th><i class="fi-trash"></i></th>
</tr>
</thead>
<tbody>
% my $n = 0;
% if ($list) {
% foreach my $row (@$list) {
% $n += 1;
% my $id = $row->{id};
% my $name = $row->{name};
% my $size = $row->{size};
<tr>
<td><%= $n %></td>
<td><%= $name %></td>
<td><a href="/trusted/update/form?trusted_id=<%= $id %>"><i class="fi-pencil"></i></a></td>
<td><a href="/trusted/delete/form?trusted_id=<%= $id %>"><i class="fi-trash"></i></a></td>
</tr>
% }
% }
</tbody>
</table>
<script>
$.extend(true, $.fn.dataTable.defaults, {
"searching": true,
"ordering": true,
"language": {
"search": "",
"lengthMenu": "_MENU_",
"info": "_START_-_END_ of _TOTAL_",
"infoEmpty": "",
},
} );
$(document).ready(function() {
$('#table').DataTable();
});
</script>
%# EOF