small improvements

This commit is contained in:
Yannik Schmidt
2021-09-08 12:05:14 +02:00
parent bc7ba49de8
commit 468034c801
3 changed files with 16 additions and 5 deletions

View File

@@ -17,6 +17,15 @@
<!-- mdb -->
<link href="/static/css/mdb.min.css" rel="stylesheet">
<script defer src="/static/js/mdb.min.js"></script>
<script defer src="/static/js/addons/datatables.min.js"></script>
<!-- Custom JS/CSS -->
<link href="/static/site.css" rel="stylesheet">
<script>
function datesSorter(a, b) {
if (new Date(a) < new Date(b)) return 1;
if (new Date(a) > new Date(b)) return -1;
return 0;
}
</script>

View File

@@ -11,11 +11,11 @@
cellspacing="0">
<thead>
<tr>
<th class="th-sm font-weight-bold">Dokument</th>
<th class="th-sm sorting font-weight-bold">Dokument</th>
<th class="th-sm font-weight-bold">Ort</th>
<th class="th-sm font-weight-bold">Blowerdoor KW</th>
<th class="th-sm font-weight-bold">Bauherr</th>
<th class="th-sm font-weight-bold">Dokument Erstellungsdatum</th>
<th data-sorter="datesSorter" class="th-sm font-weight-bold">Dokument Erstellungsdatum (Jahr/Monat/Tag)</th>
</tr>
</thead>
<tbody>
@@ -25,7 +25,7 @@
<td style="line-height: 45px;">{{ bd.location }}</td>
<td style="line-height: 45px;">{{ bd.blowerdoorDate }}</td>
<td style="line-height: 45px;">{{ bd.customer }}</td>
<td style="line-height: 45px;">{{ bd.pdfDate.strftime("%d.%m.%Y") }}</td>
<td style="line-height: 45px;">{{ bd.pdfDate.strftime("%Y/%m/%d") }}</td>
</tr>
{% endfor %}
</tbody>
@@ -33,7 +33,9 @@
<script defer>
$(document).ready(function () {
$('#tableMain').DataTable();
$('#tableMain').DataTable({
"order" : [[ 3, "desc" ]]
});
$('.dataTables_length').addClass('bs-select');
});
</script>