Add owner indicator
authorTheSaminator <TheSaminator@users.noreply.github.com>
Tue, 8 Feb 2022 22:24:30 +0000 (17:24 -0500)
committerTheSaminator <TheSaminator@users.noreply.github.com>
Tue, 8 Feb 2022 22:24:30 +0000 (17:24 -0500)
src/jvmMain/kotlin/starshipfights/info/views_user.kt

index 413975d3124624b611d7635a826666818f7df79a..6c6df5ab9cef800582bcd65df47c43eb5abc4092 100644 (file)
@@ -8,6 +8,7 @@ import kotlinx.html.*
 import org.litote.kmongo.and
 import org.litote.kmongo.eq
 import org.litote.kmongo.or
+import starshipfights.CurrentConfiguration
 import starshipfights.ForbiddenException
 import starshipfights.auth.getUser
 import starshipfights.auth.getUserSession
@@ -36,15 +37,14 @@ suspend fun ApplicationCall.userPage(): HTML.() -> Unit {
                                        NavLink("/admiral/new", "New Admiral"),
                                )
                        )
-               else
-                       CustomSidebar {
-                       
-                       }
+               else null
        ) {
                section {
                        h1 { +user.profileName }
                        p {
-                               +"This user's profile name is ${user.profileName}!"
+                               +user.discordName
+                               +"#"
+                               +user.discordDiscriminator
                        }
                        
                        if (isCurrentUser)
@@ -52,6 +52,11 @@ suspend fun ApplicationCall.userPage(): HTML.() -> Unit {
                                        +"This user is you!"
                                }
                        
+                       if (user.discordId == CurrentConfiguration.discordClient?.ownerId)
+                               p {
+                                       +"This user is the owner of the site!"
+                               }
+                       
                        if (admirals.isNotEmpty()) {
                                p {
                                        +"This user has the following admirals:"