From 06e73365a935a57be795cac66bab5ec3251be785 Mon Sep 17 00:00:00 2001 From: Lars Westermann Date: Wed, 12 Jun 2019 21:46:34 +0200 Subject: [PATCH] Bugfixes --- .../kotlin/de/kif/backend/route/Account.kt | 46 ------------------- 1 file changed, 46 deletions(-) diff --git a/src/jvmMain/kotlin/de/kif/backend/route/Account.kt b/src/jvmMain/kotlin/de/kif/backend/route/Account.kt index f944932..ac61a56 100644 --- a/src/jvmMain/kotlin/de/kif/backend/route/Account.kt +++ b/src/jvmMain/kotlin/de/kif/backend/route/Account.kt @@ -56,35 +56,6 @@ fun Route.account() { +"Aus Wiki importieren" } } - - if (user.checkPermission(Permission.SCHEDULE)) { - form(action = "$prefix/account/shift", method = FormMethod.post) { - div("form-group") { - label { - htmlFor = "shift" - +"Zeitplan verschieben" - } - input( - name = "shift", - classes = "form-control", - type = InputType.number - ) { - id = "shift" - placeholder = "Tage" - value = "" - - min = "-1337" - max = "1337" - } - } - - div("form-group") { - button(type = ButtonType.submit, classes = "form-btn btn-primary") { - +"Verschieben" - } - } - } - } } } } @@ -552,21 +523,4 @@ fun Route.account() { call.error(HttpStatusCode.Unauthorized) } } - - post("/account/shift") { - authenticateOrRedirect(Permission.SCHEDULE) { - val shift = call.request.queryParameters["shift"]?.toIntOrNull() ?: 0 - - if (shift != 0 && shift in -1337..1337) { - val schedules = ScheduleRepository.all() - - for (schedule in schedules) { - ScheduleRepository.update(schedule.copy(day = schedule.day + shift)) - } - } - - call.respondRedirect("$prefix/account") - } - - } }