This commit is contained in:
Julian Lam
2015-11-02 23:10:03 -05:00
parent dc916c5e3c
commit 3314ab4b83
2 changed files with 27 additions and 2 deletions

View File

@@ -175,6 +175,22 @@
}
};
helpers.renderDigestAvatar = function(block) {
if (block.teaser) {
if (block.teaser.user.picture) {
return '<img style="vertical-align: middle; width: 16px; height: 16px; padding-right: 1em;" src="' + block.teaser.user.picture + '" title="' + block.teaser.user.username + '" />';
} else {
return '<div style="width: 16px; height: 16px; line-height: 16px; font-size: 10px; margin-right: 1em; background-color: ' + block.teaser.user['icon:bgColor'] + '; color: white; text-align: center; display: inline-block;">' + block.teaser.user['icon:text'] + '</div>';
}
} else {
if (block.user.picture) {
return '<img style="vertical-align: middle; width: 16px; height: 16px; padding-right: 1em;" src="' + block.user.picture + '" title="' + block.user.username + '" />';
} else {
return '<div style="width: 16px; height: 16px; line-height: 16px; font-size: 10px; margin-right: 1em; background-color: ' + block.user['icon:bgColor'] + '; color: white; text-align: center; display: inline-block;">' + block.user['icon:text'] + '</div>';
}
}
};
exports.register = function() {
var templates;