mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Better resolver support for underscored templates. Eventually we'll
migrate to dashed only.
This commit is contained in:
parent
1de9c3b04a
commit
22fd7fb07d
2 changed files with 8 additions and 2 deletions
|
@ -112,7 +112,13 @@ export default Ember.DefaultResolver.extend({
|
|||
},
|
||||
|
||||
findTemplate: function(parsedName) {
|
||||
return this._super(parsedName) || this.findSlashedTemplate(parsedName) || this.findAdminTemplate(parsedName);
|
||||
return this._super(parsedName) || this.findSlashedTemplate(parsedName) || this.findAdminTemplate(parsedName) || this.findUnderscoredTemplate(parsedName);
|
||||
},
|
||||
|
||||
findUnderscoredTemplate: function(parsedName) {
|
||||
var decamelized = parsedName.fullNameWithoutType.decamelize();
|
||||
var underscored = decamelized.replace("-", "_");
|
||||
return Ember.TEMPLATES[underscored];
|
||||
},
|
||||
|
||||
// Try to find a template with slash instead of first underscore, e.g. foo_bar_baz => foo/bar_baz
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
{{render "siteMap"}}
|
||||
{{/if}}
|
||||
|
||||
{{render "userDropdown"}}
|
||||
{{render "user-dropdown"}}
|
||||
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue