feat: hide burger bg toggle (#3969)
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
@@ -119,6 +119,8 @@ LNBITS_SITE_TAGLINE="Open Source Lightning Payments Platform"
|
|||||||
LNBITS_SITE_DESCRIPTION="The world's most powerful suite of bitcoin tools. Run for yourself, for others, or as part of a stack."
|
LNBITS_SITE_DESCRIPTION="The world's most powerful suite of bitcoin tools. Run for yourself, for others, or as part of a stack."
|
||||||
# Choose from bitcoin, mint, flamingo, freedom, salvador, autumn, monochrome, classic, cyber
|
# Choose from bitcoin, mint, flamingo, freedom, salvador, autumn, monochrome, classic, cyber
|
||||||
LNBITS_THEME_OPTIONS="classic, bitcoin, flamingo, freedom, mint, autumn, monochrome, salvador, cyber"
|
LNBITS_THEME_OPTIONS="classic, bitcoin, flamingo, freedom, mint, autumn, monochrome, salvador, cyber"
|
||||||
|
# Toggle the background styling on burger menus / drawers
|
||||||
|
# LNBITS_DEFAULT_BURGER_MENU_BACKGROUND=true
|
||||||
# LNBITS_CUSTOM_LOGO="https://lnbits.com/assets/images/logo/logo.svg"
|
# LNBITS_CUSTOM_LOGO="https://lnbits.com/assets/images/logo/logo.svg"
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
|
|||||||
@@ -300,6 +300,7 @@ class ThemesSettings(LNbitsSettings):
|
|||||||
lnbits_default_card_rounded: bool = Field(default=True)
|
lnbits_default_card_rounded: bool = Field(default=True)
|
||||||
lnbits_default_card_gradient: bool = Field(default=True)
|
lnbits_default_card_gradient: bool = Field(default=True)
|
||||||
lnbits_default_card_shadow: bool = Field(default=False)
|
lnbits_default_card_shadow: bool = Field(default=False)
|
||||||
|
lnbits_default_burger_menu_background: bool = Field(default=True)
|
||||||
|
|
||||||
|
|
||||||
class OpsSettings(LNbitsSettings):
|
class OpsSettings(LNbitsSettings):
|
||||||
@@ -1281,6 +1282,7 @@ class PublicSettings(BaseModel):
|
|||||||
default_card_rounded: bool = Field(alias="defaultCardRounded")
|
default_card_rounded: bool = Field(alias="defaultCardRounded")
|
||||||
default_card_gradient: bool = Field(alias="defaultCardGradient")
|
default_card_gradient: bool = Field(alias="defaultCardGradient")
|
||||||
default_card_shadow: bool = Field(alias="defaultCardShadow")
|
default_card_shadow: bool = Field(alias="defaultCardShadow")
|
||||||
|
default_burger_menu_background: bool = Field(alias="defaultBurgerMenuBackground")
|
||||||
denomination: str | None = Field()
|
denomination: str | None = Field()
|
||||||
extensions: list[str] = Field()
|
extensions: list[str] = Field()
|
||||||
allowed_currencies: list[str] = Field(alias="allowedCurrencies")
|
allowed_currencies: list[str] = Field(alias="allowedCurrencies")
|
||||||
@@ -1344,6 +1346,7 @@ class PublicSettings(BaseModel):
|
|||||||
defaultCardRounded=settings.lnbits_default_card_rounded,
|
defaultCardRounded=settings.lnbits_default_card_rounded,
|
||||||
defaultCardGradient=settings.lnbits_default_card_gradient,
|
defaultCardGradient=settings.lnbits_default_card_gradient,
|
||||||
defaultCardShadow=settings.lnbits_default_card_shadow,
|
defaultCardShadow=settings.lnbits_default_card_shadow,
|
||||||
|
defaultBurgerMenuBackground=settings.lnbits_default_burger_menu_background,
|
||||||
denomination=settings.lnbits_denomination,
|
denomination=settings.lnbits_denomination,
|
||||||
extensions=list(settings.lnbits_installed_extensions_ids),
|
extensions=list(settings.lnbits_installed_extensions_ids),
|
||||||
allowedCurrencies=settings.lnbits_allowed_currencies,
|
allowedCurrencies=settings.lnbits_allowed_currencies,
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -395,6 +395,13 @@ body.card-shadow.body--dark .q-card:not(.q-dialog .q-card, .lnbits__dialog-card,
|
|||||||
filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
|
filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.no-burger-background .q-drawer {
|
||||||
|
background-color: transparent !important;
|
||||||
|
background-image: none !important;
|
||||||
|
backdrop-filter: none !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--size: 100px;
|
--size: 100px;
|
||||||
--gap: 25px;
|
--gap: 25px;
|
||||||
|
|||||||
@@ -490,6 +490,8 @@ window.localisation.en = {
|
|||||||
toggle_card_gradient: 'Toggle gradient on cards',
|
toggle_card_gradient: 'Toggle gradient on cards',
|
||||||
card_shadow: 'Card Shadow',
|
card_shadow: 'Card Shadow',
|
||||||
toggle_card_shadow: 'Toggle shadow on cards',
|
toggle_card_shadow: 'Toggle shadow on cards',
|
||||||
|
burger_menu_background: 'Burger Menu Background',
|
||||||
|
toggle_burger_menu_background: 'Toggle burger menu background',
|
||||||
language: 'Language',
|
language: 'Language',
|
||||||
assets: 'Assets',
|
assets: 'Assets',
|
||||||
max_asset_size_mb: 'Max Asset Size (MB)',
|
max_asset_size_mb: 'Max Asset Size (MB)',
|
||||||
|
|||||||
@@ -69,6 +69,14 @@ window.app.component('lnbits-theme', {
|
|||||||
document.body.classList.remove('card-shadow')
|
document.body.classList.remove('card-shadow')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'g.burgerMenuChoice'(val) {
|
||||||
|
this.$q.localStorage.set('lnbits.burgerMenu', val)
|
||||||
|
if (val === true) {
|
||||||
|
document.body.classList.remove('no-burger-background')
|
||||||
|
} else {
|
||||||
|
document.body.classList.add('no-burger-background')
|
||||||
|
}
|
||||||
|
},
|
||||||
'g.mobileSimple'(val) {
|
'g.mobileSimple'(val) {
|
||||||
this.$q.localStorage.set('lnbits.mobileSimple', val)
|
this.$q.localStorage.set('lnbits.mobileSimple', val)
|
||||||
if (val === true) {
|
if (val === true) {
|
||||||
@@ -150,6 +158,9 @@ window.app.component('lnbits-theme', {
|
|||||||
if (this.g.cardShadowChoice === true) {
|
if (this.g.cardShadowChoice === true) {
|
||||||
document.body.classList.add('card-shadow')
|
document.body.classList.add('card-shadow')
|
||||||
}
|
}
|
||||||
|
if (this.g.burgerMenuChoice !== true) {
|
||||||
|
document.body.classList.add('no-burger-background')
|
||||||
|
}
|
||||||
if (this.g.bgimageChoice !== '') {
|
if (this.g.bgimageChoice !== '') {
|
||||||
document.body.classList.add('bg-image')
|
document.body.classList.add('bg-image')
|
||||||
document.body.style.setProperty(
|
document.body.style.setProperty(
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ window.g = Vue.reactive({
|
|||||||
SETTINGS.defaultCardGradient
|
SETTINGS.defaultCardGradient
|
||||||
),
|
),
|
||||||
cardShadowChoice: localStore('lnbits.cardShadow', SETTINGS.defaultCardShadow),
|
cardShadowChoice: localStore('lnbits.cardShadow', SETTINGS.defaultCardShadow),
|
||||||
|
burgerMenuChoice: localStore(
|
||||||
|
'lnbits.burgerMenu',
|
||||||
|
SETTINGS.defaultBurgerMenuBackground
|
||||||
|
),
|
||||||
reactionChoice: localStore('lnbits.reactions', SETTINGS.defaultReaction),
|
reactionChoice: localStore('lnbits.reactions', SETTINGS.defaultReaction),
|
||||||
bgimageChoice: localStore(
|
bgimageChoice: localStore(
|
||||||
'lnbits.backgroundImage',
|
'lnbits.backgroundImage',
|
||||||
|
|||||||
@@ -732,7 +732,8 @@ window.PageAccount = {
|
|||||||
darkChoice: this.g.settings.defaultDark,
|
darkChoice: this.g.settings.defaultDark,
|
||||||
cardRoundedChoice: this.g.settings.defaultCardRounded,
|
cardRoundedChoice: this.g.settings.defaultCardRounded,
|
||||||
cardGradientChoice: this.g.settings.defaultCardGradient,
|
cardGradientChoice: this.g.settings.defaultCardGradient,
|
||||||
cardShadowChoice: this.g.settings.defaultCardShadow
|
cardShadowChoice: this.g.settings.defaultCardShadow,
|
||||||
|
burgerMenuChoice: this.g.settings.defaultBurgerMenuBackground
|
||||||
}
|
}
|
||||||
this.siteCustomisationChanged(defaults)
|
this.siteCustomisationChanged(defaults)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,3 +70,12 @@ body.card-shadow.body--dark {
|
|||||||
filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
|
filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.no-burger-background {
|
||||||
|
.q-drawer {
|
||||||
|
background-color: transparent !important;
|
||||||
|
background-image: none !important;
|
||||||
|
backdrop-filter: none !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -320,6 +320,15 @@
|
|||||||
>
|
>
|
||||||
</q-toggle>
|
</q-toggle>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-12 col-sm-6 col-lg-2">
|
||||||
|
<q-toggle
|
||||||
|
type="bool"
|
||||||
|
v-model="formData.lnbits_default_burger_menu_background"
|
||||||
|
color="primary"
|
||||||
|
:label="$t('burger_menu_background')"
|
||||||
|
>
|
||||||
|
</q-toggle>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|||||||
@@ -601,6 +601,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row q-mb-md">
|
||||||
|
<div class="col-4">
|
||||||
|
<span v-text="$t('burger_menu_background')"></span>
|
||||||
|
</div>
|
||||||
|
<div class="col-8">
|
||||||
|
<q-toggle
|
||||||
|
dense
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
icon="menu_open"
|
||||||
|
v-model="g.burgerMenuChoice"
|
||||||
|
@update:model-value="
|
||||||
|
siteCustomisationChanged({burgerMenuChoice: $event})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<q-tooltip
|
||||||
|
><span
|
||||||
|
v-text="$t('toggle_burger_menu_background')"
|
||||||
|
></span
|
||||||
|
></q-tooltip>
|
||||||
|
</q-toggle>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row q-mb-md">
|
<div class="row q-mb-md">
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<span v-text="$t('toggle_darkmode')"></span>
|
<span v-text="$t('toggle_darkmode')"></span>
|
||||||
|
|||||||
@@ -37,12 +37,14 @@ def test_dict_to_settings_parses_known_values():
|
|||||||
{
|
{
|
||||||
"lnbits_site_title": "Test Title",
|
"lnbits_site_title": "Test Title",
|
||||||
"lnbits_service_fee": 5,
|
"lnbits_service_fee": 5,
|
||||||
|
"lnbits_default_burger_menu_background": False,
|
||||||
"ignored_field": "ignored",
|
"ignored_field": "ignored",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
assert parsed.lnbits_site_title == "Test Title"
|
assert parsed.lnbits_site_title == "Test Title"
|
||||||
assert parsed.lnbits_service_fee == 5
|
assert parsed.lnbits_service_fee == 5
|
||||||
|
assert parsed.lnbits_default_burger_menu_background is False
|
||||||
assert not hasattr(parsed, "ignored_field")
|
assert not hasattr(parsed, "ignored_field")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -232,6 +232,14 @@ def test_installed_extensions_settings_activate_and_deactivate_paths():
|
|||||||
assert installed.find_extension_redirect("/.well-known/lnurlp", []) is None
|
assert installed.find_extension_redirect("/.well-known/lnurlp", []) is None
|
||||||
|
|
||||||
|
|
||||||
|
def test_public_settings_include_burger_menu_background(settings: Settings):
|
||||||
|
settings.lnbits_default_burger_menu_background = False
|
||||||
|
|
||||||
|
public_settings = PublicSettings.from_settings(settings)
|
||||||
|
|
||||||
|
assert public_settings.default_burger_menu_background is False
|
||||||
|
|
||||||
|
|
||||||
def test_installed_extensions_settings_detects_conflicting_redirects():
|
def test_installed_extensions_settings_detects_conflicting_redirects():
|
||||||
installed = InstalledExtensionsSettings(
|
installed = InstalledExtensionsSettings(
|
||||||
lnbits_extensions_redirects=[
|
lnbits_extensions_redirects=[
|
||||||
|
|||||||
Reference in New Issue
Block a user