mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 01:43:45 +08:00
1c87bb7fe9
1. Use `this.` instead of `{{action}}` where applicable 2. Use `{{fn}}` instead of `@actionParam` where applicable 3. Use non-`@` versions of class/type/tabindex/aria-controls/aria-expanded 4. Remove `btn` class (it's added automatically to all DButtons) 5. Remove `type="button"` (it's the default) 6. Use `concat-class` helper
85 lines
2.5 KiB
Handlebars
85 lines
2.5 KiB
Handlebars
<p>{{i18n "admin.email.preview_digest_desc"}}</p>
|
|
|
|
<div class="admin-controls email-preview">
|
|
<div class="controls">
|
|
<div class="inline-form">
|
|
<label for="last-seen">{{i18n "admin.email.last_seen_user"}}</label>
|
|
<DatePickerPast @value={{this.lastSeen}} @id="last-seen" />
|
|
<label>{{i18n "admin.email.user"}}:</label>
|
|
<EmailGroupUserChooser
|
|
@value={{this.username}}
|
|
@onChange={{action "updateUsername"}}
|
|
@options={{hash maximum=1}}
|
|
/>
|
|
<DButton
|
|
@action={{this.refresh}}
|
|
@label="admin.email.refresh"
|
|
class="btn-primary digest-refresh-button"
|
|
/>
|
|
<div class="toggle">
|
|
<label>{{i18n "admin.email.format"}}</label>
|
|
{{#if this.showHtml}}
|
|
<span>{{i18n "admin.email.html"}}</span>
|
|
|
|
|
<a href {{on "click" this.toggleShowHtml}}>
|
|
{{i18n "admin.email.text"}}
|
|
</a>
|
|
{{else}}
|
|
<a href {{on "click" this.toggleShowHtml}}>{{i18n
|
|
"admin.email.html"
|
|
}}</a>
|
|
|
|
|
<span>{{i18n "admin.email.text"}}</span>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<ConditionalLoadingSpinner @condition={{this.loading}}>
|
|
|
|
<div class="email-preview-digest">
|
|
{{#if this.showSendEmailForm}}
|
|
<div class="controls">
|
|
<div class="inline-form">
|
|
{{#if this.sendingEmail}}
|
|
{{i18n "admin.email.sending_test"}}
|
|
{{else}}
|
|
<label>{{i18n "admin.email.send_digest_label"}}</label>
|
|
<TextField
|
|
@value={{this.email}}
|
|
@placeholderKey="admin.email.test_email_address"
|
|
/>
|
|
<DButton
|
|
@action={{this.sendEmail}}
|
|
@disabled={{this.sendEmailDisabled}}
|
|
@label="admin.email.send_digest"
|
|
class="btn-default"
|
|
/>
|
|
{{#if this.sentEmail}}
|
|
<span class="result-message">{{i18n
|
|
"admin.email.sent_test"
|
|
}}</span>
|
|
{{/if}}
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
|
|
<div class="preview-output">
|
|
{{#if this.showHtml}}
|
|
{{#if this.htmlEmpty}}
|
|
<p>{{i18n "admin.email.no_result"}}</p>
|
|
{{else}}
|
|
<iframe
|
|
title={{i18n "admin.email.html_preview"}}
|
|
srcdoc={{this.model.html_content}}
|
|
></iframe>
|
|
{{/if}}
|
|
{{else}}
|
|
<pre>{{html-safe this.model.text_content}}</pre>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
|
|
</ConditionalLoadingSpinner> |