mirror of
https://github.com/PhoenixTwoFive/karaoqueue.git
synced 2025-05-20 03:21:47 +02:00
69 lines
2.5 KiB
HTML
69 lines
2.5 KiB
HTML
|
|
|
|
{% extends 'base.html' %}
|
|
{% block title %}Warteliste-Admin{% endblock %}
|
|
{% block content %}
|
|
<style>
|
|
table td:nth-child(2) {
|
|
max-width: 450px !important;
|
|
overflow: scroll;
|
|
}
|
|
</style>
|
|
<div class="container">
|
|
<div id="toolbar">
|
|
<button type="button" class="topbutton btn btn-danger" onclick="confirmDeleteSelectedEntries()"><i
|
|
class="fas fa-trash mr-2"></i>Gewählte Einträge löschen</button>
|
|
<button type="button" class="topbutton btn btn-danger" onclick="confirmUpdateSongDatabase()"><i
|
|
class="fas fa-file-import mr-2"></i>Song-Datenbank
|
|
aktualisieren</button>
|
|
<input id="entryToggle" type="checkbox" class="topbutton" data-toggle="toggle" data-on="Eintragen erlaubt" data-off="Eintragen deaktiviert" data-onstyle="success" data-offstyle="danger">
|
|
</div>
|
|
<a name="end"></a>
|
|
</div>
|
|
{% endblock %}
|
|
{% block extrajs %}
|
|
<script>
|
|
function confirmUpdateSongDatabase() {
|
|
bootbox.confirm({
|
|
message: "Wirklich die Song-Datenbank aktualisieren?<br>Dies lädt die Aktuelle Song-Liste von <a href='https://www.karafun.de/karaoke-song-list.html'>KaraFun</a> herunter, <b>und wird alle Eintragungen löschen!</b>",
|
|
buttons: {
|
|
confirm: {
|
|
label: 'Ja',
|
|
className: 'btn-primary'
|
|
},
|
|
cancel: {
|
|
label: 'Nein',
|
|
className: 'btn btn-secondary'
|
|
}
|
|
},
|
|
callback: function(result){
|
|
if (result) {
|
|
var dialog = bootbox.dialog({
|
|
message: '<p class="text-center mb-0"><i class="fa fa-spin fa-cog"></i> Aktualisiere Song-Datenbank...</p>',
|
|
|
|
closeButton: false
|
|
});
|
|
updateSongDatabase(dialog)
|
|
}
|
|
}
|
|
})
|
|
}
|
|
function updateSongDatabase(wait_dialog) {
|
|
$.ajax({
|
|
type: 'GET',
|
|
url: '/api/songs/update',
|
|
contentType: "application/json",
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
wait_dialog.modal('hide')
|
|
bootbox.alert({
|
|
message: data["status"],
|
|
callback: function() {
|
|
$("#entrytable").bootstrapTable('refresh')
|
|
}
|
|
})
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
{% endblock %} |