feat: add table showing existing edits
This commit is contained in:
1 parent
203bab6cf7
commit
d026cc5470
2 files changed
+34
-9
No files matched your search
@@ -3,6 +3,7 @@
|
||||
{% block admin_title %}Kopie erstellen{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{{ song }}
|
||||
<form class="form" id="form">
|
||||
<label for="titel">Titel</label>
|
||||
<input id="title" name="title" type="text" autocomplete="off" required autofocus>
|
||||
@@ -10,16 +11,35 @@
|
||||
<label for="artist">Artist</label>
|
||||
<input id="artist" name="artist" type="text" autocomplete="off">
|
||||
|
||||
<label for="file">Datei</label>
|
||||
<div class="file-upload">
|
||||
<input id="file" name="file" type="file" accept="audio/*,.mp3,.wav,.flac,.ogg,.m4a" required>
|
||||
<label for="file" class="file-button">Audiodatei wählen</label>
|
||||
<span class="file-name" id="file-name">Keine Datei ausgewählt</span>
|
||||
</div>
|
||||
|
||||
<button type="submit">Erstellen</button>
|
||||
</form>
|
||||
|
||||
<div class="table-wrap" style="margin-top: 2rem;">
|
||||
<table>
|
||||
<thead>
|
||||
<th>ID</th>
|
||||
<th>Bitrate</th>
|
||||
<th>Abtastrate</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Original</td>
|
||||
<td>{{ song.original.bitrate }}</td>
|
||||
<td>{{ song.original.sampling_rate }}</td>
|
||||
</tr>
|
||||
{% if song.edits %}
|
||||
{% for e in song.edits %}
|
||||
<tr>
|
||||
<td>{{ e.id }}</td>
|
||||
<td>{{ e.bitrate }} ({{ (e.bitrate / song.original.bitrate * 100) | round(1) }}%)</td>
|
||||
<td>{{ e.sampling_rate }} ({{ (e.sampling_rate / song.original.sampling_rate * 100) | round(1) }}%)</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const form = document.getElementById("form");
|
||||
form.addEventListener("submit", async (event) => {
|
||||
|
||||
Reference in new issue
Block a user