0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Display real member count in publish menu

This commit is contained in:
Kevin Ansfield 2019-11-04 16:44:18 +07:00
parent 56cfbf2cd2
commit d77b059716
4 changed files with 9 additions and 4 deletions

View file

@ -3,10 +3,10 @@ import PostModel from 'ghost-admin/models/post';
import boundOneWay from 'ghost-admin/utils/bound-one-way'; import boundOneWay from 'ghost-admin/utils/bound-one-way';
import config from 'ghost-admin/config/environment'; import config from 'ghost-admin/config/environment';
import isNumber from 'ghost-admin/utils/isNumber'; import isNumber from 'ghost-admin/utils/isNumber';
import moment from 'moment';
import {alias, mapBy} from '@ember/object/computed'; import {alias, mapBy} from '@ember/object/computed';
import {computed} from '@ember/object'; import {computed} from '@ember/object';
import {inject as controller} from '@ember/controller'; import {inject as controller} from '@ember/controller';
import {get} from '@ember/object';
import {htmlSafe} from '@ember/string'; import {htmlSafe} from '@ember/string';
import {isBlank} from '@ember/utils'; import {isBlank} from '@ember/utils';
import {isArray as isEmberArray} from '@ember/array'; import {isArray as isEmberArray} from '@ember/array';
@ -543,6 +543,9 @@ export default Controller.extend({
limit: 'all' limit: 'all'
}); });
this.set('actionsList', actions); this.set('actionsList', actions);
let membersResponse = yield this.store.query('member', {limit: 1});
this.set('memberCount', get(membersResponse, 'meta.pagination.total'));
}).restartable(), }).restartable(),
/* Public methods --------------------------------------------------------*/ /* Public methods --------------------------------------------------------*/

View file

@ -46,7 +46,7 @@
</div> </div>
<div class="flex-grow-1"> <div class="flex-grow-1">
<div class="gh-publishmenu-radio-label">Email post</div> <div class="gh-publishmenu-radio-label">Email post</div>
<div class="gh-publishmenu-radio-desc">Send post to 56 members when published</div> <div class="gh-publishmenu-radio-desc">Send post to {{this.memberCount}} members when published</div>
</div> </div>
{{/if}} {{/if}}
{{/if}} {{/if}}

View file

@ -23,7 +23,8 @@
saveType=saveType saveType=saveType
setSaveType=(action "setSaveType") setSaveType=(action "setSaveType")
backgroundTask=this.backgroundTask backgroundTask=this.backgroundTask
deliveredAction=this.deliveredAction}} deliveredAction=this.deliveredAction
memberCount=this.memberCount}}
{{/if}} {{/if}}
{{!-- {{!--

View file

@ -57,7 +57,8 @@
setSaveType=(action "setSaveType") setSaveType=(action "setSaveType")
onOpen=(action "cancelAutosave") onOpen=(action "cancelAutosave")
backgroundTask=this.backgroundLoader backgroundTask=this.backgroundLoader
deliveredAction=this.deliveredAction}} deliveredAction=this.deliveredAction
memberCount=this.memberCount}}
{{/if}} {{/if}}
{{/unless}} {{/unless}}