From 07519bec1bebc2f68b4bce4a8a0b7755bee605e1 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 3de0898..962203a 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -526,7 +526,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 6e7ec28..d53f4c8 100644 --- a/static/js/index.vue +++ b/static/js/index.vue @@ -729,12 +729,22 @@ class="row q-col-gutter-sm q-mt-md" >