framework/ember/app/helpers/user-name.js

13 lines
346 B
JavaScript
Raw Normal View History

2015-02-26 10:17:50 +08:00
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>');
});