mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Fixed incorrect member count and capitalisation in publish options for editors/authors
no issue - `{{format-number}}` was showing "0" when passed in an empty/nullish string when it should have been showing nothing - used `{{if-empty}}` to fix capitalisation when the member count is missing - previously attempted a CSS-only fix with `:first-letter` and `text-transform: uppercase` but that broke the layout in Safari
This commit is contained in:
parent
78418e3708
commit
89f089e439
@ -48,12 +48,14 @@
|
|||||||
{{format-number countFetcher.count}}
|
{{format-number countFetcher.count}}
|
||||||
|
|
||||||
{{!-- @recipientType = none/free/paid/all/specific --}}
|
{{!-- @recipientType = none/free/paid/all/specific --}}
|
||||||
{{if (not-eq @recipientType "all") @recipientType}}
|
{{#let (if (not-eq @recipientType "all") @recipientType) as |recipientType|}}
|
||||||
|
{{if (is-empty countFetcher.count) (capitalize recipientType) recipientType}}
|
||||||
|
{{/let}}
|
||||||
|
|
||||||
{{#if @publishOptions.onlyDefaultNewsletter}}
|
{{#if @publishOptions.onlyDefaultNewsletter}}
|
||||||
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
|
{{gh-pluralize countFetcher.count (if (is-empty countFetcher.count) "Subscriber" "subscriber") without-count=true}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
|
{{gh-pluralize countFetcher.count (if (is-empty countFetcher.count) "Subscriber" "subscriber") without-count=true}}
|
||||||
of <span class="gh-selected-newsletter">{{@publishOptions.newsletter.name}}</span>
|
of <span class="gh-selected-newsletter">{{@publishOptions.newsletter.name}}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/let}}
|
{{/let}}
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
import {helper} from '@ember/component/helper';
|
import {helper} from '@ember/component/helper';
|
||||||
|
|
||||||
export function formatNumber(number) {
|
export function formatNumber(number) {
|
||||||
|
if (number === '' || number === null || number === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return Number(number).toLocaleString();
|
return Number(number).toLocaleString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user