ce0ffdd077
Co-authored-by: Mike Nomitch <mail@mikenomitch.com>
61 lines
1.1 KiB
Handlebars
61 lines
1.1 KiB
Handlebars
<form class="edit-policy" autocomplete="off" {{on "submit" this.save}}>
|
|
{{#if @policy.isNew }}
|
|
<label>
|
|
<span>
|
|
Policy Name
|
|
</span>
|
|
<Input
|
|
data-test-policy-name-input
|
|
@type="text"
|
|
@value={{@policy.name}}
|
|
class="input"
|
|
{{autofocus}}
|
|
/>
|
|
</label>
|
|
{{/if}}
|
|
|
|
<div class="boxed-section">
|
|
<div class="boxed-section-head">
|
|
Policy Definition
|
|
</div>
|
|
<div class="boxed-section-body is-full-bleed">
|
|
|
|
<div
|
|
class="policy-editor"
|
|
data-test-policy-editor
|
|
{{code-mirror
|
|
screenReaderLabel="Policy definition"
|
|
theme="hashi"
|
|
mode="ruby"
|
|
content=@policy.rules
|
|
onUpdate=this.updatePolicyRules
|
|
autofocus=(not @policy.isNew)
|
|
extraKeys=(hash Cmd-Enter=this.save)
|
|
}} />
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label>
|
|
<span>
|
|
Description (optional)
|
|
</span>
|
|
<Input
|
|
data-test-policy-description
|
|
@value={{@policy.description}}
|
|
class="input"
|
|
/>
|
|
</label>
|
|
</div>
|
|
|
|
<footer>
|
|
{{#if (can "update policy")}}
|
|
<button
|
|
class="button is-primary"
|
|
type="submit"
|
|
>
|
|
Save Policy
|
|
</button>
|
|
{{/if}}
|
|
</footer>
|
|
</form> |