Add settings for currency and inline player

This commit is contained in:
Cadence Ember 2025-04-08 14:45:18 +12:00
parent 6cc0003120
commit 82234f9706
10 changed files with 104 additions and 15 deletions

View file

@ -9,7 +9,7 @@ block view
.d-grid.gx8.gy12.jc-center.break-word(style="grid-template-columns: repeat(auto-fit, 210px)")
each item in items
div
a.cover(href=item.item_url hx-get=`/api/play/${item.item_type}/${item.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false")
a.cover&attributes(getAlbumCoverAttributes(event, item))
picture
img(loading="lazy" src=item.item_art_url width=210 height=210)
!= icons.use("play-solid", 64)

View file

@ -28,5 +28,5 @@ block view
span.s-tag--sponsor!= icons.use("flower", 16)
= label
each preview in item.previews
a.d-flex(href=preview.item_url hx-get=`/api/play/${preview.item_type}/${preview.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false")
a.d-flex&attributes(getAlbumCoverAttributes(event, preview))
img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px")

View file

@ -13,7 +13,7 @@ html
.s-topbar--container.wmx9
.s-topbar--logo
!= icons.get("compass-solid", 24)
.ml4 BC Explorer
.ml6 BC Explorer
.mx-auto.wmx9.py24.px16.g24
.s-prose

View file

@ -29,9 +29,36 @@ html
#page(hx-history-elt)
header.s-topbar.ps-sticky.t0
.s-topbar--container.wmx9
.s-topbar--logo
button.s-topbar--logo.s-btn.s-btn__muted.s-btn__dropdown.pr24.bar0.fc-black(popovertarget="menu")
!= icons.get("compass-solid", 24)
.ml4 BC Explorer
.ml6 BC Explorer
#menu(popover data-popper-placement="bottom" style="display: revert;").s-popover.overflow-visible.px0.py8
.s-popover--arrow.s-popover--arrow__tc
ul.s-menu(role="menu")
li(role="menuitem")
a.s-block-link.d-flex.ai-center.fc-black(href="/" hx-boost="false")
!= icons.get("log-out")
.ml6 Switch account
li.s-menu--divider(role="separator")
li.s-menu--title Settings
li(role="menuitem")
form.s-block-link.d-flex.ai-center(hx-post="/api/settings/inline-player" hx-trigger="change" hx-indicator="#inline-player-loading")
label.fl-grow1.d-flex.ai-center
!= icons.get("layout-right")
.pl6(for="inline-player-switch") Inline player
#inline-player-loading
input.s-toggle-switch#inline-player-switch(type="checkbox" name="inline_player" checked=(h3.getCookie(event, "bcex-inline-player-disabled") !== "true"))
li(role="menuitem")
form.s-block-link.d-flex.ai-center(hx-post="/api/settings/currency" hx-trigger="change" hx-select="#collection-stats" hx-target="#collection-stats" hx-indicator="#currency-loading")
label.fl-grow1(for="currency-select").d-flex.ai-center
!= icons.get("coins")
.pl6 Currency
#currency-loading
input(type="hidden" name="account" value=account)
.s-select
select#currency-select(name="currency")
each currency in currencies
option(selected=(currency === count.displayCurrency))= currency
.fl-grow1
nav
ul.s-navigation
@ -79,7 +106,7 @@ html
#collection-sync.d-none
.s-sidebarwidget
#collection-stats.s-sidebarwidget
.s-sidebarwidget--header Collection
.s-sidebarwidget--action
input(type="hidden" name="account" value=account)
@ -125,7 +152,7 @@ html
tr.s-sidebarwidget--item
th value
td
= `${count.displayCurrencySymbol}${count.value} `
= `${count.value} `
span.fc-black-400 #{count.displayCurrency}
tr.s-sidebarwidget--item
th diversity

View file

@ -28,5 +28,5 @@ block view
span.s-tag--sponsor!= icons.use("compact-disc", 16)
= item.total_duration
each preview in item.previews
a.d-flex(href=preview.item_url hx-get=`/api/play/${preview.item_type}/${preview.item_id}` hx-target="#player" hx-select="#player" hx-indicator="null" hx-push-url="false")
a.d-flex&attributes(getAlbumCoverAttributes(event, preview))
img(loading="lazy" src=preview.item_art_url width=210 height=210 style="height: auto; width: auto; max-height: 70px")