From: David ‘Bombe’ Roden Date: Sun, 29 May 2016 19:00:15 +0000 (+0200) Subject: Show optional columns X-Git-Tag: v2~118 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=3e1f51fa8c99b4d205e4fd5bb87f9ce013b887f6;p=rhynodge.git Show optional columns --- diff --git a/src/main/kotlin/net/pterodactylus/rhynodge/webpages/weather/WeatherTrigger.kt b/src/main/kotlin/net/pterodactylus/rhynodge/webpages/weather/WeatherTrigger.kt index 4bc46d4..0522b02 100644 --- a/src/main/kotlin/net/pterodactylus/rhynodge/webpages/weather/WeatherTrigger.kt +++ b/src/main/kotlin/net/pterodactylus/rhynodge/webpages/weather/WeatherTrigger.kt @@ -50,33 +50,59 @@ class WeatherTrigger : Trigger { head { style("text/css") { unsafe { - +".hour-state { display: table-row; } " - +".hour-state > div { display: table-cell; padding-right: 1em; } " + +".weather-states { display: table; } " + +".hour-state, .header { display: table-row; } " + +".hour-state > div { display: table-cell; padding: 0em 0.5em; text-align: center; } " + +".header > div { display: table-cell; padding: 0em 0.5em; font-weight: bold; text-align: center; } " } } } body { val startTime = state.dateTime.toInstant() h1 { +"The Weather (according to wetter.de) on %s".format(dateFormatter.format(startTime.toEpochMilli())) } + val showFeltTemperature = state.any { it.feltTemperature != null } + val showGustSpeed = state.any { it.gustSpeed != null } + val showHumidity = state.any { it.humidity != null } state.forEach { - div("hour-state") { - div("time") { +"%tH:%