Ghost/ghost/admin/app/components/modal-members-label-form.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

77 lines
2.9 KiB
Handlebars

{{#if this.showDeleteLabelModal}}
<header class="modal-header">
<h1>Are you sure you want to delete this label?</h1>
</header>
<a class="close" href="" title="Close" {{action "closeModal"}}>{{svg-jar "close"}}<span class="hidden">Close</span></a>
<div class="modal-body">
<p>
You're about to delete label "<strong>{{this.label.name}}</strong>". This is permanent! We warned you, k?
</p>
</div>
<div class="modal-footer">
<button {{action "closeModal"}} class="gh-btn"><span>Cancel</span></button>
<GhTaskButton @buttonText="Delete" @successText="Deleted" @task={{this.deleteLabel}} @class="gh-btn gh-btn-red gh-btn-icon" />
</div>
{{else}}
<header class="modal-header" data-test-modal="label-form">
<h1>{{if this.label.isNew "New label" "Edit label"}}</h1>
</header>
{{!-- disable mouseDown so it doesn't trigger focus-out validations --}}
<button class="close" href title="Close" {{action "closeModal"}} {{action (optional this.noop) on="mouseDown"}}>
{{svg-jar "close"}}
</button>
<div class="modal-body">
<fieldset>
<GhFormGroup @errors={{this.label.errors}} @hasValidated={{this.label.hasValidated}} @property="name">
<label for="label-name" class="fw6 dib">Label name</label>
<GhTextInput
@id="label-name"
@value={{this.label.name}}
@focus-out={{action "validate" "name" target=this.label}}
data-test-input="label-name"
/>
{{#if this.label.errors}}
<GhErrorMessage @errors={{this.label.errors}} @property="name" data-test-error="label-name" />
{{/if}}
</GhFormGroup>
</fieldset>
</div>
<div class="modal-footer">
{{#if this.label.isNew}}
<button
class="gh-btn"
{{action "closeModal"}}
{{!-- disable mouseDown so it doesn't trigger focus-out validations --}}
{{action (optional this.noop) on="mouseDown"}}
data-test-button="cancel-label-form"
>
<span>Cancel</span>
</button>
{{else}}
<button
class="gh-btn gh-btn-red gh-btn-icon"
{{on "click" (action "toggleDeleteLabelModal")}}
{{on "mousedown" (optional this.noop)}}
data-test-button="delete-label"
>
<span>{{svg-jar "trash"}} Delete</span>
</button
>
{{/if}}
<GhTaskButton
@buttonText="Save"
@runningText="Saving..."
@successText="Saved"
@autoReset={{true}}
@task={{this.saveTask}}
@taskArgs={{this.label}}
@class="gh-btn gh-btn-green gh-btn-icon"
data-test-button="save-label" />
</div>
{{/if}}