Skip to content

Commit

Permalink
Add second param conf for shortcuts to conf files
Browse files Browse the repository at this point in the history
  • Loading branch information
LFDM committed May 10, 2014
1 parent 10f1b4d commit 599f469
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion app/js/arethusa.core/routes/main.constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@ 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 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;
} else if (params.conf_file) {
confUrl = params.conf_file;
} else {
confUrl = files.default;
}

return $http({
method: 'GET',
url: $route.current.params.conf || './static/configuration_default.json'
url: confUrl,
}).then(function(result) {
configurator.configuration = result.data;
});
Expand Down

0 comments on commit 599f469

Please sign in to comment.