framework/ember/app/helpers/user-name.js
2015-02-26 12:47:50 +10:30

13 lines
346 B
JavaScript

import Ember from 'ember';
export default Ember.Handlebars.makeBoundHelper(function(user, options) {
var username;
if (user) {
username = user.get('username');
}
username = username || '[deleted]';
return new Ember.Handlebars.SafeString('<span class="username">'+Ember.Handlebars.Utils.escapeExpression(username)+'</span>');
});