| 1 | (function(angular, $, _) { |
| 2 | // Declare a list of dependencies. |
| 3 | angular.module('statuspage', [ |
| 4 | 'crmUi', 'crmUtil', 'ngRoute' |
| 5 | ]); |
| 6 | |
| 7 | // router |
| 8 | |
| 9 | angular.module('statuspage').config( function($routeProvider) { |
| 10 | $routeProvider.when('/status', { |
| 11 | controller: 'statuspageStatusPage', |
| 12 | templateUrl: '~/statuspage/StatusPage.html', |
| 13 | |
| 14 | resolve: { |
| 15 | statuses: function(statuspageGetStatuses) { |
| 16 | return statuspageGetStatuses({is_visible: 1}); |
| 17 | }, |
| 18 | statusModel: function(statuspageStatusModel) { |
| 19 | return statuspageStatusModel(); |
| 20 | }, |
| 21 | preferences: function(statuspageGetPreferences){ |
| 22 | return statuspageGetPreferences(); |
| 23 | } |
| 24 | } |
| 25 | }); |
| 26 | |
| 27 | $routeProvider.when('/status/hushed', { |
| 28 | controller: 'statuspageStatusPage', |
| 29 | templateUrl: '~/statuspage/StatusPage.html', |
| 30 | |
| 31 | resolve: { |
| 32 | statuses: function(statuspageGetStatuses) { |
| 33 | return statuspageGetStatuses({is_visible: 0}); |
| 34 | }, |
| 35 | statusModel: function(statuspageStatusModel) { |
| 36 | return statuspageStatusModel(); |
| 37 | }, |
| 38 | preferences: function(statuspageGetPreferences){ |
| 39 | return statuspageGetPreferences(); |
| 40 | } |
| 41 | } |
| 42 | }); |
| 43 | |
| 44 | } |
| 45 | ); |
| 46 | })(angular, CRM.$, CRM._); |