diff --git a/app/assets/javascripts/discourse/helpers/handlebars.js.es6 b/app/assets/javascripts/discourse/helpers/handlebars.js.es6 new file mode 100644 index 00000000000..891b1ed9689 --- /dev/null +++ b/app/assets/javascripts/discourse/helpers/handlebars.js.es6 @@ -0,0 +1,17 @@ +Handlebars.registerHelper('handlebars', function(property, options) { + + var template = Em.TEMPLATES[property + ".raw"]; + var params = options.hash; + + if(params) { + for(var prop in params){ + params[prop] = Em.Handlebars.get(this, params[prop]) || params[prop]; + } + } + + return new Handlebars.SafeString(template(params)); +}); + +Handlebars.registerHelper('get', function(property) { + return Em.get(this, property); +}); diff --git a/app/assets/javascripts/discourse/templates/list/topic_list_item.hbs b/app/assets/javascripts/discourse/templates/list/topic_list_item.hbs index 6735b9b8c22..904c7779c48 100644 --- a/app/assets/javascripts/discourse/templates/list/topic_list_item.hbs +++ b/app/assets/javascripts/discourse/templates/list/topic_list_item.hbs @@ -31,7 +31,7 @@