FIX: Support raw templates in the latest discourse releases

This commit is contained in:
Robin Ward 2016-12-27 11:47:50 -05:00
parent e2ee693f64
commit 4b3e5d547d
2 changed files with 7 additions and 2 deletions

View File

@ -80,7 +80,13 @@ const QueryResultComponent = Ember.Component.extend({
if (self.get('content.colrender')[idx]) {
viewName = self.get('content.colrender')[idx];
}
const template = getOwner(self).lookup('template:explorer/' + viewName + '.raw');
// After `findRawTemplates` is in stable this should be updated to use that
let template = getOwner(self).lookup('template:explorer/' + viewName + '.raw');
if (!template) {
template = Discourse.RAW_TEMPLATES[`javascripts/explorer/${viewName}`];
}
return {name: viewName, template };
});
}.property('content', 'columns.@each'),

View File

@ -68,7 +68,6 @@ const QueryRowContentComponent = Ember.Component.extend(bufferedRender({
return new Handlebars.SafeString((t.template || fallback)(ctx, params));
} catch (e) {
console.error(e);
debugger;
return "error";
}
});