From 46d8db3d7080f4289fd26c1647b8d0f0b0e155b6 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 12 Sep 2014 15:03:33 -0400 Subject: [PATCH] Use dashed names for all templates when using `{{render}}` for future Ember compatibility --- app/assets/javascripts/discourse/ember/resolver.js.es6 | 2 +- ....js.handlebars => additional-composer-buttons.js.handlebars} | 1 + .../javascripts/discourse/templates/composer.js.handlebars | 2 +- ..._admin_menu.js.handlebars => topic-admin-menu.js.handlebars} | 0 app/assets/javascripts/discourse/templates/topic.js.handlebars | 2 +- ...{user_dropdown.js.handlebars => user-dropdown.js.handlebars} | 0 6 files changed, 4 insertions(+), 3 deletions(-) rename app/assets/javascripts/discourse/templates/{additional_composer_buttons.js.handlebars => additional-composer-buttons.js.handlebars} (84%) rename app/assets/javascripts/discourse/templates/{topic_admin_menu.js.handlebars => topic-admin-menu.js.handlebars} (100%) rename app/assets/javascripts/discourse/templates/{user_dropdown.js.handlebars => user-dropdown.js.handlebars} (100%) diff --git a/app/assets/javascripts/discourse/ember/resolver.js.es6 b/app/assets/javascripts/discourse/ember/resolver.js.es6 index e8c6a2af344..7f51291c423 100644 --- a/app/assets/javascripts/discourse/ember/resolver.js.es6 +++ b/app/assets/javascripts/discourse/ember/resolver.js.es6 @@ -117,7 +117,7 @@ export default Ember.DefaultResolver.extend({ findUnderscoredTemplate: function(parsedName) { var decamelized = parsedName.fullNameWithoutType.decamelize(); - var underscored = decamelized.replace("-", "_"); + var underscored = decamelized.replace(/\-/g, "_"); return Ember.TEMPLATES[underscored]; }, diff --git a/app/assets/javascripts/discourse/templates/additional_composer_buttons.js.handlebars b/app/assets/javascripts/discourse/templates/additional-composer-buttons.js.handlebars similarity index 84% rename from app/assets/javascripts/discourse/templates/additional_composer_buttons.js.handlebars rename to app/assets/javascripts/discourse/templates/additional-composer-buttons.js.handlebars index 43ccd1b392d..0a1a638f008 100644 --- a/app/assets/javascripts/discourse/templates/additional_composer_buttons.js.handlebars +++ b/app/assets/javascripts/discourse/templates/additional-composer-buttons.js.handlebars @@ -1 +1,2 @@ {{!-- THIS IS AN EMPTY TEMPLATE THAT NEEDS TO BE OVERWRITTEN --}} +{{log wat}} diff --git a/app/assets/javascripts/discourse/templates/composer.js.handlebars b/app/assets/javascripts/discourse/templates/composer.js.handlebars index aff6e0d0859..c1e05df6683 100644 --- a/app/assets/javascripts/discourse/templates/composer.js.handlebars +++ b/app/assets/javascripts/discourse/templates/composer.js.handlebars @@ -58,7 +58,7 @@ {{#if model.archetype.hasOptions}} {{/if}} - {{render "additionalComposerButtons" model}} + {{render "additional-composer-buttons" model}} {{/unless}} {{/if}} diff --git a/app/assets/javascripts/discourse/templates/topic_admin_menu.js.handlebars b/app/assets/javascripts/discourse/templates/topic-admin-menu.js.handlebars similarity index 100% rename from app/assets/javascripts/discourse/templates/topic_admin_menu.js.handlebars rename to app/assets/javascripts/discourse/templates/topic-admin-menu.js.handlebars diff --git a/app/assets/javascripts/discourse/templates/topic.js.handlebars b/app/assets/javascripts/discourse/templates/topic.js.handlebars index fb3e6684834..1ee57883cbd 100644 --- a/app/assets/javascripts/discourse/templates/topic.js.handlebars +++ b/app/assets/javascripts/discourse/templates/topic.js.handlebars @@ -153,5 +153,5 @@ {{/if}} {{#if currentUser.canManageTopic}} - {{render "topicAdminMenu" content}} + {{render "topic-admin-menu" content}} {{/if}} diff --git a/app/assets/javascripts/discourse/templates/user_dropdown.js.handlebars b/app/assets/javascripts/discourse/templates/user-dropdown.js.handlebars similarity index 100% rename from app/assets/javascripts/discourse/templates/user_dropdown.js.handlebars rename to app/assets/javascripts/discourse/templates/user-dropdown.js.handlebars