mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
24 lines
585 B
JavaScript
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));
|
|
});
|