import net.starshipfights.redirect
fun Routing.installCampaign() {
- lab("cluster", "Star Clusters") {
+ lab("cluster", "Star Clusters") { errorMessage ->
section {
h1 { +"Star Clusters" }
p { +"This is only a test and may not be indicative of the finished star-cluster feature for Starship Fights" }
form(action = "/labs/cluster", method = FormMethod.post) {
+ errorMessage?.let { errorMsg ->
+ p {
+ style = "color:#d22"
+ +errorMsg
+ }
+ }
h2 { +"Generation Parameters" }
h3 { +"Background Color" }
for (color in StarClusterBackground.values()) {
fun labUrl(slug: String) = "/labs/$slug"
-fun Routing.lab(slug: String, title: String, pageBody: SECTIONS.() -> Unit) {
+fun Routing.lab(slug: String, title: String, pageBody: SECTIONS.(errorMessage: String?) -> Unit) {
labs[slug] = title
get(labUrl(slug)) {
title,
call.standardNavBar(),
labsSidebar,
- pageBody
- )
+ ) { pageBody(call.request.queryParameters["error"]) }
)
}
}