Skip to content

Commit

Permalink
Merge pull request #56 from latin-language-toolkit/more_routing
Browse files Browse the repository at this point in the history
Routing
  • Loading branch information
LFDM committed May 10, 2014
2 parents 2ea3b80 + e14b3ea commit fa0be08
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/js/arethusa.core/routes/main.constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@ angular.module('arethusa.core').constant('MAIN_ROUTE', {
template: '<div ng-include="template"></div>',
resolve: {
loadConfiguration: function($q, $http, $route, configurator) {
var files = {
default: './static/configuration_default.json',
staging: './static/configuration1.json'
};
var params = $route.current.params;
var confPath = './static/configs/';
var confUrl;

// Fall back to default and wrong paths to conf files
// need to be handled separately eventually
if (params.conf) {
confUrl = files[params.conf] || files.default;
confUrl = confPath + params.conf + '.json';
} else if (params.conf_file) {
confUrl = params.conf_file;
} else {
confUrl = files.default;
confUrl = confPath + 'default.json';
}

return $http({
Expand Down
1 change: 1 addition & 0 deletions app/js/arethusa.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ angular.module(
],
function($routeProvider, MAIN_ROUTE) {
$routeProvider.when('/', MAIN_ROUTE);
$routeProvider.when('/:conf', MAIN_ROUTE);
}
);
File renamed without changes.
File renamed without changes.

0 comments on commit fa0be08

Please sign in to comment.