Merge pull request #822 from ZogStriP/prepend-the-username-in-participants-title

prepend the username in the participant alt-text in the topic list
This commit is contained in:
Sam 2013-05-05 16:44:35 -07:00
commit 8d1687d9d5
1 changed files with 12 additions and 1 deletions

View File

@ -139,7 +139,18 @@ Handlebars.registerHelper('avatar', function(user, options) {
var title;
if (!options.hash.ignoreTitle) {
title = Em.get(user, 'title') || Em.get(user, 'description');
// first try to get a title
title = Em.get(user, 'title');
// if there was no title provided
if (!title) {
// try to retrieve a description
var description = Em.get(user, 'description');
// if a description has been provided
if (description && description.length > 0) {
// preprend the username before the description
title = username + " - " + description;
}
}
}
return new Handlebars.SafeString(Discourse.Utilities.avatarImg({