mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: if the email template has multiple subjects, link to customize text page
This commit is contained in:
parent
222fd00724
commit
86374c90de
4 changed files with 21 additions and 4 deletions
|
@ -4,6 +4,15 @@ import { bufferedProperty } from 'discourse/mixins/buffered-content';
|
|||
export default Ember.Controller.extend(bufferedProperty('emailTemplate'), {
|
||||
saved: false,
|
||||
|
||||
hasMultipleSubjects: function() {
|
||||
const buffered = this.get('buffered');
|
||||
if (buffered.getProperties('subject')['subject']) {
|
||||
return false;
|
||||
} else {
|
||||
return buffered.getProperties('id')['id'];
|
||||
}
|
||||
}.property("buffered"),
|
||||
|
||||
actions: {
|
||||
saveChanges() {
|
||||
const buffered = this.get('buffered');
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<div class='email-template'>
|
||||
<label>
|
||||
{{i18n "admin.customize.email_templates.subject"}}
|
||||
<label>{{i18n "admin.customize.email_templates.subject"}}</label>
|
||||
{{#if hasMultipleSubjects}}
|
||||
<h3>{{#link-to 'adminSiteText' (query-params q=hasMultipleSubjects)}}{{i18n "admin.customize.email_templates.multiple_subjects"}}{{/link-to}}</h3>
|
||||
{{else}}
|
||||
{{input value=buffered.subject}}
|
||||
</label>
|
||||
{{/if}}
|
||||
<br>
|
||||
|
||||
<label>{{i18n "admin.customize.email_templates.body"}}</label>
|
||||
{{d-editor value=buffered.body}}
|
||||
|
|
|
@ -10,7 +10,11 @@ class AdminEmailTemplateSerializer < ApplicationSerializer
|
|||
end
|
||||
|
||||
def subject
|
||||
@subject ||= I18n.t("#{object}.subject_template")
|
||||
if I18n.exists?("#{object}.subject_template.other")
|
||||
@subject = nil
|
||||
else
|
||||
@subject ||= I18n.t("#{object}.subject_template")
|
||||
end
|
||||
end
|
||||
|
||||
def body
|
||||
|
|
|
@ -2093,6 +2093,7 @@ en:
|
|||
email_templates:
|
||||
title: "Email Templates"
|
||||
subject: "Subject"
|
||||
multiple_subjects: "This email template has multiple subjects."
|
||||
body: "Body"
|
||||
none_selected: "Select an email template to begin editing."
|
||||
revert: "Revert Changes"
|
||||
|
|
Loading…
Reference in a new issue