Add private info download link
authorTheSaminator <TheSaminator@users.noreply.github.com>
Sat, 9 Apr 2022 17:34:42 +0000 (13:34 -0400)
committerTheSaminator <TheSaminator@users.noreply.github.com>
Sat, 9 Apr 2022 17:34:42 +0000 (13:34 -0400)
src/jvmMain/kotlin/starshipfights/info/views_gdpr.kt

index ac6871033bd9180889923c1eda77288b382e96df..2467f225926853475c944569d3568c92ce36ace0 100644 (file)
@@ -4,10 +4,7 @@ import io.ktor.application.*
 import kotlinx.coroutines.async
 import kotlinx.coroutines.coroutineScope
 import kotlinx.coroutines.flow.toList
-import kotlinx.html.HTML
-import kotlinx.html.h1
-import kotlinx.html.iframe
-import kotlinx.html.style
+import kotlinx.html.*
 import org.litote.kmongo.eq
 import org.litote.kmongo.or
 import starshipfights.auth.getUser
@@ -167,6 +164,13 @@ suspend fun ApplicationCall.privateInfoPage(): HTML.() -> Unit {
                                style = "width:100%;height:25em"
                                src = "/me/private-info/txt"
                        }
+                       
+                       p {
+                               a(href = "/me/private-info/txt") {
+                                       attributes["download"] = "private-info.txt"
+                                       +"Download your private info"
+                               }
+                       }
                }
        }
 }