2021-07-20 12:54:19 +03:00
|
|
|
<KoenigCard
|
2021-07-28 14:25:21 +03:00
|
|
|
@icon={{"koenig/card-indicator-email"}}
|
2021-07-20 12:54:19 +03:00
|
|
|
@class={{concat (kg-style "container-card") " kg-email-card mih10 miw-100 relative"}}
|
2021-07-20 20:33:39 +03:00
|
|
|
@style={{@cardStyle}}
|
|
|
|
@headerOffset={{@headerOffset}}
|
2021-07-20 12:54:19 +03:00
|
|
|
@toolbar={{this.toolbar}}
|
2021-07-20 20:33:39 +03:00
|
|
|
@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}}
|
2021-08-24 12:12:52 +03:00
|
|
|
{{did-insert this.registerElement}}
|
2021-07-20 12:54:19 +03:00
|
|
|
as |card|
|
|
|
|
>
|
2021-07-20 20:33:39 +03:00
|
|
|
{{#if @isEditing}}
|
2021-08-02 16:24:17 +03:00
|
|
|
|
2021-07-28 14:25:21 +03:00
|
|
|
<div class="kg-card-help kg-card-help-labs">
|
|
|
|
<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 ember-power-select-inline-labs"
|
|
|
|
@dropdownClass="gh-member-segment-select-dropdown"
|
|
|
|
as |segment|
|
|
|
|
>
|
|
|
|
{{segment.name}}
|
|
|
|
</PowerSelect>
|
2021-07-29 16:56:14 +03:00
|
|
|
when delivered by email.
|
2021-07-28 14:25:21 +03:00
|
|
|
This card will not be published on your site.
|
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
</div>
|
2021-08-02 16:24:17 +03:00
|
|
|
|
2021-08-24 12:50:19 +03:00
|
|
|
{{#if @payload.showDividers}}<hr class="border-top edit-mode">{{/if}}
|
2021-08-23 17:22:56 +03:00
|
|
|
|
2021-08-24 19:53:34 +03:00
|
|
|
<div class="{{if (eq @payload.alignment "center") "tc"}}">
|
2021-08-23 16:04:11 +03:00
|
|
|
<KoenigTextReplacementHtmlInput
|
|
|
|
@html={{@payload.html}}
|
|
|
|
@placeholder="Email only text... (optional)"
|
|
|
|
@autofocus={{true}}
|
|
|
|
@class="miw-100 bn bg-transparent"
|
|
|
|
@onChange={{this.updateHtml}}
|
|
|
|
@onFocus={{fn (mut this.contentFocused) true}}
|
|
|
|
@onBlur={{fn (mut this.contentFocused) false}}
|
|
|
|
@didCreateEditor={{this.registerEditor}}
|
|
|
|
/>
|
2021-08-23 15:10:26 +03:00
|
|
|
|
2021-08-24 12:43:06 +03:00
|
|
|
{{#if @payload.showButton}}
|
|
|
|
<button type="button" class="gh-btn gh-btn-accent" disabled={{not @payload.buttonText}}>
|
|
|
|
{{#if @payload.buttonText}}
|
|
|
|
<span>{{@payload.buttonText}}</span>
|
|
|
|
{{else}}
|
|
|
|
<span>Add button text</span>
|
|
|
|
{{/if}}
|
|
|
|
</button>
|
|
|
|
{{/if}}
|
2021-08-23 16:04:11 +03:00
|
|
|
</div>
|
2021-08-23 15:10:26 +03:00
|
|
|
|
2021-08-24 12:50:19 +03:00
|
|
|
{{#if @payload.showDividers}}<hr class="border-bottom">{{/if}}
|
2021-08-23 17:22:56 +03:00
|
|
|
|
2021-08-23 15:10:26 +03:00
|
|
|
<form class="email-cta-toolbar">
|
2021-08-23 17:22:56 +03:00
|
|
|
<div class="borders">
|
2021-08-25 12:55:10 +03:00
|
|
|
<button type="button" title="Add dividers" class="gh-btn gh-btn-white gh-btn-icon email-cta-toolbar-item {{if @payload.showDividers "fill-green-d1"}}" {{on "click" this.toggleDividers}}><span>{{svg-jar "dividers"}}</span></button>
|
2021-08-23 17:22:56 +03:00
|
|
|
</div>
|
|
|
|
|
2021-08-23 15:10:26 +03:00
|
|
|
<div class="gh-btn-group icons email-cta-align">
|
2021-08-24 19:53:34 +03:00
|
|
|
<button type="button" title="Left-align content" class="gh-btn gh-btn-icon {{if (eq @payload.alignment "left") "gh-btn-group-selected"}}" {{on "click" (fn this.setAlignment "left")}}><span>{{svg-jar "align-left"}}</span></button>
|
|
|
|
<button type="button" title="Center-align content" class="gh-btn gh-btn-icon {{if (eq @payload.alignment "center") "gh-btn-group-selected"}}" {{on "click" (fn this.setAlignment "center")}}><span>{{svg-jar "align-center"}}</span></button>
|
2021-08-23 15:10:26 +03:00
|
|
|
</div>
|
|
|
|
|
2021-08-25 12:55:10 +03:00
|
|
|
<button type="button" title="Add button" class="gh-btn gh-btn-white gh-btn-icon email-cta-toolbar-item {{if @payload.showButton "fill-green-d1"}}" {{on "click" this.toggleButton}}><span>{{svg-jar "button"}}</span></button>
|
2021-08-24 12:43:06 +03:00
|
|
|
|
|
|
|
{{#if @payload.showButton}}
|
2021-08-25 17:13:00 +03:00
|
|
|
<label for={{this.buttonTextInputId}} class="sr-only">CTA button text</label>
|
2021-08-24 12:43:06 +03:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
class="gh-input email-cta-button-text-input"
|
2021-08-25 17:13:00 +03:00
|
|
|
id={{this.buttonTextInputId}}
|
2021-08-24 12:43:06 +03:00
|
|
|
name="button-text"
|
|
|
|
value={{@payload.buttonText}}
|
|
|
|
placeholder={{if this.buttonFocused "" "Add button text"}}
|
|
|
|
{{on "input" this.setButtonText}}
|
|
|
|
{{on "focus" (fn (mut this.buttonFocused) true)}}
|
|
|
|
{{on "blur" (fn (mut this.buttonFocused) false)}}
|
|
|
|
{{on-key "Enter" (fn this.focusElement "#button-url-input")}}
|
|
|
|
>
|
|
|
|
|
2021-08-25 17:13:00 +03:00
|
|
|
<label for={{this.urlInputId}} class="sr-only">CTA URL</label>
|
2021-08-24 12:43:06 +03:00
|
|
|
<GhInputWithSelect
|
|
|
|
@value={{@payload.buttonUrl}}
|
|
|
|
@options={{this.suggestedUrls}}
|
|
|
|
@valueField="url"
|
|
|
|
@searchField="url"
|
|
|
|
@placeholder="https://yoursite.com/#/portal/signup/"
|
|
|
|
@searchMessage={{null}}
|
|
|
|
@onInput={{this.setButtonUrl}}
|
|
|
|
@openOnFocus={{true}}
|
|
|
|
@closeWhenEmpty={{true}}
|
|
|
|
@triggerClass="email-cta-button-url-input"
|
2021-08-25 17:13:00 +03:00
|
|
|
@triggerId={{this.urlInputId}}
|
2021-08-24 12:43:06 +03:00
|
|
|
@renderInPlace={{false}} {{!-- avoid dropdown inheriting editor styles --}}
|
|
|
|
as |suggestion|
|
|
|
|
>
|
|
|
|
<span class="db b">{{suggestion.name}}</span>
|
|
|
|
{{suggestion.url}}
|
|
|
|
</GhInputWithSelect>
|
|
|
|
{{/if}}
|
2021-07-26 19:00:11 +03:00
|
|
|
</form>
|
2021-07-20 12:54:19 +03:00
|
|
|
{{else}}
|
2021-07-28 14:25:21 +03:00
|
|
|
<div class="gh-email-cta-segment-indicator">
|
2021-07-28 14:47:58 +03:00
|
|
|
<p>{{capitalize this.selectedSegment.name}}</p>
|
|
|
|
</div>
|
2021-08-02 16:24:17 +03:00
|
|
|
|
2021-08-24 12:50:19 +03:00
|
|
|
{{#if @payload.showDividers}}<hr class="border-top">{{/if}}
|
2021-08-02 16:24:17 +03:00
|
|
|
|
2021-08-24 19:53:34 +03:00
|
|
|
<div class="{{if (not @payload.showDividers) "pb2"}} {{if (eq @payload.alignment "center") "tc"}}">
|
2021-08-23 16:04:11 +03:00
|
|
|
{{#if @payload.html}}
|
|
|
|
<div class="relative">
|
|
|
|
<p>{{{this.formattedHtml}}}</p>
|
|
|
|
<div class="koenig-card-click-overlay"></div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2021-08-02 17:01:15 +03:00
|
|
|
|
2021-08-24 13:44:53 +03:00
|
|
|
{{#if (and @payload.showButton @payload.buttonText @payload.buttonUrl)}}
|
2021-08-23 16:04:11 +03:00
|
|
|
<a class="gh-btn gh-btn-accent" href="javascript:void(0)" data-tooltip={{@payload.buttonUrl}}><span>{{@payload.buttonText}}</span></a>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2021-08-03 19:21:54 +03:00
|
|
|
|
2021-08-24 12:50:19 +03:00
|
|
|
{{#if @payload.showDividers}}<hr class="border-bottom">{{/if}}
|
2021-08-03 19:21:54 +03:00
|
|
|
|
2021-07-20 12:54:19 +03:00
|
|
|
{{/if}}
|
2021-08-02 16:24:17 +03:00
|
|
|
|
2021-08-03 19:21:54 +03:00
|
|
|
|
2021-07-20 12:54:19 +03:00
|
|
|
</KoenigCard>
|