nci/static/js/app/app.js

32 lines
738 B
JavaScript
Raw Normal View History

2015-04-10 20:17:03 +00:00
'use strict';
2015-04-12 22:41:09 +00:00
define([
2015-05-09 20:19:25 +00:00
'react',
'react-router',
'templates/app/index', 'app/components/index',
'app/actions/project', 'app/actions/build'
2015-04-12 22:41:09 +00:00
], function(
2015-05-09 20:19:25 +00:00
React,
Router,
template, Components,
ProjectActions, BuildActions
2015-04-12 22:41:09 +00:00
) {
2015-05-09 20:19:25 +00:00
var Route = React.createFactory(Router.Route),
DefaultRoute = React.createFactory(Router.DefaultRoute);
var routes = (
Route({name: 'dashboard', path: '/', handler: Components.App},
Route({name: 'projects', path: '/projects', handler: Components.ProjectsComponents.List})
)
);
Router.run(routes, Router.HistoryLocation, function(Handler) {
React.render(template({
Component: Handler
}), document.getElementById('content'));
});
2015-05-03 23:04:51 +00:00
ProjectActions.readAll();
BuildActions.readAll();
2015-04-10 20:17:03 +00:00
});