diff --git a/src/jsMain/kotlin/de/kif/frontend/views/calendar/Calendar.kt b/src/jsMain/kotlin/de/kif/frontend/views/calendar/Calendar.kt index 7ba6ffa..3190635 100644 --- a/src/jsMain/kotlin/de/kif/frontend/views/calendar/Calendar.kt +++ b/src/jsMain/kotlin/de/kif/frontend/views/calendar/Calendar.kt @@ -24,6 +24,7 @@ class Calendar(calendar: HTMLElement) : View(calendar) { private val htmlBody = document.body ?: createHtmlView() val day = calendarTable.dataset["day"]?.toIntOrNull() ?: -1 + val reloadOnFinish = calendarTable.dataset["reload"]?.toBoolean() ?: false val referenceDate = calendarTable.dataset["reference"]?.toLongOrNull() ?: -1L val nowDate = calendarTable.dataset["now"]?.toLongOrNull() ?: -1L val timeDifference = Date.now().toLong() - nowDate diff --git a/src/jsMain/kotlin/de/kif/frontend/views/calendar/CalendarBody.kt b/src/jsMain/kotlin/de/kif/frontend/views/calendar/CalendarBody.kt index 7712d8b..a20cf37 100644 --- a/src/jsMain/kotlin/de/kif/frontend/views/calendar/CalendarBody.kt +++ b/src/jsMain/kotlin/de/kif/frontend/views/calendar/CalendarBody.kt @@ -10,6 +10,7 @@ import org.w3c.dom.HTMLElement import org.w3c.dom.INSTANT import org.w3c.dom.SMOOTH import org.w3c.dom.ScrollBehavior +import kotlin.browser.window import kotlin.js.Date import kotlin.math.max import kotlin.math.min @@ -97,7 +98,10 @@ class CalendarBody(val calendar: Calendar, view: HTMLElement) : ViewCollection div { + flex-grow: 0; + flex-shrink: 0; + } + + .board-schedule-name { + flex-grow: 1 !important; + flex-shrink: 1 !important; + } + + .board-schedule-room { + flex-grow: 1 !important; + flex-shrink: 1 !important; + } + .board-schedule-clock { position: absolute; left: 1rem; diff --git a/src/jvmMain/kotlin/de/kif/backend/route/Board.kt b/src/jvmMain/kotlin/de/kif/backend/route/Board.kt index b383637..7ed335e 100644 --- a/src/jvmMain/kotlin/de/kif/backend/route/Board.kt +++ b/src/jvmMain/kotlin/de/kif/backend/route/Board.kt @@ -174,7 +174,8 @@ fun Route.board() { min, max, rooms, - schedules + schedules, + reloadAfterFinish = true ) } div("board-twitter") { diff --git a/src/jvmMain/kotlin/de/kif/backend/route/Calendar.kt b/src/jvmMain/kotlin/de/kif/backend/route/Calendar.kt index a163022..6c53dab 100644 --- a/src/jvmMain/kotlin/de/kif/backend/route/Calendar.kt +++ b/src/jvmMain/kotlin/de/kif/backend/route/Calendar.kt @@ -70,7 +70,8 @@ fun DIV.renderCalendar( from: Int, to: Int, rooms: List, - schedules: Map>> + schedules: Map>>, + reloadAfterFinish: Boolean = false ) { val gridLabelWidth = 60 val minutesOfDay = to - from @@ -85,6 +86,7 @@ fun DIV.renderCalendar( attributes["data-day"] = day.toString() attributes["data-reference"] = Configuration.Schedule.referenceDate.time.toString() attributes["data-now"] = now.timeInMillis.toString() + attributes["data-reload"] = reloadAfterFinish.toString() div("calendar-table-box ${orientation.name.toLowerCase().replace("_", "-")}") { div("calendar-header") {