Move Admin Logs and Reports into Twig

This commit is contained in:
tobi132
2019-12-09 19:57:42 +01:00
parent 8115cc5ecc
commit 711027e450
5 changed files with 183 additions and 157 deletions

View File

@@ -0,0 +1,41 @@
<div class="box">
<div class="box-header">
<h3 class="box-title">Logs:</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-sm-12">
<table id="tb_logs">
<thead>
<tr>
<th>Log name</th>
<th>Last updated</th>
</tr>
</thead>
<tbody>
{% for file in files %}
<tr>
<td>
<a href="{{ constant('ADMIN_URL') }}?p=logs&file={{ file.name }}">{{ file.name }}</a>
</td>
<td>{{ file.mtime|date('Y-m-d H:i:s') }}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th>Log name</th>
<th>Last updated</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<script>
$(function () {
$('#tb_logs').DataTable()
})
</script>

View File

@@ -0,0 +1,8 @@
<div class="box">
<div class="box-header">
<h3 class="box-title"><b>{{ file }}</b></h3>
</div>
<div class="box-body">
{{ content|raw }}
</div>
</div>

View File

@@ -0,0 +1,41 @@
<div class="box">
<div class="box-header">
<h3 class="box-title">Reports:</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-sm-12">
<table id="tb_reports">
<thead>
<tr>
<th>Report name</th>
<th>Last updated</th>
</tr>
</thead>
<tbody>
{% for file in files %}
<tr>
<td>
<a href="{{ constant('ADMIN_URL') }}?p=reports&file={{ file.name }}">{{ file.name }}</a>
</td>
<td>{{ file.mtime|date('Y-m-d H:i:s') }}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th>Report name</th>
<th>Last updated</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#tb_reports').DataTable();
});
</script>