mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-28 04:46:18 +02:00
final push for themes
This commit is contained in:
@@ -15,8 +15,8 @@ LNBITS_SERVICE_FEE="0.0"
|
|||||||
|
|
||||||
# Change theme
|
# Change theme
|
||||||
LNBITS_SITE_TITLE=LNbits
|
LNBITS_SITE_TITLE=LNbits
|
||||||
# Choose from mint, flamingo, quasar, autumn, monochrome
|
# Choose from mint, flamingo, salvador, autumn, monochrome, classic
|
||||||
LNBITS_THEME_OPTIONS="mint, flamingo, quasar, autumn, monochrome, salvador"
|
LNBITS_THEME_OPTIONS="mint, flamingo, classic, autumn, monochrome, salvador"
|
||||||
|
|
||||||
# Choose from LNPayWallet, OpenNodeWallet, LntxbotWallet, LndWallet (gRPC),
|
# Choose from LNPayWallet, OpenNodeWallet, LntxbotWallet, LndWallet (gRPC),
|
||||||
# LndRestWallet, CLightningWallet, LNbitsWallet, SparkWallet
|
# LndRestWallet, CLightningWallet, LNbitsWallet, SparkWallet
|
||||||
|
@@ -31,7 +31,7 @@ LNBITS_DISABLED_EXTENSIONS: List[str] = env.list(
|
|||||||
)
|
)
|
||||||
|
|
||||||
LNBITS_SITE_TITLE = env.str("LNBITS_SITE_TITLE", default="LNbits")
|
LNBITS_SITE_TITLE = env.str("LNBITS_SITE_TITLE", default="LNbits")
|
||||||
LNBITS_THEME_OPTIONS: List[str] = env.list("LNBITS_THEME_OPTIONS", default="classic,green,orange", subcast=str)
|
LNBITS_THEME_OPTIONS: List[str] = env.list("LNBITS_THEME_OPTIONS", default="classic, flamingo, mint, salvador, monochrome, autumn", subcast=str)
|
||||||
|
|
||||||
WALLET = wallet_class()
|
WALLET = wallet_class()
|
||||||
DEFAULT_WALLET_NAME = env.str("LNBITS_DEFAULT_WALLET_NAME", default="LNbits wallet")
|
DEFAULT_WALLET_NAME = env.str("LNBITS_DEFAULT_WALLET_NAME", default="LNbits wallet")
|
||||||
|
@@ -334,18 +334,24 @@ window.windowMixin = {
|
|||||||
},
|
},
|
||||||
created: function () {
|
created: function () {
|
||||||
this.$q.dark.set(this.$q.localStorage.getItem('lnbits.darkMode'))
|
this.$q.dark.set(this.$q.localStorage.getItem('lnbits.darkMode'))
|
||||||
this.g.allowedThemes = window.allowedThemes
|
this.g.allowedThemes = window.allowedThemes ?? ['classic']
|
||||||
|
|
||||||
let theme = this.$q.localStorage.getItem('lnbits.theme')
|
|
||||||
|
|
||||||
// failsafe if admin changes themes halfway
|
// failsafe if admin changes themes halfway
|
||||||
if (theme && !this.g.allowedThemes.includes(theme)) {
|
if (
|
||||||
|
this.$q.localStorage.getItem('lnbits.theme') &&
|
||||||
|
!this.g.allowedThemes.includes(
|
||||||
|
this.$q.localStorage.getItem('lnbits.theme')
|
||||||
|
)
|
||||||
|
) {
|
||||||
console.log('allowedThemes changed by Admin', this.g.allowedThemes[0])
|
console.log('allowedThemes changed by Admin', this.g.allowedThemes[0])
|
||||||
this.changeColor(this.g.allowedThemes[0] || 'classic')
|
this.changeColor(this.g.allowedThemes[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theme) {
|
if (this.$q.localStorage.getItem('lnbits.theme')) {
|
||||||
document.body.setAttribute('data-theme', theme)
|
document.body.setAttribute(
|
||||||
|
'data-theme',
|
||||||
|
this.$q.localStorage.getItem('lnbits.theme')
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.user) {
|
if (window.user) {
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
<strong>LN</strong>bits {% endif %} {% endblock %}
|
<strong>LN</strong>bits {% endif %} {% endblock %}
|
||||||
</q-toolbar-title>
|
</q-toolbar-title>
|
||||||
{% block beta %}
|
{% block beta %}
|
||||||
<q-badge color="yellow" text-color="black">
|
<q-badge color="yellow" text-color="black" class="q-mr-md">
|
||||||
<span
|
<span
|
||||||
><span v-show="$q.screen.gt.sm"
|
><span v-show="$q.screen.gt.sm"
|
||||||
>USE WITH CAUTION - LNbits wallet is still in </span
|
>USE WITH CAUTION - LNbits wallet is still in </span
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
><q-tooltip>autumn</q-tooltip>
|
><q-tooltip>autumn</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="g.allowedThemes.includes('flamingo')"
|
v-if="g.allowedThemes.includes('monochrome')"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
@click="changeColor('monochrome')"
|
@click="changeColor('monochrome')"
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
><q-tooltip>monochrome</q-tooltip>
|
><q-tooltip>monochrome</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="g.allowedThemes.includes('monochrome')"
|
v-if="g.allowedThemes.includes('salvador')"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
@click="changeColor('salvador')"
|
@click="changeColor('salvador')"
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
><q-tooltip>elSalvador</q-tooltip>
|
><q-tooltip>elSalvador</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="g.allowedThemes.includes('quasar')"
|
v-if="g.allowedThemes.includes('flamingo')"
|
||||||
dense
|
dense
|
||||||
flat
|
flat
|
||||||
@click="changeColor('flamingo')"
|
@click="changeColor('flamingo')"
|
||||||
|
Reference in New Issue
Block a user