gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] 01/02: Give option to set Web page title.


From: gnunet
Subject: [libeufin] 01/02: Give option to set Web page title.
Date: Thu, 26 May 2022 12:02:02 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

commit da2ed8359b3f9ce91fd65f68ad346eb50eb6c40d
Author: ms <ms@taler.net>
AuthorDate: Thu May 26 11:58:16 2022 +0200

    Give option to set Web page title.
---
 sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt   |  2 ++
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
index c2dd5662..27f5d3d0 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
@@ -98,6 +98,7 @@ object DemobankConfigsTable : LongIdTable() {
     val name = text("hostname")
     val suggestedExchangeBaseUrl = text("suggestedExchangeBaseUrl").nullable()
     val suggestedExchangePayto = text("suggestedExchangePayto").nullable()
+    val uiTitle = text("uiTitle")
 }
 
 class DemobankConfigEntity(id: EntityID<Long>) : LongEntity(id) {
@@ -110,6 +111,7 @@ class DemobankConfigEntity(id: EntityID<Long>) : 
LongEntity(id) {
     var name by DemobankConfigsTable.name
     var suggestedExchangeBaseUrl by 
DemobankConfigsTable.suggestedExchangeBaseUrl
     var suggestedExchangePayto by DemobankConfigsTable.suggestedExchangePayto
+    var uiTitle by DemobankConfigsTable.uiTitle
 }
 
 /**
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index df53a5d9..a379a55f 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -144,6 +144,9 @@ class Config : CliktCommand(
         "--show",
         help = "Only show values, other options will be ignored."
     ).flag("--no-show", default = false)
+    private val uiTitleOption by option(
+        "--ui-title", help = "Title of the Web UI"
+    ).default("Demo Bank")
     private val currencyOption by option("--currency").default("EUR")
     private val bankDebtLimitOption by 
option("--bank-debt-limit").int().default(1000000)
     private val usersDebtLimitOption by 
option("--users-debt-limit").int().default(1000)
@@ -178,6 +181,7 @@ class Config : CliktCommand(
                                 val allowRegistrations = 
maybeDemobank.demoBank.allowRegistrations
                                 val name = maybeDemobank.demoBank.name // 
always 'default'
                                 val withSignupBonus = 
maybeDemobank.demoBank.withSignupBonus
+                                val uiTitle = maybeDemobank.demoBank.uiTitle
                             })
                         )
                         return@transaction
@@ -193,6 +197,7 @@ class Config : CliktCommand(
                         allowRegistrations = allowRegistrationsOption
                         name = nameArgument
                         this.withSignupBonus = withSignupBonusOption
+                        uiTitle = uiTitleOption
                     }
                     BankAccountEntity.new {
                         iban = getIban()
@@ -210,6 +215,7 @@ class Config : CliktCommand(
                 maybeDemobank.demoBank.allowRegistrations = 
allowRegistrationsOption
                 maybeDemobank.demoBank.withSignupBonus = withSignupBonusOption
                 maybeDemobank.demoBank.name = nameArgument
+                maybeDemobank.demoBank.uiTitle = uiTitleOption
             }
         }
     }
@@ -1045,6 +1051,10 @@ val sandboxApp: Application.() -> Unit = {
                     "__LIBEUFIN_UI_ALLOW_REGISTRATIONS__",
                     demobank.allowRegistrations.toString()
                 )
+                content = content.replace(
+                    "__LIBEUFIN_UI_BANK_NAME__",
+                    demobank.uiTitle
+                )
                 call.respondText(content, ContentType.Text.Html)
                 return@get
             }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]