Remove some useless views

This commit is contained in:
Robin Ward 2013-02-21 15:55:58 -05:00
parent 2d1bbf22e9
commit c8a908e81a
18 changed files with 76 additions and 95 deletions

View File

@ -11,6 +11,10 @@
Discourse.AdminCustomizeRoute = Discourse.Route.extend({ Discourse.AdminCustomizeRoute = Discourse.Route.extend({
model: function() { model: function() {
return Discourse.SiteCustomization.findAll(); return Discourse.SiteCustomization.findAll();
},
renderTemplate: function() {
this.render({into: 'admin/templates/admin'});
} }
}); });

View File

@ -16,6 +16,10 @@
c.set('loading', false); c.set('loading', false);
}); });
} }
},
renderTemplate: function() {
this.render({into: 'admin/templates/admin'});
} }
}); });

View File

@ -11,6 +11,10 @@
Discourse.AdminEmailLogsRoute = Discourse.Route.extend({ Discourse.AdminEmailLogsRoute = Discourse.Route.extend({
model: function() { model: function() {
return Discourse.EmailLog.findAll(); return Discourse.EmailLog.findAll();
},
renderTemplate: function() {
this.render('admin/templates/email_logs');
} }
}); });

View File

@ -0,0 +1,17 @@
(function() {
/**
Basic route for admin flags
@class AdminFlagsRoute
@extends Discourse.Route
@namespace Discourse
@module Discourse
**/
Discourse.AdminFlagsRoute = Discourse.Route.extend({
renderTemplate: function() {
this.render('admin/templates/flags');
}
});
}).call(this);

View File

@ -0,0 +1,17 @@
(function() {
/**
The base admin route
@class AdminRoute
@extends Discourse.Route
@namespace Discourse
@module Discourse
**/
Discourse.AdminRoute = Discourse.Route.extend({
renderTemplate: function() {
this.render('admin/templates/admin');
}
});
}).call(this);

View File

@ -11,7 +11,11 @@
Discourse.AdminSiteSettingsRoute = Discourse.Route.extend({ Discourse.AdminSiteSettingsRoute = Discourse.Route.extend({
model: function() { model: function() {
return Discourse.SiteSetting.findAll(); return Discourse.SiteSetting.findAll();
} },
renderTemplate: function() {
this.render('admin/templates/site_settings', {into: 'admin/templates/admin'});
}
}); });
}).call(this); }).call(this);

View File

@ -11,7 +11,12 @@
Discourse.AdminUserRoute = Discourse.Route.extend({ Discourse.AdminUserRoute = Discourse.Route.extend({
model: function(params) { model: function(params) {
return Discourse.AdminUser.find(params.username); return Discourse.AdminUser.find(params.username);
},
renderTemplate: function() {
this.render('admin/templates/user', {into: 'admin/templates/admin'});
} }
}); });
}).call(this); }).call(this);

View File

@ -11,7 +11,7 @@
Discourse.AdminUsersListNewRoute = Discourse.Route.extend({ Discourse.AdminUsersListNewRoute = Discourse.Route.extend({
setupController: function() { setupController: function() {
return this.controllerFor('adminUsersList').show('new'); return this.controllerFor('adminUsersList').show('new');
} }
}); });
}).call(this); }).call(this);

View File

@ -11,7 +11,7 @@
Discourse.AdminUsersListPendingRoute = Discourse.Route.extend({ Discourse.AdminUsersListPendingRoute = Discourse.Route.extend({
setupController: function() { setupController: function() {
return this.controllerFor('adminUsersList').show('pending'); return this.controllerFor('adminUsersList').show('pending');
} }
}); });
}).call(this); }).call(this);

View File

@ -0,0 +1,17 @@
(function() {
/**
Handles the route that deals with listing users
@class AdminUsersListRoute
@extends Discourse.Route
@namespace Discourse
@module Discourse
**/
Discourse.AdminUsersListRoute = Discourse.Route.extend({
renderTemplate: function() {
this.render('admin/templates/users_list', {into: 'admin/templates/admin'});
}
});
}).call(this);

View File

@ -2,7 +2,7 @@
<div class='list'> <div class='list'>
<div class='well'> <div class='well'>
<ul class='nav nav-list'> <ul class='nav nav-list'>
{{#each view.content}} {{#each content}}
<li {{bindAttr class="this.selected:active"}}><a {{action selectStyle this target="controller"}}>{{this.description}}</a></li> <li {{bindAttr class="this.selected:active"}}><a {{action selectStyle this target="controller"}}>{{this.description}}</a></li>
{{/each}} {{/each}}
</ul> </ul>

View File

@ -12,7 +12,6 @@
Discourse.AdminCustomizeView = window.Discourse.View.extend({ Discourse.AdminCustomizeView = window.Discourse.View.extend({
templateName: 'admin/templates/customize', templateName: 'admin/templates/customize',
classNames: ['customize'], classNames: ['customize'],
contentBinding: 'controller.content',
init: function() { init: function() {
this._super(); this._super();

View File

@ -1,15 +0,0 @@
(function() {
/**
A view for listing email logs
@class AdminEmailLogsView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.AdminEmailLogsView = window.Discourse.View.extend({
templateName: 'admin/templates/email_logs'
});
}).call(this);

View File

@ -1,15 +0,0 @@
(function() {
/**
A view for listing admin flags
@class AdminFlagsView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.AdminFlagsView = window.Discourse.View.extend({
templateName: 'admin/templates/flags'
});
}).call(this);

View File

@ -1,15 +0,0 @@
(function() {
/**
A view for dealing with site settings
@class AdminSiteSettingsView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.AdminSiteSettingsView = window.Discourse.View.extend({
templateName: 'admin/templates/site_settings'
});
}).call(this);

View File

@ -1,15 +0,0 @@
(function() {
/**
A view for showing a user in the admin section
@class AdminUserView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.AdminUserView = window.Discourse.View.extend({
templateName: 'admin/templates/user'
});
}).call(this);

View File

@ -1,15 +0,0 @@
(function() {
/**
A view for listing users in the admin section
@class AdminUsersListView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.AdminUsersListView = window.Discourse.View.extend({
templateName: 'admin/templates/users_list'
});
}).call(this);

View File

@ -1,15 +0,0 @@
(function() {
/**
A base view for the admin section
@class AdminView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.AdminView = window.Discourse.View.extend({
templateName: 'admin/templates/admin'
});
}).call(this);