-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapp.js
More file actions
98 lines (78 loc) · 3.22 KB
/
Copy pathapp.js
File metadata and controls
98 lines (78 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
Copyright (c) 2015.
This file is part of Project Manager.
Project Manager is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Project Manager is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Project Manager. If not, see <http://www.gnu.org/licenses/>. */
var appManagerMSF = angular.module("appManagerMSF", ['ngRoute','Dhis2Api','pascalprecht.translate','ui.bootstrap','d2Menu', 'angularFileUpload','angularTreeview','door3.css']);
appManagerMSF.config(function($routeProvider) {
$routeProvider.when('/dataapproval', {
templateUrl: "modules/dataapproval/dataapprovalView.html",
controller: "dataapprovalController"
});
$routeProvider.when('/metadataimport', {
templateUrl: "modules/metadataimport/metadataimportView.html",
controller: "metadataimportController"
});
$routeProvider.when('/metadataexport', {
templateUrl: "modules/metadataexport/metadataexportView.html",
controller: "metadataexportController"
});
$routeProvider.when('/analytics', {
templateUrl: "modules/analytics/analyticsView.html",
controller: "analyticsController"
});
$routeProvider.when('/dataimport', {
templateUrl: "modules/dataimport/dataimportView.html",
controller: "dataimportController"
});
$routeProvider.when('/dataexport', {
templateUrl: "modules/dataexport/dataexportView.html",
controller: "dataexportController"
});
$routeProvider.when('/resetpasswd', {
templateUrl: "modules/resetpasswd/resetpasswdView.html",
controller: "resetpasswdController"
});
$routeProvider.when('/availabledata', {
templateUrl: "modules/availabledata/availabledataView.html",
controller: "availabledataController",
css: "modules/availabledata/availabledataCss.css"
});
$routeProvider.otherwise({
redirectTo: '/'
});
});
appManagerMSF.config(function ($translateProvider, urlApi) {
$translateProvider.useStaticFilesLoader({
prefix: 'languages/',
suffix: '.json'
});
$translateProvider.registerAvailableLanguageKeys(
['es', 'fr', 'en'],
{
'en*': 'en',
'es*': 'es',
'fr*': 'fr',
'*': 'en' // must be last!
}
);
$translateProvider.fallbackLanguage(['en']);
jQuery.ajax({ url: urlApi + 'userSettings/keyUiLocale/', contentType: 'text/plain', method: 'GET', dataType: 'text', async: false}).success(function (uiLocale) {
if (uiLocale == ''){
$translateProvider.determinePreferredLanguage();
}
else{
$translateProvider.use(uiLocale);
}
}).fail(function () {
$translateProvider.determinePreferredLanguage();
});
});