mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
09435ecf76
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
80 lines
2.9 KiB
Handlebars
80 lines
2.9 KiB
Handlebars
<header class="modal-header" data-test-modal="custom-view-form">
|
|
<h1>{{if this.model.isNew "New view" "Edit view"}}</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.model.errors}} @hasValidated={{this.model.hasValidated}} @property="name">
|
|
<label for="view-name" class="dib fw6">View name</label>
|
|
<GhTextInput
|
|
@id="view-name"
|
|
@value={{this.model.name}}
|
|
@placeholder="Breaking news"
|
|
@focus-out={{action "validate" "name" target=this.model}}
|
|
data-test-input="custom-view-name"
|
|
/>
|
|
{{#if this.model.errors}}
|
|
<GhErrorMessage @errors={{this.model.errors}} @property="name" data-test-error="custom-view-name" />
|
|
{{else}}
|
|
{{#if this.model.isNew}}
|
|
<p>Saved views appear in the app sidebar.</p>
|
|
{{/if}}
|
|
{{/if}}
|
|
</GhFormGroup>
|
|
</fieldset>
|
|
<div>
|
|
<label for="view-name" class="dib fw6">Icon color</label>
|
|
<div class="flex justify-between mt3 nl1">
|
|
{{#each this.customViews.availableColors as |color|}}
|
|
<div class="gh-radio-color">
|
|
<input
|
|
type="radio"
|
|
name="view-color"
|
|
id="view-{{color}}"
|
|
checked={{eq color this.delayedModelColor}}
|
|
value={{color}}
|
|
{{on "change" (action 'changeColor')}}
|
|
>
|
|
<label for="view-{{color}}"><span class="gh-radio-color-{{color}}"></span></label>
|
|
</div>
|
|
{{/each}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
{{#if this.model.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-custom-view-form"
|
|
>
|
|
<span>Cancel</span>
|
|
</button>
|
|
{{else}}
|
|
<button
|
|
class="gh-btn gh-btn-red gh-btn-icon"
|
|
{{on "click" (perform this.deleteTask)}}
|
|
{{on "mousedown" (optional this.noop)}}
|
|
data-test-button="delete-custom-view"
|
|
>
|
|
<span>{{svg-jar "trash"}} Delete</span>
|
|
</button
|
|
>
|
|
{{/if}}
|
|
|
|
<GhTaskButton
|
|
@buttonText="Save"
|
|
@successText="Saved"
|
|
@autoReset={{true}}
|
|
@task={{this.saveTask}}
|
|
@taskArgs={{this.model}}
|
|
@class="gh-btn gh-btn-green gh-btn-icon"
|
|
data-test-button="save-custom-view" />
|
|
</div> |