V2 von Brett her

This commit is contained in:
Lars Westermann 2019-06-08 19:39:45 +02:00
parent 2b29093086
commit 743e57395a
Signed by: lars.westermann
GPG key ID: 9D417FA5BB9D5E1D
7 changed files with 109 additions and 109 deletions

1
.gitignore vendored
View file

@ -9,4 +9,3 @@ data/
*.swo
*.db
twitter.toml

View file

@ -7,3 +7,6 @@ reference = "2019-06-06"
[general]
wiki_url = "https://wiki.kif.rocks/w/index.php?title=KIF470:Arbeitskreise&action=raw"
[twitter]
timeline = "https://twitter.com/kiforbiter?ref_src=twsrc%5Etfw"

View file

@ -28,18 +28,15 @@
padding: 0 0.4rem;
&:nth-child(1) {
flex-grow: 4;
padding-left: 0.15rem;
padding-right: 0.15rem;
flex-grow: 5;
}
&:nth-child(2) {
flex-grow: 3;
flex-grow: 4;
}
&:nth-child(3) {
flex-grow: 3;
flex-grow: 4;
}
}
}
@ -66,59 +63,53 @@
}
.board-schedule-box {
display: flex;
flex-wrap: wrap;
margin-bottom: 0.5rem;
padding: 1rem;
padding-bottom: 0.5rem;
table {
border-collapse: collapse;
}
}
.board-card-header {
font-family: 'Montserrat', sans-serif;
font-weight: 600;
line-height: 1.5rem;
}
.board-schedule {
position: relative;
flex-grow: 1;
flex-basis: 0;
min-width: 15rem;
padding: 0.6rem;
margin: 0 0.25rem 0.5rem;
line-height: 1.3rem;
height: 2rem;
&:not(:last-child) {
border-bottom: solid 1px var(--table-border-color)
}
}
.board-schedule-bottom {
display: block;
padding-left: 1rem;
padding-right: 0.5rem;
line-height: 1rem;
clear: both;
& > span {
&:first-child {
float: left;
}
&:last-child {
float: right;
}
}
}
.board-schedule-color {
width: 1.2rem;
span {
display: block;
background-color: var(--primary-color);
position: absolute;
top: 1.25rem;
left: 0.6rem;
width: 0.8rem;
height: 0.8rem;
border-radius: 100%;
margin-top: 0.1rem;
}
}
.board-schedule-time {
width: 7rem;
color: var(--text-secondary-color)
}
.board-schedule-name {
display: block;
padding-left: 1rem;
line-height: 1.3rem;
font-family: 'Montserrat', sans-serif;
font-weight: 600;
padding-top: 0.35rem;
padding-bottom: 0.35rem;
}
.board-schedule-room {
width: 4rem;
text-align: right;
color: var(--text-secondary-color)
}

View file

@ -97,6 +97,7 @@ a {
display: block;
position: relative;
padding-left: 2.5rem;
width: 8rem;
&::after {
content: '';

View file

@ -9,9 +9,7 @@ import io.ktor.routing.Route
import io.ktor.routing.get
import kotlinx.css.CSSBuilder
import kotlinx.css.Color
import kotlinx.html.div
import kotlinx.html.span
import kotlinx.html.unsafe
import kotlinx.html.*
import java.util.*
fun Route.board() {
@ -26,16 +24,6 @@ fun Route.board() {
respondMain(true, true) { theme ->
content {
/*
div("board-header") {
div {
+"KIF 47.0"
}
div("board-header-date") {
+formatDateTime(Date().time)
}
}
*/
div("board") {
div("board-schedules") {
attributes["data-reference"] = referenceTime.toString()
@ -44,12 +32,72 @@ fun Route.board() {
+"AKs"
}
div("board-schedule-box") {
div("board-card board-schedule-box") {
div("board-card-header") {
+"Running"
}
table {
for ((schedule, time) in scheduleList) {
div("board-card board-schedule") {
createBoardSchedule(schedule, time)
}
}
}
div("board-card board-schedule-box") {
div("board-card-header") {
+"Upcoming"
}
table {
for ((schedule, time) in scheduleList) {
createBoardSchedule(schedule, time)
}
}
}
}
div("board-posts") {
div("board-header") {
+"News"
}
for (post in postList) {
createPost(post, false, "board-card board-post")
}
}
div("board-twitter") {
div("board-header") {
+"Tweets"
}
div("board-card") {
unsafe {
raw("""
<a
class="twitter-timeline"
href="${Configuration.Twitter.timeline}"
data-chrome="transparent noheader nofooter"
data-theme="${if (theme.dark) "dark" else "light"}"
data-link-color="${theme.primaryColor}"
data-cards="hidden"
data-lang="de"
data-dnt="true"
>Twitter wall</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
""".trimIndent())
}
}
}
}
}
}
}
}
private fun TABLE.createBoardSchedule(schedule: Schedule, time: Int) {
tr("board-schedule") {
attributes["data-id"] = schedule.id.toString()
span("board-schedule-color") {
td("board-schedule-color") {
span {
attributes["style"] = CSSBuilder().apply {
val c = schedule.workGroup.track?.color
if (c != null) {
@ -57,12 +105,9 @@ fun Route.board() {
}
}.toString()
}
span("board-schedule-name") {
+schedule.workGroup.name
}
div("board-schedule-bottom") {
span("board-schedule-time") {
td("board-schedule-time") {
attributes["data-time"] = time.toString()
attributes["data-duration"] = schedule.workGroup.length.toString()
@ -84,50 +129,12 @@ fun Route.board() {
+"$startTimeString - $endTimeString"
}
span("board-schedule-room") {
td("board-schedule-name") {
+schedule.workGroup.name
}
td("board-schedule-room") {
+schedule.room.name
}
}
}
}
}
}
div("board-posts") {
div("board-header") {
+"News"
}
for (post in postList) {
createPost(post, false, "board-card board-post")
}
}
div("board-twitter") {
div("board-header") {
+"Tweets"
}
div("board-card") {
unsafe {
raw(
"""
<a
class="twitter-timeline"
href="${Configuration.Twitter.timeline}"
data-chrome="transparent noheader nofooter"
data-theme="${if (theme.dark) "dark" else "light"}"
data-link-color="${theme.primaryColor}"
data-cards="hidden"
data-lang="de"
data-dnt="true"
>Tweets by kiforbiter</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
""".trimIndent()
)
}
}
}
}
}
}
}
}

View file

@ -105,7 +105,7 @@ fun Route.overview() {
data-cards="hidden"
data-lang="de"
data-dnt="true"
>Tweets by kiforbiter</a>
>Twitter wall</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
""".trimIndent())
}

View file

@ -9,7 +9,7 @@ uploads = "data/uploads"
database = "data/portal.db"
[schedule]
reference = "2019-03-27"
reference = "1970-01-01"
[security]
session_name = "SESSION"
@ -20,5 +20,4 @@ allowed_upload_extensions = "png, jpg, jpeg"
wiki_url = ""
[twitter]
username = ""
password = ""
timeline = ""