mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Disabled email toggle in publish menu if no members
This commit is contained in:
parent
6b4c430985
commit
6d0f8984af
2 changed files with 9 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
import Component from '@ember/component';
|
||||
import moment from 'moment';
|
||||
import {computed} from '@ember/object';
|
||||
import {isEmpty} from '@ember/utils';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
|
@ -15,6 +16,8 @@ export default Component.extend({
|
|||
|
||||
'data-test-publishmenu-draft': true,
|
||||
|
||||
disableEmailOption: computed.equal('memberCount', 0),
|
||||
|
||||
didInsertElement() {
|
||||
this.post.set('publishedAtBlogTZ', this.get('post.publishedAtUTC'));
|
||||
this.send('setSaveType', 'publish');
|
||||
|
|
|
@ -32,13 +32,17 @@
|
|||
{{#unless this.deliveredAction}}
|
||||
<div class="for-checkbox">
|
||||
<label class="checkbox" for="email-when-published-checkbox">
|
||||
<Input @checked={{this.sendEmailWhenPublished}} @type="checkbox" @id="email-when-published-checkbox" @name="email-when-published" />
|
||||
<Input @checked={{this.sendEmailWhenPublished}} @type="checkbox" @id="email-when-published-checkbox" @name="email-when-published" @disabled={{disableEmailOption}} />
|
||||
<span class="input-toggle-component gh-publishmenu-email-checkbox"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="gh-publishmenu-email-label">
|
||||
<div class="gh-publishmenu-radio-label">Email post</div>
|
||||
{{#if this.memberCount}}
|
||||
<div class="gh-publishmenu-radio-desc">Send post to {{this.memberCount}} members when published</div>
|
||||
{{else}}
|
||||
<div class="gh-publishmenu-radio-desc">You have 0 members</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
|
|
Loading…
Add table
Reference in a new issue