Code clean up + datatables (#64)

* Reformat Code

Reformat Code
- spaces + tabs

* Code cleanup

removed duplicated datatables code

* Datatables

replace spells, monsters tables with JavaScript Sortable Tables (DataTables?)
This commit is contained in:
Lee
2018-12-02 05:30:36 +00:00
committed by slawkens
parent e3bcbc4da9
commit 876b1b988a
38 changed files with 2396 additions and 2510 deletions

View File

@@ -1,56 +1,56 @@
<div class="box">
<div class="box-header">
<h3 class="box-title">Users active within last {{ config_visitors_counter_ttl }} minutes.</h3>
</div>
<div class="box-body">
<div id="visitors_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row">
<div class="col-sm-12">
<table id="visitors" class="table table-bordered table-striped dataTable" role="grid"
aria-describedby="visitors_info">
<thead>
<tr role="row">
<th class="sorting_asc" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="IP: activate to sort column descending"
style="width: 297px;">IP
</th>
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-label="Last visit: activate to sort column ascending" style="width: 361px;">Last
visit
</th>
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-label="Page: activate to sort column ascending" style="width: 322px;">Page
</th>
</tr>
</thead>
<tbody>
{% set i = 0 %}
{% for visitor in visitors %}
{% set i = i + 1 %}
<tr role="row" class="odd">
<td>{{ visitor.ip }}</td>
<td>{{ visitor.lastvisit|date("H:i:s") }}</td>
<td>
<a href="{{ visitor.page }}">{{ visitor.page|slice(0, 50) }}</a>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th>IP</th>
<th>Last visit</th>
<th>Page</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="box-header">
<h3 class="box-title">Users active within last {{ config_visitors_counter_ttl }} minutes.</h3>
</div>
<div class="box-body">
<div id="visitors_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row">
<div class="col-sm-12">
<table id="visitors" class="table table-bordered table-striped dataTable" role="grid"
aria-describedby="visitors_info">
<thead>
<tr role="row">
<th class="sorting_asc" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-sort="ascending" aria-label="IP: activate to sort column descending"
style="width: 297px;">IP
</th>
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-label="Last visit: activate to sort column ascending" style="width: 361px;">Last
visit
</th>
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
aria-label="Page: activate to sort column ascending" style="width: 322px;">Page
</th>
</tr>
</thead>
<tbody>
{% set i = 0 %}
{% for visitor in visitors %}
{% set i = i + 1 %}
<tr role="row" class="odd">
<td>{{ visitor.ip }}</td>
<td>{{ visitor.lastvisit|date("H:i:s") }}</td>
<td>
<a href="{{ visitor.page }}">{{ visitor.page|slice(0, 50) }}</a>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<th>IP</th>
<th>Last visit</th>
<th>Page</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
$('#visitors').DataTable()
})
$(function () {
$('#visitors').DataTable()
})
</script>