use proper case & remove unused view

This commit is contained in:
Régis Hanol 2014-11-17 18:17:24 +01:00
parent 216a5a87cb
commit 15a5d06495
3 changed files with 3 additions and 32 deletions

View File

@ -23,14 +23,14 @@ export default Ember.Component.extend({
}
if (!this.get("other_accounts")) {
this.set("other_accounts_loading", true);
this.set("otherAccountsLoading", true);
Discourse.AdminUser.findAll("active", {
"ip": this.get("ip"),
"exclude": this.get("user_id")
}).then(function (users) {
self.setProperties({
other_accounts: users,
other_accounts_loading: false,
otherAccountsLoading: false,
});
});
}

View File

@ -1,29 +0,0 @@
Discourse.AdminIpLocatorView = Discourse.View.extend({
templateName: 'admin/templates/ip_locator',
classNames: ["iplocator"],
actions: {
hideBox: function(){
this.set("showBox", false);
},
lookup: function(){
if (!this.get("location")){
$.get("http://ipinfo.io/" + this.get("ip"), function(response) {
this.set("location", response);
}.bind(this), "jsonp");
}
if (!this.get("other_accounts")){
this.set("other_accounts_loading", true);
Discourse.ajax("/admin/users/list/active.json", {
data: {"ip": this.get("ip"),
"exclude": this.get("controller.id")
}
}).then(function (users) {
this.set("other_accounts", users.map(function(u) { return Discourse.AdminUser.create(u);}));
this.set("other_accounts_loading", false);
}.bind(this));
}
this.set("showBox", true);
}
}
});

View File

@ -38,7 +38,7 @@
<dt>{{i18n ip_lookup.other_accounts}}&nbsp;<strong>{{other_accounts.length}}</strong></dt>
<dd class="other-accounts">
{{#loading-spinner size="small" condition=other_accounts_loading}}
{{#loading-spinner size="small" condition=otherAccountsLoading}}
{{#if other_accounts}}
<ul>
{{#each other_accounts}}