kodeshare/src/main/kotlin/moe/kageru/kodeshare/pages/Homepage.kt

40 lines
1.1 KiB
Kotlin
Raw Normal View History

2019-09-22 18:26:28 +02:00
package moe.kageru.kodeshare.pages
import io.ktor.html.HtmlContent
import io.ktor.http.HttpStatusCode
import kotlinx.html.*
object Homepage {
val content = HtmlContent(HttpStatusCode.OK) {
head {
2020-03-12 10:57:28 +01:00
defaultHead("Create new paste")
2019-09-22 18:26:28 +02:00
}
body {
2019-09-29 11:50:14 +02:00
a("/about") { div(Css.FLOATY_CLASS) { +"About" } }
2019-09-22 18:26:28 +02:00
form("/", encType = FormEncType.multipartFormData, method = FormMethod.post) {
acceptCharset = "utf-8"
textArea {
2019-09-29 11:50:14 +02:00
autoFocus = true
2019-09-22 18:26:28 +02:00
name = "input"
rows = "20"
cols = "100"
}
p {
submitInput { value = "Upload" }
}
}
}
}
2019-09-29 17:18:38 +02:00
}
2020-03-12 10:57:28 +01:00
fun HEAD.defaultHead(title: String) {
link(rel = "stylesheet", href = "/style.css", type = "text/css")
meta(content = title) {
attributes["property"] = "og:title"
}
meta(content = "kodeshare – a FOSS pastebin alternative") {
attributes["property"] = "og:site_name"
}
meta(name = "theme-color", content = "#66D9EF")
}