FIX: Missing `alt` tag on user notifications
This commit is contained in:
parent
821103cad5
commit
b34f55d880
|
@ -58,14 +58,9 @@ createWidget('notification-item', {
|
||||||
return Ember.isEmpty(title) ? "" : Discourse.Utilities.escapeExpression(title);
|
return Ember.isEmpty(title) ? "" : Discourse.Utilities.escapeExpression(title);
|
||||||
},
|
},
|
||||||
|
|
||||||
text() {
|
text(notificationType, notName) {
|
||||||
const attrs = this.attrs;
|
const { attrs } = this;
|
||||||
const data = attrs.data;
|
const data = attrs.data;
|
||||||
|
|
||||||
const notificationType = attrs.notification_type;
|
|
||||||
|
|
||||||
const lookup = this.site.get('notificationLookup');
|
|
||||||
const notName = lookup[notificationType];
|
|
||||||
const scope = (notName === 'custom') ? data.message : `notifications.${notName}`;
|
const scope = (notName === 'custom') ? data.message : `notifications.${notName}`;
|
||||||
|
|
||||||
if (notificationType === GROUP_SUMMARY_TYPE) {
|
if (notificationType === GROUP_SUMMARY_TYPE) {
|
||||||
|
@ -89,10 +84,15 @@ createWidget('notification-item', {
|
||||||
return I18n.t(scope, {description, username});
|
return I18n.t(scope, {description, username});
|
||||||
},
|
},
|
||||||
|
|
||||||
html() {
|
html(attrs) {
|
||||||
const contents = new RawHtml({ html: `<div>${Discourse.Emoji.unescape(this.text())}</div>` });
|
const notificationType = attrs.notification_type;
|
||||||
const url = this.url();
|
const lookup = this.site.get('notificationLookup');
|
||||||
return url ? h('a', { attributes: { href: url, 'data-auto-route': true } }, contents) : contents;
|
const notName = lookup[notificationType];
|
||||||
|
|
||||||
|
const contents = new RawHtml({ html: `<div>${Discourse.Emoji.unescape(this.text(notificationType, notName))}</div>` });
|
||||||
|
const href = this.url();
|
||||||
|
const alt = I18n.t(`notifications.alt.${notName}`);
|
||||||
|
return href ? h('a', { attributes: { href, alt } }, contents) : contents;
|
||||||
},
|
},
|
||||||
|
|
||||||
click(e) {
|
click(e) {
|
||||||
|
|
Loading…
Reference in New Issue