discourse/app/assets/javascripts/admin/addon/templates/email-preview-digest.hbs
Martin Brennan e26a1175d7
FEATURE: Initial version of experimental admin search (#31299)
This feature allows admins to find what they are
looking for in the admin interface via a search modal.
This replaces the admin sidebar filter
as the focus of the Ctrl+/ command, but the sidebar
filter can also still be used. Perhaps at some point
we may remove it or change the shortcut.

The search modal presents the following data for filtering:

* A list of all admin pages, the same as the sidebar,
   except also showing "third level" pages like
   "Email > Skipped"
* All site settings
* Themes
* Components
* Reports

Admins can also filter which types of items are shown in the modal,
for example hiding Settings if they know they are looking for a Page.

In this PR, I also have the following fixes:

* Site setting filters now clear when moving between
   filtered site setting pages, previously it was super
   sticky from Ember
* Many translations were moved around, instead of being
   in various namespaces for the sidebar links and the admin
   page titles and descriptions, now everything is under
   `admin.config` namespace, this makes it way easier to reuse
   this text for pages, search, and sidebar, and if you change it
   in one place then it is changed everywhere.

---------

Co-authored-by: Ella <ella.estigoy@gmail.com>
2025-02-21 11:59:24 +10:00

95 lines
No EOL
2.7 KiB
Handlebars
Vendored

<DPageSubheader
@descriptionLabel={{i18n
"admin.config.email.sub_pages.preview_summary.header_description"
}}
/>
<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
caretDownIcon="caret-down"
caretUpIcon="caret-up"
}}
/>
<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}} class="show-text-link">
{{i18n "admin.email.text"}}
</a>
{{else}}
<a
href
{{on "click" this.toggleShowHtml}}
class="show-html-link"
>{{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>{{this.model.text_content}}</pre>
{{/if}}
</div>
</div>
</ConditionalLoadingSpinner>