From: TheSaminator Date: Fri, 11 Mar 2022 22:35:41 +0000 (-0500) Subject: Change main-page sidebar X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=90b03aecade30d090275a4aa7b2665a8b9b8b727;p=starship-fights Change main-page sidebar --- diff --git a/src/jvmMain/kotlin/starshipfights/info/view_bar.kt b/src/jvmMain/kotlin/starshipfights/info/view_bar.kt index 0b418e2..a66324d 100644 --- a/src/jvmMain/kotlin/starshipfights/info/view_bar.kt +++ b/src/jvmMain/kotlin/starshipfights/info/view_bar.kt @@ -1,6 +1,7 @@ package starshipfights.info import kotlinx.html.* +import starshipfights.data.auth.User import starshipfights.game.ShipType import starshipfights.game.getDefiniteShortName @@ -13,10 +14,20 @@ class CustomSidebar(private val block: ASIDE.() -> Unit) : Sidebar() { override fun ASIDE.display() = block() } -object IndexSidebar : Sidebar() { +data class IndexSidebar(val madeBy: User) : Sidebar() { override fun ASIDE.display() { p { - +"This game is in early development! Report bugs and flaws as you see them, but keep in mind that this game is still being worked on." + style = "text-align:center" + +"Starship Fights is made by" + } + img(src = madeBy.discordAvatarUrl) { + style = "border-radius:50%" + } + p { + style = "text-align:center" + +madeBy.discordName + +"#" + +madeBy.discordDiscriminator } } } diff --git a/src/jvmMain/kotlin/starshipfights/info/views_main.kt b/src/jvmMain/kotlin/starshipfights/info/views_main.kt index d3466f5..c5f4279 100644 --- a/src/jvmMain/kotlin/starshipfights/info/views_main.kt +++ b/src/jvmMain/kotlin/starshipfights/info/views_main.kt @@ -10,7 +10,11 @@ import starshipfights.CurrentConfiguration import starshipfights.data.auth.User suspend fun ApplicationCall.mainPage(): HTML.() -> Unit { - return page(null, standardNavBar(), IndexSidebar) { + return page(null, standardNavBar(), CurrentConfiguration.discordClient?.ownerId?.let { + User.locate(User::discordId eq it) + }?.let { + IndexSidebar(it) + }) { section { img(alt = "Starship Fights Logo", src = "/static/images/logo.svg") { style = "width:100%"