0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-25 02:31:59 -05:00

Fixed recipient select becoming disabled when all filters are turned off

no issue

- `publishOptions.willEmail` doesn't work for the conditional because it will be false when no email will be sent, which is the case when a recipient filter is the equivalent of "none"
- switched to being conditional on the publish type and added a separate "Not sent to any members" conditional for `recipientFilter` being blank so we're not showing an incorrect count of members
This commit is contained in:
Kevin Ansfield 2022-05-12 13:19:12 +01:00
parent f3e35bb164
commit 2e6b219030

View file

@ -31,7 +31,7 @@
{{#unless @publishOptions.emailUnavailable}}
<div class="gh-publish-setting">
{{#if @publishOptions.willEmail}}
{{#if (not-eq @publishOptions.publishType "publish")}}
<button
type="button"
class="gh-publish-setting-title"
@ -39,23 +39,27 @@
>
{{svg-jar "member"}}
<div class="gh-publish-setting-trigger">
{{#let (members-count-fetcher query=(hash filter=@publishOptions.fullRecipientFilter)) as |countFetcher|}}
{{#if (gt countFetcher.count 1)}}
{{if (eq @recipientType "all") "All"}}
{{/if}}
{{#if @publishOptions.recipientFilter}}
{{#let (members-count-fetcher query=(hash filter=@publishOptions.fullRecipientFilter)) as |countFetcher|}}
{{#if (gt countFetcher.count 1)}}
{{if (eq @recipientType "all") "All"}}
{{/if}}
{{countFetcher.count}}
{{countFetcher.count}}
{{!-- @recipientType = none/free/paid/all/specific --}}
{{if (not-eq @recipientType "all") @recipientType}}
{{!-- @recipientType = none/free/paid/all/specific --}}
{{if (not-eq @recipientType "all") @recipientType}}
{{#if @publishOptions.onlyDefaultNewsletter}}
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
{{else}}
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
of <span class="gh-selected-newsletter">{{@publishOptions.newsletter.name}}</span>
{{/if}}
{{/let}}
{{#if @publishOptions.onlyDefaultNewsletter}}
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
{{else}}
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
of <span class="gh-selected-newsletter">{{@publishOptions.newsletter.name}}</span>
{{/if}}
{{/let}}
{{else}}
Not sent as newsletter
{{/if}}
</div>
<span class="{{if (eq this.openSection "emailRecipients") "expanded"}}">
{{svg-jar "arrow-down" class="icon-expand"}}