Ghost/ghost/admin/lib/koenig-editor/addon/components/koenig-card-email-cta.hbs

68 lines
2.4 KiB
Handlebars
Raw Normal View History

<KoenigCard
@icon="koenig/card-indicator-email"
@class={{concat (kg-style "container-card") " kg-email-card mih10 miw-100 relative"}}
@style={{@cardStyle}}
@headerOffset={{@headerOffset}}
@toolbar={{this.toolbar}}
@payload={{@payload}}
@isSelected={{@isSelected}}
@isEditing={{@isEditing}}
@selectCard={{@selectCard}}
@deselectCard={{@deselectCard}}
@editCard={{@editCard}}
@saveCard={{@saveCard}}
@saveAsSnippet={{@saveAsSnippet}}
@onLeaveEdit={{this.leaveEditMode}}
@addParagraphAfterCard={{@addParagraphAfterCard}}
@moveCursorToPrevSection={{@moveCursorToPrevSection}}
@moveCursorToNextSection={{@moveCursorToNextSection}}
@editor={{@editor}}
as |card|
>
{{#if @isEditing}}
<KoenigTextReplacementHtmlInput
@html={{@payload.html}}
@placeholder="Email only content..."
@autofocus={{true}}
@class="miw-100 bn bg-transparent"
@onChange={{this.updateHtml}}
@onFocus={{fn (mut this.isFocused) true}}
@onBlur={{fn (mut this.isFocused) false}}
@didCreateEditor={{this.registerEditor}}
/>
<div class="kg-card-help">
<p>
<span>
Only visible to
<PowerSelect
@options={{this.segments}}
@selected={{this.selectedSegment}}
@onChange={{this.setSegment}}
@searchEnabled={{false}}
@triggerComponent="gh-power-select/trigger"
@triggerClass="ember-power-select-inline"
as |segment|
>
{{segment.name}}
</PowerSelect>
when delievered by email.
</span>
<br>
<span>This card will not be published on your site.</span>
</p>
</div>
{{else}}
<p>{{{this.formattedHtml}}}</p>
<div class="kg-card-help">
<p>
<span>
Only visible to <strong>{{this.selectedSegment.name}}</strong> when delievered by email.
</span>
<br>
<span>This card will not be published on your site.</span>
</p>
</div>
<div class="koenig-card-click-overlay"></div>
{{/if}}
</KoenigCard>