diff --git a/main.go b/main.go index c6b9e5b..3b70b32 100644 --- a/main.go +++ b/main.go @@ -47,6 +47,7 @@ func init() { "./templates/modals/add_player.html", "./templates/modals/delete_player.html", "./templates/modals/edit_player.html", + "./templates/modals/single_calc.html", //"./templates/modals/settings.html", "./templates/modals/full_calc.html", "./templates/components/header.html", diff --git a/static/dialogs.js b/static/dialogs.js index 057cb94..4863500 100644 --- a/static/dialogs.js +++ b/static/dialogs.js @@ -9,45 +9,6 @@ const swalClasses = { htmlContainer: 'fs-5 text-center text-secondary-emphasis', }; -function showSingleCalcDialog(btn) { - Swal.fire({ - title: 'Einzel-Abfrage', - input: 'text', - inputLabel: 'Welcher Spieler soll abgefragt werden?\nDie Abfrage kann ein paar Sekunden dauern.', - inputPlaceholder: 'Spieler-Name eingeben...', - confirmButtonText: 'Berechnen', - showCancelButton: true, - cancelButtonText: 'Abbrechen', - customClass: swalClasses, - buttonsStyling: false - }).then((result) => { - if (result.isConfirmed) { - let promise = htmx.ajax('POST', '/score/' + result.value, {target: '#' + btn.id, swap: 'none'}); - } - }); -} - -function showSingleCalcResultDialog(xhr, reqPath) { - let icon; - switch (xhr.status) { - case 200: - icon = 'success'; - break; - case 404: - icon = 'warning'; - break; - default: - icon = 'error'; - } - - Swal.fire({ - title: 'Abfrage für "' + reqPath.replace("/score/", '') + '"', - text: "Score: " + xhr.response, - icon: icon, - customClass: swalClasses - }); -} - function showAdminActionExecutedDialog(xhr, method) { Swal.fire({ title: 'Action executed', diff --git a/templates/components/bottom_controls.html b/templates/components/bottom_controls.html index bc4bd0b..6e64b77 100644 --- a/templates/components/bottom_controls.html +++ b/templates/components/bottom_controls.html @@ -69,7 +69,7 @@