1 angular.module('egLocalAdmin',
2 ['ngRoute', 'ui.bootstrap', 'egCoreMod','egUiMod'])
4 .config(['$routeProvider','$locationProvider','$compileProvider',
5 function($routeProvider , $locationProvider , $compileProvider) {
7 $locationProvider.html5Mode(true);
8 $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/);
9 var resolver = {delay : function(egStartup) {return egStartup.go()}};
12 '<eg-embed-frame url="local_admin_url" handlers="funcs"></eg-embed-frame>';
14 // non-conify routes come first
15 $routeProvider.when('/admin/local/money/cash_reports', {
16 template: eframe_template,
17 controller: 'CashReportsCtl', // non-conify
21 // Conify page handler
22 $routeProvider.when('/admin/local/:schema/:page', {
23 template: eframe_template,
24 controller: 'EmbedConifyCtl',
29 $routeProvider.otherwise({
30 templateUrl : './admin/local/t_splash',
35 .controller('EmbedConifyCtl',
36 ['$scope','$routeParams','$location','egCore',
37 function($scope , $routeParams , $location , egCore) {
40 ses : egCore.auth.token(),
43 var conify_path = '/eg/conify/global/' +
44 $routeParams.schema + '/' + $routeParams.page;
46 // embed URL must include protocol/domain or it will be loaded via
47 // push-state, resulting in an infinitely nested pages.
48 $scope.local_admin_url =
49 $location.absUrl().replace(/\/eg\/staff.*/, conify_path);
51 console.log('Loading local admin URL: ' + $scope.local_admin_url);
55 .controller('CashReportsCtl',
56 ['$scope','$location','egCore',
57 function($scope , $location , egCore) {
58 $scope.local_admin_url = $location.absUrl().replace(
59 /\/.*/, '/xul/server/admin/cash_reports.xhtml');
61 // old-school XUL admin UI's only want CGI ses values.
62 $scope.local_admin_url += '?ses=' + egCore.auth.token();
64 console.log('Loading local admin URL: ' + $scope.local_admin_url);