diff --git a/app/assets/javascripts/discourse/templates/navigation/categories.hbs b/app/assets/javascripts/discourse/templates/navigation/categories.hbs index e6a650cfbe2..a324ccebc71 100644 --- a/app/assets/javascripts/discourse/templates/navigation/categories.hbs +++ b/app/assets/javascripts/discourse/templates/navigation/categories.hbs @@ -1,10 +1,12 @@ -{{bread-crumbs categories=categories}} +{{#d-section bodyClass="navigation-categories"}} + {{bread-crumbs categories=categories}} -{{navigation-bar navItems=navItems filterMode=filterMode}} + {{navigation-bar navItems=navItems filterMode=filterMode}} -{{#if canCreateCategory}} - {{categories-admin-dropdown}} -{{/if}} -{{#if canCreateTopic}} - -{{/if}} + {{#if canCreateCategory}} + {{categories-admin-dropdown}} + {{/if}} + {{#if canCreateTopic}} + + {{/if}} +{{/d-section}} diff --git a/app/assets/javascripts/discourse/templates/user/email.hbs b/app/assets/javascripts/discourse/templates/preferences-email.hbs similarity index 93% rename from app/assets/javascripts/discourse/templates/user/email.hbs rename to app/assets/javascripts/discourse/templates/preferences-email.hbs index b60f0c04961..0aecb67abd3 100644 --- a/app/assets/javascripts/discourse/templates/user/email.hbs +++ b/app/assets/javascripts/discourse/templates/preferences-email.hbs @@ -1,4 +1,4 @@ -
+
@@ -25,7 +25,7 @@
- {{text-field value=newEmail id="change_email" classNames="input-xxlarge"}} + {{text-field value=newEmail id="change_email" classNames="input-xxlarge" autofocus="autofocus"}}
{{#if taken}} diff --git a/app/assets/javascripts/discourse/templates/topic/unsubscribe.hbs b/app/assets/javascripts/discourse/templates/topic/unsubscribe.hbs index d153867e871..f330d1046b9 100644 --- a/app/assets/javascripts/discourse/templates/topic/unsubscribe.hbs +++ b/app/assets/javascripts/discourse/templates/topic/unsubscribe.hbs @@ -1,8 +1,10 @@ -
-

- {{{stopNotificiationsText}}} -

-

- {{i18n "topic.unsubscribe.change_notification_state"}} {{topic-notifications-button topic=model}} -

+
+
+

+ {{{stopNotificiationsText}}} +

+

+ {{i18n "topic.unsubscribe.change_notification_state"}} {{topic-notifications-button topic=model}} +

+
diff --git a/app/assets/javascripts/discourse/views/button.js.es6 b/app/assets/javascripts/discourse/views/button.js.es6 deleted file mode 100644 index a2a0dc0dafe..00000000000 --- a/app/assets/javascripts/discourse/views/button.js.es6 +++ /dev/null @@ -1,23 +0,0 @@ -import { bufferedRender } from 'discourse-common/lib/buffered-render'; - -export default Ember.View.extend(bufferedRender({ - tagName: 'button', - classNameBindings: [':btn', ':standard', 'dropDownToggle'], - attributeBindings: ['title', 'data-toggle', 'data-share-url'], - - title: function() { - return I18n.t(this.get('helpKey') || this.get('textKey')); - }.property('helpKey', 'textKey'), - - text: function() { - if (Ember.isEmpty(this.get('textKey'))) { return ""; } - return I18n.t(this.get('textKey')); - }.property('textKey'), - - buildBuffer(buffer) { - if (this.renderIcon) { - this.renderIcon(buffer); - } - buffer.push(this.get('text')); - } -})); diff --git a/app/assets/javascripts/discourse/views/navigation-categories.js.es6 b/app/assets/javascripts/discourse/views/navigation-categories.js.es6 deleted file mode 100644 index dcd408de525..00000000000 --- a/app/assets/javascripts/discourse/views/navigation-categories.js.es6 +++ /dev/null @@ -1,15 +0,0 @@ -import { on } from 'ember-addons/ember-computed-decorators'; - -const CATEGORIES_BODY_CLASS = "navigation-categories"; - -export default Ember.View.extend({ - @on("didInsertElement") - addBodyClass() { - $('body').addClass(CATEGORIES_BODY_CLASS); - }, - - @on("willDestroyElement") - removeBodyClass() { - $('body').removeClass(CATEGORIES_BODY_CLASS); - }, -}); diff --git a/app/assets/javascripts/discourse/views/preferences-email.js.es6 b/app/assets/javascripts/discourse/views/preferences-email.js.es6 deleted file mode 100644 index 766a8c90abe..00000000000 --- a/app/assets/javascripts/discourse/views/preferences-email.js.es6 +++ /dev/null @@ -1,9 +0,0 @@ -export default Em.View.extend({ - templateName: 'user/email', - classNames: ['user-preferences'], - _focusField: function() { - Em.run.schedule('afterRender', function() { - $('#change_email').focus(); - }); - }.on('didInsertElement') -}); diff --git a/app/assets/javascripts/discourse/views/topic-footer-main-buttons.js.es6 b/app/assets/javascripts/discourse/views/topic-footer-main-buttons.js.es6 deleted file mode 100644 index 4ece5f553fe..00000000000 --- a/app/assets/javascripts/discourse/views/topic-footer-main-buttons.js.es6 +++ /dev/null @@ -1,2 +0,0 @@ -// In case plugins are using the old `additionalButtons` API, don't break -export default Ember.View.extend(); diff --git a/app/assets/javascripts/discourse/views/topic-unsubscribe.js.es6 b/app/assets/javascripts/discourse/views/topic-unsubscribe.js.es6 deleted file mode 100644 index 46ac72e0f06..00000000000 --- a/app/assets/javascripts/discourse/views/topic-unsubscribe.js.es6 +++ /dev/null @@ -1,3 +0,0 @@ -export default Ember.View.extend({ - classNames: ["topic-unsubscribe"] -}); diff --git a/app/assets/javascripts/main_include.js b/app/assets/javascripts/main_include.js index c18248dffbf..8993fff5a14 100644 --- a/app/assets/javascripts/main_include.js +++ b/app/assets/javascripts/main_include.js @@ -62,7 +62,6 @@ //= require ./discourse/views/modal-body //= require ./discourse/views/flag //= require ./discourse/components/edit-category-panel -//= require ./discourse/views/button //= require ./discourse/components/dropdown-button //= require ./discourse/components/notifications-button //= require ./discourse/lib/link-mentions diff --git a/test/javascripts/acceptance/preferences-test.js.es6 b/test/javascripts/acceptance/preferences-test.js.es6 index feb69443341..b6885400ea4 100644 --- a/test/javascripts/acceptance/preferences-test.js.es6 +++ b/test/javascripts/acceptance/preferences-test.js.es6 @@ -19,17 +19,23 @@ test("update some fields", () => { }); }); -test("about me", () => { +test("username", () => { visit("/users/eviltrout/preferences/username"); andThen(() => { - ok(exists("#change_username"), "it has the input element for the bio"); + ok(exists("#change_username"), "it has the input element"); }); }); -test("username", () => { +test("about me", () => { visit("/users/eviltrout/preferences/about-me"); andThen(() => { - ok(exists(".raw-bio"), "it has the input element for the bio"); + ok(exists(".raw-bio"), "it has the input element"); }); }); +test("email", () => { + visit("/users/eviltrout/preferences/email"); + andThen(() => { + ok(exists("#change_email"), "it has the input element"); + }); +}); diff --git a/test/javascripts/acceptance/topic-discovery-test.js.es6 b/test/javascripts/acceptance/topic-discovery-test.js.es6 index 28749712f35..d6d1798d29c 100644 --- a/test/javascripts/acceptance/topic-discovery-test.js.es6 +++ b/test/javascripts/acceptance/topic-discovery-test.js.es6 @@ -18,6 +18,7 @@ test("Visit Discovery Pages", () => { visit("/categories"); andThen(() => { + ok($('body.navigation-categories').length, "has the body class"); ok($('body.category-bug').length === 0, "removes the custom category class"); ok(exists('.category'), "has a list of categories"); ok($('body.categories-list').length, "has a custom class to indicate categories");