Skip to content

Commit 4ca47c1

Browse files
committed
wired up to real warning status
1 parent ae6fb0c commit 4ca47c1

File tree

2 files changed

+31
-22
lines changed

2 files changed

+31
-22
lines changed
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
{{#if this.isEnabled}}
2-
{{! Watch for post.updatedAt changes to trigger recalculation after saves }}
3-
<span {{did-update this.checkEmailSize @post.updatedAtUTC}} class="gh-editor-email-size-warning-container">
4-
<span class="gh-editor-email-size-warning gh-editor-email-size-warning--{{this.warningLevel}}" data-warning-active={{if this.warningLevel "true" "false"}}>
2+
{{#if (has-block)}}
3+
<div {{did-update this.checkEmailSize @post.updatedAtUTC}}>
4+
{{yield this.warningLevel this.emailSizeKb}}
5+
</div>
6+
{{else}}
7+
<span {{did-update this.checkEmailSize @post.updatedAtUTC}} class="gh-editor-email-size-warning-container">
8+
<span class="gh-editor-email-size-warning gh-editor-email-size-warning--{{this.warningLevel}}" data-warning-active={{if this.warningLevel "true" "false"}}>
9+
{{#if this.warningLevel}}
10+
<span class="{{concat "gh-editor-email-warning-icon-" this.warningLevel}}">
11+
{{svg-jar "email-warning"}}
12+
</span>
13+
{{/if}}
14+
</span>
515
{{#if this.warningLevel}}
6-
<span class="{{concat "gh-editor-email-warning-icon-" this.warningLevel}}">
7-
{{svg-jar "email-warning"}}
8-
</span>
16+
<div class="gh-editor-email-size-popup">
17+
<div class="gh-editor-email-size-popup-title">Looks like this is a long post</div>
18+
<div class="gh-editor-email-size-popup-text">Email newsletters may get cut off in the inbox behind a "View entire message" link when they're over 100kB.</div>
19+
<div class="gh-editor-email-size-popup-used">You've used: <span class={{this.warningLevel}}>{{this.emailSizeKb}}kB</span></div>
20+
</div>
921
{{/if}}
1022
</span>
11-
{{#if this.warningLevel}}
12-
<div class="gh-editor-email-size-popup">
13-
<div class="gh-editor-email-size-popup-title">Looks like this is a long post</div>
14-
<div class="gh-editor-email-size-popup-text">Email newsletters may get cut off in the inbox behind a "View entire message" link when they're over 100kB.</div>
15-
<div class="gh-editor-email-size-popup-used">You've used: <span class={{this.warningLevel}}>{{this.emailSizeKb}}kB</span></div>
16-
</div>
17-
{{/if}}
18-
</span>
23+
{{/if}}
1924
{{/if}}

ghost/admin/app/components/editor/modals/preview/email.hbs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,18 @@
8888
/>
8989
</form>
9090
</div>
91-
<div class="gh-email-preview-clip-container">
92-
{{svg-jar "email"}}
93-
<div>
94-
<div class="gh-email-preview-clip-title">Looks like this is a long post</div>
95-
<div class="gh-email-preview-clip-description">Email newsletters may get cut off in the inbox behind a “View entire message” link when they’re over 100kB. </div>
96-
<div class="gh-email-preview-clip-used">You’ve used: <span class="yellow-d1">92kB</span></div>
97-
</div>
98-
</div>
91+
<Editor::EmailSizeWarning @post={{@post}} as |warningLevel emailSizeKb| >
92+
{{#if warningLevel}}
93+
<div class="gh-email-preview-clip-container">
94+
{{svg-jar "email-warning"}}
95+
<div>
96+
<div class="gh-email-preview-clip-title">Looks like this is a long post</div>
97+
<div class="gh-email-preview-clip-description">Email newsletters may get cut off in the inbox behind a “View entire message” link when they’re over 100kB. </div>
98+
<div class="gh-email-preview-clip-used">You’ve used: <span class="yellow-d1">{{emailSizeKb}}kB</span></div>
99+
</div>
100+
</div>
101+
{{/if}}
102+
</Editor::EmailSizeWarning>
99103
<iframe
100104
class="gh-pe-iframe"
101105
title="Email preview"

0 commit comments

Comments
 (0)