From dd04b655b8def2e32ecad63955d5e591db3771c0 Mon Sep 17 00:00:00 2001 From: Padreug Date: Thu, 10 Sep 2026 12:19:44 +0200 Subject: [PATCH] feat(admin): max uses column + used count in the promo editor The Quasar editor gains a "Max uses" input per code (blank = unlimited, normalised to null on save) and shows "Used n / max" from the derived count. The public buy page's Clear button now also clears the promo field. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01ByAwHU4pRnyE58YocQvAas --- static/js/display.js | 1 + static/js/index.js | 4 +++- static/js/index.vue | 30 +++++++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/static/js/display.js b/static/js/display.js index ad7e358..f687512 100644 --- a/static/js/display.js +++ b/static/js/display.js @@ -94,6 +94,7 @@ window.PageEventsDisplay = { this.formDialog.data.email = '' this.formDialog.data.refund = '' this.formDialog.data.nostr_identifier = '' + this.formDialog.data.promo_code = '' this.formDialog.data.payment_method = this.paymentMethods[0] || 'lightning' }, diff --git a/static/js/index.js b/static/js/index.js index 646b37b..0e8b7fa 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -411,7 +411,9 @@ window.PageEvents = { .filter(code => code.code?.trim() !== '') .map(code => ({ ...code, - code: code.code.trim().toUpperCase() + code: code.code.trim().toUpperCase(), + // blank / 0 = unlimited; used_count is derived server-side + max_uses: code.max_uses ? Number(code.max_uses) : null })) } const methods = data.extra?.payment_methods || [] diff --git a/static/js/index.vue b/static/js/index.vue index 502d9ad..a5b39e3 100644 --- a/static/js/index.vue +++ b/static/js/index.vue @@ -671,12 +671,22 @@ class="row q-col-gutter-sm q-mt-md" >