Skip to content

Instantly share code, notes, and snippets.

@svparijs
Forked from radmiraal/controllers.js
Created December 13, 2012 09:31
Show Gist options
  • Save svparijs/4275254 to your computer and use it in GitHub Desktop.
Save svparijs/4275254 to your computer and use it in GitHub Desktop.
App.ApplicationController = Ember.Controller.extend();
App.ApplicationView = Ember.View.extend({
templateName: "application"
});
App.DashboardController = Ember.Controller.extend();
App.DashboardView = Ember.View.extend({
templateName: "dashboard"
});
App.AdministrationController = Ember.Controller.extend();
App.AdministrationView = Ember.View.extend({
templateName: "administration"
});
App.ManagementController = Ember.Controller.extend();
App.ManagementView = Ember.View.extend({
templateName: "management"
});
App.SettingsController = Ember.Controller.extend();
App.SettingsView = Ember.View.extend({
templateName: "settings"
});
App.ModuleTaskController = Ember.Controller.extend();
App.ModuleTaskView = Ember.View.extend({
templateName: "module-fullwidth"
});
App.AllTodosController = Ember.Controller.extend();
App.AllTodosView = Ember.View.extend({
templateName: "alltodos"
});
App.DocumentController = Ember.Controller.extend();
App.DocumentView = Ember.View.extend({
templateName: "module-fullwidth"
});
App.DashboardWidgetController = Ember.Controller.extend();
App.DashboardWidgetView = Ember.View.extend({
templateName: "dashboardwidget"
});
App.Router = Ember.Router.extend({
root: Ember.Route.extend({
showDashboard: Ember.Route.transitionTo("dashboard"),
showModuleDocument: Ember.Route.transitionTo("moduleDocument"),
showModuleTask: Ember.Route.transitionTo("moduleTask"),
showManagement: Ember.Route.transitionTo("management"),
showAdministration: Ember.Route.transitionTo("administration"),
showSettings: Ember.Route.transitionTo("settings"),
dashboard: Ember.Route.extend({
route: "/",
connectOutlets: function(router) {
router.get("applicationController").connectOutlet("view", "dashboard", App.Todo.find());
}
}),
moduleDocument: Ember.Route.extend({
route: "/documents",
connectOutlets: function(router) {
router.get("applicationController").connectOutlet("view", "moduleDocument");
}
}),
moduleTask: Ember.Route.extend({
route: "/tasks",
connectOutlets: function(router) {
router.get("applicationController").connectOutlet("view", "moduleTask");
}
}),
management: Ember.Route.extend({
route: "/management",
connectOutlets: function(router) {
router.get("applicationController").connectOutlet("view", "management");
}
}),
administration: Ember.Route.extend({
route: "/administration",
connectOutlets: function(router) {
router.get("applicationController").connectOutlet("view", "administration");
}
}),
settings: Ember.Route.extend({
route: "/settings",
connectOutlets: function(router) {
router.get("applicationController").connectOutlet("view", "settings");
}
})
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment