Did things

This commit is contained in:
Lars Westermann 2019-06-09 14:26:41 +02:00
parent f5b937a293
commit 8a926aeb35
Signed by: lars.westermann
GPG key ID: 9D417FA5BB9D5E1D
6 changed files with 20 additions and 8 deletions

View file

@ -3,7 +3,7 @@ host = "localhost"
port = 8080
[schedule]
reference = "2019-06-06"
reference = "2019-06-12"
[general]
wiki_url = "https://wiki.kif.rocks/w/index.php?title=KIF470:Arbeitskreise&action=raw"

View file

@ -64,11 +64,11 @@
.board-schedule-box {
margin-bottom: 0.5rem;
padding: 1rem;
padding-bottom: 0.5rem;
padding: 1rem 1rem 0.5rem;
table {
border-collapse: collapse;
width: 100%;
}
}

View file

@ -51,6 +51,7 @@ select:-moz-focusring {
line-height: 2.5rem;
margin-left: 1rem;
width: 100%;
top: 1.6rem;
}
}
@ -185,10 +186,13 @@ form {
white-space: nowrap;
}
& > * {
margin-right: 0;
.form-control {
flex-grow: 1;
flex-basis: 0;
}
& > * {
margin-right: 0;
&:not(:first-child) {
border-top-left-radius: 0;

View file

@ -108,6 +108,7 @@
table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
}
td {

View file

@ -15,13 +15,13 @@ object Configuration {
private val config: Config
class ConfigDelegate<T>(val item: Item<T>) {
private class ConfigDelegate<T>(val item: Item<T>) {
operator fun getValue(thisRef: Any?, property: KProperty<*>): T {
return config[item]
}
}
fun <T> c(item: Item<T>) = ConfigDelegate(item)
private fun <T> c(item: Item<T>) = ConfigDelegate(item)
private object ServerSpec : ConfigSpec("server") {
val host by required<String>()

View file

@ -141,7 +141,14 @@ private fun DIV.renderCalendar(
fun Route.calendar() {
get("/calendar") {
call.respondRedirect("/calendar/0", true)
val refDate = Configuration.Schedule.referenceDate
val todayDate = Date()
val refDay = refDate.time / (1000 * 60 * 60 * 24)
val todayDay = todayDate.time / (1000 * 60 * 60 * 24)
val day = todayDay - refDay
call.respondRedirect("/calendar/$day", false)
}
get("/calendar/{day}/rtt") {