Remove more view classes

This commit is contained in:
Robin Ward 2016-11-10 16:20:31 -05:00
parent d98aa48f0d
commit 01a8ef590a
11 changed files with 32 additions and 74 deletions

View File

@ -1,3 +1,4 @@
{{#d-section bodyClass="navigation-categories"}}
{{bread-crumbs categories=categories}} {{bread-crumbs categories=categories}}
{{navigation-bar navItems=navItems filterMode=filterMode}} {{navigation-bar navItems=navItems filterMode=filterMode}}
@ -8,3 +9,4 @@
{{#if canCreateTopic}} {{#if canCreateTopic}}
<button id="create-topic" class='btn btn-default' {{action "createTopic"}}><i class='fa fa-plus'></i>{{i18n 'topic.create'}}</button> <button id="create-topic" class='btn btn-default' {{action "createTopic"}}><i class='fa fa-plus'></i>{{i18n 'topic.create'}}</button>
{{/if}} {{/if}}
{{/d-section}}

View File

@ -1,4 +1,4 @@
<section class='user-content'> <section class='user-content user-preferences'>
<form class="form-horizontal"> <form class="form-horizontal">
<div class="control-group"> <div class="control-group">
@ -25,7 +25,7 @@
<div class="control-group"> <div class="control-group">
<label class="control-label">{{i18n 'user.email.title'}}</label> <label class="control-label">{{i18n 'user.email.title'}}</label>
<div class="controls"> <div class="controls">
{{text-field value=newEmail id="change_email" classNames="input-xxlarge"}} {{text-field value=newEmail id="change_email" classNames="input-xxlarge" autofocus="autofocus"}}
</div> </div>
<div class='instructions'> <div class='instructions'>
{{#if taken}} {{#if taken}}

View File

@ -1,3 +1,4 @@
<div class='topic-unsubscribe'>
<div class="container"> <div class="container">
<p> <p>
{{{stopNotificiationsText}}} {{{stopNotificiationsText}}}
@ -6,3 +7,4 @@
{{i18n "topic.unsubscribe.change_notification_state"}} {{topic-notifications-button topic=model}} {{i18n "topic.unsubscribe.change_notification_state"}} {{topic-notifications-button topic=model}}
</p> </p>
</div> </div>
</div>

View File

@ -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'));
}
}));

View File

@ -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);
},
});

View File

@ -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')
});

View File

@ -1,2 +0,0 @@
// In case plugins are using the old `additionalButtons` API, don't break
export default Ember.View.extend();

View File

@ -1,3 +0,0 @@
export default Ember.View.extend({
classNames: ["topic-unsubscribe"]
});

View File

@ -62,7 +62,6 @@
//= require ./discourse/views/modal-body //= require ./discourse/views/modal-body
//= require ./discourse/views/flag //= require ./discourse/views/flag
//= require ./discourse/components/edit-category-panel //= require ./discourse/components/edit-category-panel
//= require ./discourse/views/button
//= require ./discourse/components/dropdown-button //= require ./discourse/components/dropdown-button
//= require ./discourse/components/notifications-button //= require ./discourse/components/notifications-button
//= require ./discourse/lib/link-mentions //= require ./discourse/lib/link-mentions

View File

@ -19,17 +19,23 @@ test("update some fields", () => {
}); });
}); });
test("about me", () => { test("username", () => {
visit("/users/eviltrout/preferences/username"); visit("/users/eviltrout/preferences/username");
andThen(() => { 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"); visit("/users/eviltrout/preferences/about-me");
andThen(() => { 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");
});
});

View File

@ -18,6 +18,7 @@ test("Visit Discovery Pages", () => {
visit("/categories"); visit("/categories");
andThen(() => { andThen(() => {
ok($('body.navigation-categories').length, "has the body class");
ok($('body.category-bug').length === 0, "removes the custom category class"); ok($('body.category-bug').length === 0, "removes the custom category class");
ok(exists('.category'), "has a list of categories"); ok(exists('.category'), "has a list of categories");
ok($('body.categories-list').length, "has a custom class to indicate categories"); ok($('body.categories-list').length, "has a custom class to indicate categories");