diff --git a/app/assets/javascripts/discourse/helpers/application_helpers.js b/app/assets/javascripts/discourse/helpers/application_helpers.js index 328472f5f..269f1c8da 100644 --- a/app/assets/javascripts/discourse/helpers/application_helpers.js +++ b/app/assets/javascripts/discourse/helpers/application_helpers.js @@ -407,3 +407,22 @@ Handlebars.registerHelper('link-domain', function(property, options) { } } }); + +/** + Renders a font-awesome icon with an optional i18n string as hidden text for + screen readers. + + @method icon + @for Handlebars +**/ +Handlebars.registerHelper('icon', function(icon, options) { + var labelKey, html; + if (options.hash) { labelKey = options.hash.label; } + html = ""; + } + return new Handlebars.SafeString(html); +}); diff --git a/app/assets/javascripts/discourse/templates/header.js.handlebars b/app/assets/javascripts/discourse/templates/header.js.handlebars index d1306aa82..03a8b76a1 100644 --- a/app/assets/javascripts/discourse/templates/header.js.handlebars +++ b/app/assets/javascripts/discourse/templates/header.js.handlebars @@ -11,7 +11,7 @@ {{/if}}

{{#if topic.isPrivateMessage}} - + {{icon envelope}} {{/if}} {{#if topic.category.parentCategory}} {{boundCategoryLink topic.category.parentCategory}} @@ -42,16 +42,14 @@ {{/unless}} {{#unless currentUser}} {{/unless}}