2021-06-18 16:39:02 +03:00
|
|
|
{{#unless this.benefitItem.isNew}}
|
|
|
|
<span class="gh-blognav-grab">
|
|
|
|
{{svg-jar "grab"}}
|
|
|
|
<span class="sr-only">Reorder</span>
|
|
|
|
</span>
|
|
|
|
{{/unless}}
|
|
|
|
|
2021-09-02 17:01:25 +03:00
|
|
|
<div class="gh-blognav-line {{unless this.name "placeholder"}}">
|
|
|
|
{{svg-jar "check-2"}}
|
2022-12-08 20:04:20 +03:00
|
|
|
<span
|
|
|
|
class="gh-blognav-label"
|
|
|
|
{{validation-status errors=this.benefitItem.errors property="name" hasValidated=this.benefitItem.hasValidated}}
|
2021-06-18 16:39:02 +03:00
|
|
|
>
|
|
|
|
<GhTrimFocusInput
|
|
|
|
@shouldFocus={{this.benefitItem.last}}
|
2022-05-11 20:11:54 +03:00
|
|
|
@placeholder={{if this.isFreeTier "Access to all public posts" "Expert analysis"}}
|
2021-06-28 12:49:54 +03:00
|
|
|
@value={{readonly this.name}}
|
2021-06-18 16:39:02 +03:00
|
|
|
@input={{action "updateLabel" value="target.value"}}
|
|
|
|
@keyPress={{action "clearLabelErrors"}}
|
2021-08-20 11:49:50 +03:00
|
|
|
@stopEnterKeyDownPropagation={{true}}
|
2022-02-19 01:36:01 +03:00
|
|
|
@focus-out={{action "updateLabel" this.name}}
|
|
|
|
data-test-input="benefit-label" />
|
|
|
|
|
2021-06-18 16:39:02 +03:00
|
|
|
<GhErrorMessage
|
|
|
|
@errors={{this.benefitItem.errors}}
|
2022-02-19 01:36:01 +03:00
|
|
|
@property="name"
|
|
|
|
data-test-error="benefit-label" />
|
2022-12-08 20:04:20 +03:00
|
|
|
</span>
|
2021-06-18 16:39:02 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{{#if this.benefitItem.isNew}}
|
2022-02-19 01:36:01 +03:00
|
|
|
<button type="button" class="gh-blognav-add" {{action "addItem" this.benefitItem}} data-test-button="add-benefit">
|
2022-09-02 18:56:02 +03:00
|
|
|
{{svg-jar "plus"}}<span class="sr-only">Add</span>
|
2021-06-18 16:39:02 +03:00
|
|
|
</button>
|
|
|
|
{{else}}
|
2022-02-19 01:36:01 +03:00
|
|
|
<button type="button" class="gh-blognav-delete" {{action "deleteItem" this.benefitItem}} data-test-button="delete-benefit">
|
2021-06-18 16:39:02 +03:00
|
|
|
{{svg-jar "trash"}}<span class="sr-only">Delete</span>
|
|
|
|
</button>
|
2022-01-19 10:34:08 +03:00
|
|
|
{{/if}}
|