From aebfffa0452e5c3e16699848355e486b709973e4 Mon Sep 17 00:00:00 2001 From: Jaimyn Mayer Date: Sun, 16 Jun 2024 23:25:51 +1000 Subject: [PATCH] Fixed inconsistent translations/plurals and billing tab UI improvement --- memberportal/api_admin_tools/models.py | 2 +- memberportal/profile/models.py | 2 +- src-frontend/src/components/AccessList.vue | 4 +- .../components/AdminTools/ManageMember.vue | 322 ++++++++++++------ .../src/components/AdminTools/MembersList.vue | 17 +- .../src/components/Billing/PlanCard.vue | 4 +- .../src/components/Billing/SelectTier.vue | 6 +- .../src/components/Billing/TierCard.vue | 4 +- src-frontend/src/i18n/en-AU/index.ts | 76 +++-- src-frontend/src/pages/AdminTools/Devices.vue | 6 +- 10 files changed, 283 insertions(+), 160 deletions(-) diff --git a/memberportal/api_admin_tools/models.py b/memberportal/api_admin_tools/models.py index 15df9b84..d47331df 100644 --- a/memberportal/api_admin_tools/models.py +++ b/memberportal/api_admin_tools/models.py @@ -35,7 +35,7 @@ def get_object(self): class PaymentPlan(ExportModelOperationsMixin("payment-plan"), models.Model): """A Membership Plan that specifies how a member is billed for a member tier.""" - BILLING_PERIODS = [("Months", "month"), ("Weeks", "week"), ("Days", "days")] + BILLING_PERIODS = [("Month", "month"), ("Week", "week"), ("Day", "day")] id = models.AutoField(primary_key=True) name = models.CharField("Name", max_length=50) diff --git a/memberportal/profile/models.py b/memberportal/profile/models.py index fee4edb1..8b852ada 100644 --- a/memberportal/profile/models.py +++ b/memberportal/profile/models.py @@ -526,7 +526,7 @@ def get_basic_profile(self): "full": self.get_full_name(), }, "phone": self.phone, - "state": self.get_state_display(), + "state": self.state, "vehicleRegistrationPlate": self.vehicle_registration_plate, "rfid": self.rfid, "memberBucks": { diff --git a/src-frontend/src/components/AccessList.vue b/src-frontend/src/components/AccessList.vue index f5867bed..5b32da17 100644 --- a/src-frontend/src/components/AccessList.vue +++ b/src-frontend/src/components/AccessList.vue @@ -14,7 +14,7 @@
- {{ $t('access.doors') }} + {{ $tc('access.door', 2) }}
@@ -65,7 +65,7 @@ - {{ $t('access.interlocks') }} + {{ $tc('access.interlock', 2) }} diff --git a/src-frontend/src/components/AdminTools/ManageMember.vue b/src-frontend/src/components/AdminTools/ManageMember.vue index 29a69084..0c7c9a20 100644 --- a/src-frontend/src/components/AdminTools/ManageMember.vue +++ b/src-frontend/src/components/AdminTools/ManageMember.vue @@ -31,7 +31,7 @@ :class="{ 'q-px-sm': $q.screen.xs, 'q-px-lg': !$q.screen.xs }" > - {{ $t('adminTools.sendSms') }} + {{ $t('adminTools.sendSms') }} @@ -278,11 +277,18 @@ - {{ selectedMember.state }} + {{ + $t( + `adminTools.memberStatusString.${selectedMember.state}` + ) + }} @@ -412,7 +418,7 @@ @@ -878,23 +884,79 @@ -
-
+
+
{{ $t('adminTools.subscriptionInfo') }}
+ + + + + {{ $t(`adminTools.billingCycleAnchor`) }} + + {{ $t(`adminTools.startDate`) }} + + {{ $t(`adminTools.currentPeriodEnd`) }} + + + {{ $t(`adminTools.cancelAt`) }} + + + {{ $t(`adminTools.cancelAtPeriodEnd`) }} + + + + + + + {{ formatDate(billing.subscription.billingCycleAnchor) }} + + + {{ formatDate(billing.subscription.startDate) }} + + + {{ formatDate(billing.subscription.currentPeriodEnd) }} + + + {{ formatDate(billing.subscription.cancelAt) }} + + + {{ formatDate(billing.subscription.cancelAtPeriodEnd) }} + + + + + - - {{ billing.subscription.status }} + + {{ + $t( + `adminTools.subscriptionStatusString.${billing.subscription.status}` + ) + }} {{ $t(`adminTools.subscriptionStatus`) }} @@ -935,7 +997,7 @@ - + {{ formatDate(billing.subscription.cancelAt) }} @@ -946,7 +1008,7 @@ - + {{ billing.subscription.cancelAtPeriodEnd }} @@ -968,11 +1030,59 @@ {{ $t('adminTools.billingInfo') }}
+ + + + + {{ $t(`memberbucks.lastPurchase`) }} + + + {{ $t(`memberbucks.cardExpiry`) }} + + {{ $t(`memberbucks.last4`) }} + + + + + +
+ {{ this.formatWhen(billing?.memberbucks.lastPurchase) }} + + {{ + this.formatDate(billing?.memberbucks.lastPurchase) + }} + +
+
+ {{ $t('error.noValue') }} +
+ + + {{ + billing?.memberbucks.stripe_card_expiry || + $t('error.noValue') + }} + + + {{ + billing?.memberbucks.stripe_card_last_digits || + $t('error.noValue') + }} + + + +
+ @@ -1024,95 +1134,99 @@
-
- -
-
- {{ $t('adminTools.memberbucksTransactions') }} -
- - -