Change main-page sidebar
authorTheSaminator <TheSaminator@users.noreply.github.com>
Fri, 11 Mar 2022 22:35:41 +0000 (17:35 -0500)
committerTheSaminator <TheSaminator@users.noreply.github.com>
Fri, 11 Mar 2022 22:35:41 +0000 (17:35 -0500)
src/jvmMain/kotlin/starshipfights/info/view_bar.kt
src/jvmMain/kotlin/starshipfights/info/views_main.kt

index 0b418e29623ba7b1070356dda826bdf1435a05fe..a66324dc8b20a4987031e7668f5ef163be7622cc 100644 (file)
@@ -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
                }
        }
 }
index d3466f5ce3824691f2e2acf7addefca7c124b616..c5f42791a00de39fbc1818f260498dd5dd426d39 100644 (file)
@@ -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%"