import info.mechyrdia.route.installCsrfToken
import io.ktor.server.application.ApplicationCall
import kotlinx.coroutines.flow.toList
-import kotlinx.html.FormMethod
-import kotlinx.html.HTML
-import kotlinx.html.div
-import kotlinx.html.form
-import kotlinx.html.h1
-import kotlinx.html.p
-import kotlinx.html.style
-import kotlinx.html.submitInput
-import kotlinx.html.table
-import kotlinx.html.td
-import kotlinx.html.textInput
-import kotlinx.html.th
-import kotlinx.html.tr
+import kotlinx.html.*
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.time.Instant
import io.ktor.server.sessions.get
import io.ktor.server.sessions.sessions
import kotlinx.coroutines.flow.toList
-import kotlinx.html.HTML
-import kotlinx.html.a
-import kotlinx.html.h1
-import kotlinx.html.id
-import kotlinx.html.p
-import kotlinx.html.section
+import kotlinx.html.*
fun ApplicationCall.currentUserPage(): Nothing {
val currNationId = sessions.get<UserSession>()?.nationId
return width?.let { mapOf("colspan" to "$it") }.orEmpty() + height?.let { mapOf("rowspan" to "$it") }.orEmpty()
}
-fun String.toInternalUrl() = if (startsWith("/")) "/lore$this" else "./$this"
+fun String.toInternalUrl() = if (startsWith("/")) "/lore$this" else if (startsWith("#")) this else "./$this"
fun String.toExternalUrl() = if (startsWith("http:")) "https:${substring(5)}" else this
fun processInternalLink(param: String?): Map<String, String> = param
import info.mechyrdia.MainDomainName
import io.ktor.server.application.ApplicationCall
import io.ktor.server.request.path
-import kotlinx.html.HEAD
-import kotlinx.html.meta
+import kotlinx.html.*
import kotlinx.serialization.Serializable
@Serializable
import io.ktor.websocket.WebSocketSession
import io.ktor.websocket.close
import io.ktor.websocket.readText
-import kotlinx.html.FormMethod
-import kotlinx.html.HTML
-import kotlinx.html.b
-import kotlinx.html.form
-import kotlinx.html.h1
-import kotlinx.html.li
-import kotlinx.html.main
-import kotlinx.html.p
-import kotlinx.html.section
-import kotlinx.html.span
-import kotlinx.html.submitInput
-import kotlinx.html.ul
+import kotlinx.html.*
suspend fun ApplicationCall.robotPage(): HTML.() -> Unit {
val nation = currentNation()?.id ?: redirectHrefWithError(Root.Auth.LoginPage(), error = "You must be logged in to use the NUKE")