Ghost/ghost/admin/app/components/gh-publishmenu.hbs
Kevin Ansfield 09435ecf76 Co-located component template files
no issue

Keeps component JS backing files and template files in the same directory which avoids hunting across directories when working with components. Also lets you see all components when looking at one directory, whereas previously template-only or js-only components may not have been obvious without looking at both directories.

- ran [codemod](https://github.com/ember-codemods/ember-component-template-colocation-migrator/) for app-level components
- manually moved in-repo-addon component templates in `lib/koenig-editor`
- removed all explicit `layout` imports as JS/template associations are now made at build-time removing the need for them
- updated `.embercli` to default to new flat component structure
2020-05-18 13:14:08 +01:00

69 lines
2.8 KiB
Handlebars

<BasicDropdown @verticalPosition="below" @onOpen={{action "open"}} @onClose={{action "close"}} as |dd|>
<dd.Trigger class="gh-btn gh-btn-outline gh-publishmenu-trigger">
<span data-test-publishmenu-trigger>{{this.triggerText}} {{svg-jar "arrow-down"}}</span>
</dd.Trigger>
<dd.Content class="gh-publishmenu-dropdown">
{{#if (eq this.displayState "published")}}
<GhPublishmenuPublished
@post={{this.post}}
@saveType={{this.saveType}}
@setSaveType={{action "setSaveType"}}
@backgroundTask={{this.backgroundTask}} />
{{else if (eq this.displayState "scheduled")}}
<GhPublishmenuScheduled
@post={{this.post}}
@saveType={{this.saveType}}
@isClosing={{this.isClosing}}
@memberCount={{this.memberCount}}
@setSaveType={{action "setSaveType"}}
@setTypedDateError={{action (mut this.typedDateError)}} />
{{else}}
<GhPublishmenuDraft
@post={{this.post}}
@saveType={{this.saveType}}
@setSaveType={{action "setSaveType"}}
@setTypedDateError={{action (mut this.typedDateError)}}
@backgroundTask={{this.backgroundTask}}
@memberCount={{this.memberCount}}
@sendEmailWhenPublished={{this.sendEmailWhenPublished}} />
{{/if}}
{{!--
save button needs to be outside of menu components so it doesn't lose state
or cancel the task when the post status updates and switches components
--}}
<footer class="gh-publishmenu-footer">
<button class="gh-btn gh-btn-outline gh-btn-link" {{on "click" (action dd.actions.close)}} data-test-publishmenu-cancel>
<span>Cancel</span>
</button>
<GhTaskButton
@buttonText={{this.buttonText}}
@task={{this.save}}
@taskArgs={{hash dropdown=dd}}
@successText={{this.successText}}
@runningText={{this.runningText}}
@autoReset={{true}}
@class="gh-btn gh-btn-blue gh-publishmenu-button gh-btn-icon"
data-test-publishmenu-save=true
/>
</footer>
</dd.Content>
</BasicDropdown>
{{#if this.showEmailConfirmationModal}}
<GhFullscreenModal
@modal="confirm-email-send"
@model={{hash
memberCount=this.memberCount
isScheduled=(eq this.saveType "schedule")
paidOnly=(eq this.post.visibility "paid")
retryEmailSend=this.retryEmailSend
}}
@confirm={{this.confirmEmailSend}}
@close={{this.closeEmailConfirmationModal}}
@modifier="action wide"
/>
{{/if}}