Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
upgrade: Show user/month plurals based on their count.
Aman Agrawal2a70143050f2
diff --git a/templates/corporate/upgrade.html b/templates/corporate/upgrade.htmlindex e51bfee73aa..88c97e74faf 100644--- a/templates/corporate/upgrade.html+++ b/templates/corporate/upgrade.html@@ -90,8 +90,10 @@{% else %}<span class="due-today-license-count">{{ seat_count }}</span>{% endif %}- users x- <span class="due-today-duration"></span> month+ <span class="due-today-license-count-user-plural">+ {{ 'user' if seat_count == 1 else 'users' }}+ </span> x+ <span class="due-today-duration"></span><h1>$<span class="due-today-price"></span></h1></div></div>diff --git a/web/src/billing/upgrade.ts b/web/src/billing/upgrade.tsindex 7951cc8c075..55faff44aba 100644--- a/web/src/billing/upgrade.ts+++ b/web/src/billing/upgrade.ts@@ -27,7 +27,7 @@ export const initialize = (): void => {if (schedule === "monthly") {num_months = 1;}- $("#due-today .due-today-duration").text(num_months);+ $("#due-today .due-today-duration").text(num_months === 1 ? "1 month" : "12 months");const schedule_typed = helpers.schedule_schema.parse(schedule);$(".due-today-price").text(helpers.format_money(current_license_count * prices[schedule_typed]),@@ -59,6 +59,13 @@ export const initialize = (): void => {return;}$("#due-today .due-today-license-count").text(license_count);+ const $user_plural = $("#due-today .due-today-license-count-user-plural");+ if (license_count === 1) {+ $user_plural.text("user");+ } else {+ $user_plural.text("users");+ }+current_license_count = license_count;update_due_today(selected_schedule);});