From 9e9d669c5c3a3153fe42e7791374970a2e7fbdaa Mon Sep 17 00:00:00 2001 From: ithiame Date: Wed, 4 Dec 2024 11:20:41 +0000 Subject: [PATCH 1/5] CB qr-code payment has lightning: in its href #1620 --- src/routes/(app)/order/[id]/+page.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/routes/(app)/order/[id]/+page.svelte b/src/routes/(app)/order/[id]/+page.svelte index b65ae0b12..ce72fb343 100644 --- a/src/routes/(app)/order/[id]/+page.svelte +++ b/src/routes/(app)/order/[id]/+page.svelte @@ -279,7 +279,7 @@ {/if} {#if payment.status === 'pending'} - {#if payment.method === 'lightning' || payment.method === 'card'} + {#if payment.method === 'lightning'} {/if} + {#if payment.method === 'card'} + QR code + {/if} {#if payment.method === 'bitcoin' && payment.address} {t('order.clickQR')} Date: Wed, 4 Dec 2024 15:13:01 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=20=F0=9F=A6=8B=20Allow=20admin=20to=20set?= =?UTF-8?q?=20a=20QR-code-less=20order=20on=20their=20be-BOP=20#1621?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.css | 4 ++++ src/lib/server/runtime-config.ts | 2 ++ src/lib/server/theme.ts | 5 +++++ src/lib/types/Theme.ts | 9 +++++++++ .../config/+page.server.ts | 8 ++++++-- .../config/+page.svelte | 18 ++++++++++++++++++ src/routes/(app)/order/[id]/+page.server.ts | 5 ++++- src/routes/(app)/order/[id]/+page.svelte | 4 +++- 8 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/app.css b/src/app.css index e43f3ee3f..fd7b8ccc0 100644 --- a/src/app.css +++ b/src/app.css @@ -46,6 +46,7 @@ --tagWidget-cta-color: #ffffff; --tagWidget-color: #000000; --tagWidget-hyperlink-color: #2271b1; + --order-creditCard-svg-color: #2271b1; } @layer base { @@ -298,6 +299,9 @@ --tw-prose-bold: inherit; --tw-prose-links: var(--body-hyperlink-color); } + .credit-card-svg-fill { + color: var(--order-creditCard-svg-color); + } } @layer utilities { diff --git a/src/lib/server/runtime-config.ts b/src/lib/server/runtime-config.ts index d6eed6249..4e5670b60 100644 --- a/src/lib/server/runtime-config.ts +++ b/src/lib/server/runtime-config.ts @@ -181,6 +181,8 @@ const baseConfig = { ], contactModes: ['email', 'nostr'], posTouchTag: [] as Tag['_id'][], + hideCbQrCode: false, + overwriteCbSvgColor: false, hideCmsZonesOnMobile: false, copyOrderEmailsToAdmin: true, usersDarkDefaultTheme: false, diff --git a/src/lib/server/theme.ts b/src/lib/server/theme.ts index e30b8d356..f89461c0b 100644 --- a/src/lib/server/theme.ts +++ b/src/lib/server/theme.ts @@ -102,6 +102,11 @@ export const themeValidator = z.object({ cancel: z.object({ backgroundColor }), delete: z.object({ backgroundColor }) }) + }), + order: z.object({ + creditCard: z.object({ + svg: z.object({ color }) + }) }) }); diff --git a/src/lib/types/Theme.ts b/src/lib/types/Theme.ts index bbca9f22e..3d30cd962 100644 --- a/src/lib/types/Theme.ts +++ b/src/lib/types/Theme.ts @@ -242,6 +242,15 @@ export const themeFormStructure = { name: 'action.delete.backgroundColor' } ] + }, + order: { + label: 'Order', + elements: [ + { + label: 'Credit card svg fill color', + name: 'creditCard.svg.color' + } + ] } } satisfies { [key in keyof Omit]: { diff --git a/src/routes/(app)/admin[[hash=admin_hash]]/config/+page.server.ts b/src/routes/(app)/admin[[hash=admin_hash]]/config/+page.server.ts index fea00ed52..871aaa46b 100644 --- a/src/routes/(app)/admin[[hash=admin_hash]]/config/+page.server.ts +++ b/src/routes/(app)/admin[[hash=admin_hash]]/config/+page.server.ts @@ -35,7 +35,9 @@ export async function load(event) { copyOrderEmailsToAdmin: runtimeConfig.copyOrderEmailsToAdmin, disableLanguageSelector: runtimeConfig.disableLanguageSelector, defaultOnLocation: runtimeConfig.defaultOnLocation, - cartPreviewInteractive: runtimeConfig.cartPreviewInteractive + cartPreviewInteractive: runtimeConfig.cartPreviewInteractive, + overwriteCbSvgColor: runtimeConfig.overwriteCbSvgColor, + hideCbQrCode: runtimeConfig.hideCbQrCode }; } @@ -90,7 +92,9 @@ export const actions = { cartMaxSeparateItems: z.number({ coerce: true }).int().default(0), disableLanguageSelector: z.boolean({ coerce: true }), contactModes: z.string().array(), - cartPreviewInteractive: z.boolean({ coerce: true }) + cartPreviewInteractive: z.boolean({ coerce: true }), + hideCbQrCode: z.boolean({ coerce: true }), + overwriteCbSvgColor: z.boolean({ coerce: true }) }) .parse({ ...Object.fromEntries(formData), diff --git a/src/routes/(app)/admin[[hash=admin_hash]]/config/+page.svelte b/src/routes/(app)/admin[[hash=admin_hash]]/config/+page.svelte index a9187aec1..b52cecca9 100644 --- a/src/routes/(app)/admin[[hash=admin_hash]]/config/+page.svelte +++ b/src/routes/(app)/admin[[hash=admin_hash]]/config/+page.svelte @@ -218,6 +218,24 @@ /> {/if} +

Order

+ + +

+ Target color can be changed in theme("Order" then + "Credit card svg fill color" in theme) +

VAT