mirror of https://github.com/zulip/zulip.git
upgrade: Show user/month plurals based on their count.
This commit is contained in:
parent
b516ae75db
commit
2a70143050
|
@ -90,8 +90,10 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="due-today-license-count">{{ seat_count }}</span>
|
<span class="due-today-license-count">{{ seat_count }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
users x
|
<span class="due-today-license-count-user-plural">
|
||||||
<span class="due-today-duration"></span> month
|
{{ 'user' if seat_count == 1 else 'users' }}
|
||||||
|
</span> x
|
||||||
|
<span class="due-today-duration"></span>
|
||||||
<h1>$<span class="due-today-price"></span></h1>
|
<h1>$<span class="due-today-price"></span></h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -27,7 +27,7 @@ export const initialize = (): void => {
|
||||||
if (schedule === "monthly") {
|
if (schedule === "monthly") {
|
||||||
num_months = 1;
|
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);
|
const schedule_typed = helpers.schedule_schema.parse(schedule);
|
||||||
$(".due-today-price").text(
|
$(".due-today-price").text(
|
||||||
helpers.format_money(current_license_count * prices[schedule_typed]),
|
helpers.format_money(current_license_count * prices[schedule_typed]),
|
||||||
|
@ -59,6 +59,13 @@ export const initialize = (): void => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$("#due-today .due-today-license-count").text(license_count);
|
$("#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;
|
current_license_count = license_count;
|
||||||
update_due_today(selected_schedule);
|
update_due_today(selected_schedule);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue