Files
ths-blowerdoor-raven/templates/index.html

95 lines
4.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
{% include 'head.html' %}
</head>
<body>
{% include 'navbar.html' %}
<div style="font-size: 16px; font-weight: 300;" class="ml-2 mr-3 mt-5 mb-3" role="main">
<form style="max-width: 800px;" class="my-3 form-border"
action="/" method="POST" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" value="Upload"/>
</form>
<hr class="my-2">
<table id="tableMain" class="table table-striped table-bordered table-sm"
cellspacing="0">
<thead>
<tr>
<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 data-sorter="datesSorter" class="th-sm font-weight-bold">Dokument Erstellungsdatum (Jahr/Monat/Tag)</th>
<th class="th-sm font-weight-bold"></th>
<th class="th-sm font-weight-bold">Sonstige Dateien</th>
</tr>
</thead>
<tbody>
{% for bd in listContent %}
{% set done = bd.docName in statusDict and statusDict[bd.docName] %}
<tr{% if done %} style="background-color: lightgreen;" {% endif %}>
<td style="line-height: 45px;"><a target="_blank" href="/get-file?basename={{ bd.docName }}">{{ bd.docName }}</a>
{% if bd.outdated %}<p style="color: red;">(neueres Dokument verfügbar: {{ bd.inDocumentDate.strftime("%d.%m.%Y") }})</p>{% endif %}
</td>
<td style="line-height: 45px;
{% if bd.location == "Fehler" %}color: red;
{% endif %}">
{{ bd.location }}</td>
{% if bd.blowerdoorDate %}
<td style="line-height: 45px;">{{ bd.blowerdoorDate }}</td>
{% else %}
<td style="line-height: 45px;">0000 - Keine Informationen Gefunden</td>
{% endif %}
<td style="line-height: 45px;
{% if bd.location == "Fehler" %}color: red;
{% endif %}">
{{ bd.customer }}</td>
<td style="line-height: 45px;">{{ bd.pdfDate.strftime("%Y/%m/%d") }}</td>
<td style="line-height: 45px;">
<form onsubmit="return confirm('Wirklich unwideruflich löschen?')"
action="/get-file" method="DELETE">
<button name="delete" value="{{ bd.docName }}">Löschen</button>
</form>
{% if done %}
<form onsubmit="return confirm('Wirklich als NICHT erledigt markieren?')"
action="/document-status" method="POST">
<button name="documentName" value="{{ bd.docName }}">Nicht Erledigt</button>
</form>
{% else %}
<form onsubmit="return confirm('Wirklich als erledigt markieren?')"
action="/document-status" method="POST">
<button name="documentName" value="{{ bd.docName }}">Erledigt</button>
</form>
{% endif %}
<button onclick="addAssotiatedFile()">
Zugehörige Datei hinzufügen
</button>
</td>
<td style="line-height: 45px;">
energieberechnung.pdf<br>
andereszeug.pdf<br>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<script defer>
$(document).ready(function () {
$('#tableMain').DataTable({
"order" : [[ 3, "desc" ]],
"paging": false,
});
$('.dataTables_length').addClass('bs-select');
});
$('#tableMain').on('click', 'tbody td', function() {
console.log('TD cell textContent : ', this.textContent)
console.log('location : ', this.parentNode.rowIndex, this.cellIndex)
})
</script>
</div>
</body>
</html>