diff --git a/dev/Common/Utils.js b/dev/Common/Utils.js index 6c352d0f6..321c856c8 100644 --- a/dev/Common/Utils.js +++ b/dev/Common/Utils.js @@ -617,7 +617,7 @@ export function clearBqSwitcher(body) * @param {boolean} print * @returns {void} */ -export function previewMessage({title, subject, date, fromCreds, toCreds, toLabel}, body, isHtml, print) +export function previewMessage({title, subject, date, fromCreds, toCreds, toLabel, ccClass, ccCreds, ccLabel}, body, isHtml, print) { const win = window.open(''), @@ -636,6 +636,9 @@ export function previewMessage({title, subject, date, fromCreds, toCreds, toLabe .replace('{{fromCreds}}', encodeHtml(fromCreds)) .replace('{{toCreds}}', encodeHtml(toCreds)) .replace('{{toLabel}}', encodeHtml(toLabel)) + .replace('{{ccClass}}', encodeHtml(ccClass)) + .replace('{{ccCreds}}', encodeHtml(ccCreds)) + .replace('{{ccLabel}}', encodeHtml(ccLabel)) .replace('{{bodyClass}}', bodyClass) .replace('{{html}}', html) ); diff --git a/dev/Html/PreviewMessage.html b/dev/Html/PreviewMessage.html index 150f7668c..f5e6d1719 100644 --- a/dev/Html/PreviewMessage.html +++ b/dev/Html/PreviewMessage.html @@ -72,42 +72,39 @@ pre { border-left: 2px solid red; color: red; } - -.rl-previre-subject { +.rl-preview-subject { font-size: 16px; font-weight: bold; padding: 15px; - border-bottom: 1px solid #ccc; } - -.rl-previre-creds-from, .rl-previre-creds-to { +.rl-preview-creds-from, .rl-preview-creds-to, .rl-preview-creds-cc { font-size: 12px; - padding: 10px 15px; + padding: 5px 15px; } - -.rl-previre-creds-from { - padding-bottom: 0; -} - -.rl-previre-creds-to { - border-bottom: 1px solid #ccc; -} - -.rl-previre-date { +.rl-preview-date { float: right; font-size: 12px; padding: 10px 15px; +} +.rl-preview-section { + padding: 0; + margin: 0; + border-bottom: 1px solid #ccc; +} +.rl-preview-hide { + display: none; } -
-
{{subject}}
+
+
{{subject}}
-
-
{{date}}
-
{{fromCreds}}
-
{{toLabel}}: {{toCreds}}
+
+
{{date}}
+
{{fromCreds}}
+
{{toLabel}}: {{toCreds}}
+
{{ccLabel}}: {{ccCreds}}
{{html}}
diff --git a/dev/Model/Message.js b/dev/Model/Message.js index 7f1d9d007..dcaec99b7 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -640,6 +640,7 @@ class MessageModel extends AbstractModel const timeStampInUTC = this.dateTimeStampInUTC() || 0, + ccLine = this.ccToLine(false), m = 0 < timeStampInUTC ? moment.unix(timeStampInUTC) : null; previewMessage({ @@ -648,7 +649,10 @@ class MessageModel extends AbstractModel date: m ? m.format('LLL') : '', fromCreds: this.fromToLine(false), toLabel: i18n('MESSAGE/LABEL_TO'), - toCreds: this.toToLine(false) + toCreds: this.toToLine(false), + ccClass: ccLine ? '' : 'rl-preview-hide', + ccLabel: i18n('MESSAGE/LABEL_CC'), + ccCreds: ccLine }, this.body, this.isHtml(), print); }