Files
discourse/app/assets/javascripts/discourse/helpers/raw.js.es6
2014-12-17 09:31:40 -05:00

24 lines
585 B
JavaScript

Handlebars.registerHelper('raw', function(property, options) {
var templateName = property + ".raw",
template = Discourse.__container__.lookup('template:' + templateName),
params = options.hash;
// {{raw}} helper is broken!
return;
if (!template) {
Ember.warn('Could not find raw template: ' + templateName);
return;
}
if (params) {
for (var prop in params) {
if (options.hashTypes[prop] === "ID") {
params[prop] = Ember.get(this, params[prop], options);
}
}
}
return new Handlebars.SafeString(template(params));
});