Commit 12c6fd36 authored by colemanw's avatar colemanw

CRM-13823 - Switch statusPage to use tabbed interface

parent 7a9da175
......@@ -13,24 +13,7 @@
resolve: {
statuses: function(statuspageGetStatuses) {
return statuspageGetStatuses({is_visible: 1});
},
statusModel: function(statuspageStatusModel) {
return statuspageStatusModel();
},
preferences: function(statuspageGetPreferences){
return statuspageGetPreferences();
}
}
});
$routeProvider.when('/status/hushed', {
controller: 'statuspageStatusPage',
templateUrl: '~/statuspage/StatusPage.html',
resolve: {
statuses: function(statuspageGetStatuses) {
return statuspageGetStatuses({is_visible: 0});
return statuspageGetStatuses({sequential: 1});
},
statusModel: function(statuspageStatusModel) {
return statuspageStatusModel();
......
......@@ -5,38 +5,46 @@
<form name="crm-system-status" crm-ui-id-scope>
<div>
<h1>Status Page</h1><br />
<button ng-if="(path === '/status/hushed')" ng-click="navigator.redirect('#/status')">Return home</button>
<button ng-if="(path === '/status')" ng-click="navigator.redirect('#/status/hushed')">Show snoozed and hushed</button>
<h1>Status Page</h1>
</div>
<div id="crm-status-list" ng-repeat="status in statuses.values track by status.name" >
<h3 class="crm-severity-{{status.severity}}">
<i ng-if="status.icon" class="crm-i {{status.icon}}"></i>
{{status.title}}
<span class="status-snooze-options" ng-show="status.snoozeOptions.show" style="display: inline-block">
<div crm-snooze-options style="display: inline"></div>
</span>
<a ng-if="(path === '/status')" ng-click="showSnoozeOptions(status)" ng-show="!status.snoozeOptions.show" class="crm-hover-button" crm-icon="fa-clock-o" title="{{ts('Snooze')}}"></a>
<a ng-click="showSnoozeOptions(status)" ng-show="status.snoozeOptions.show" class="crm-hover-button" crm-icon="fa-times" style="display: inline" title="{{ts('Close')}}"></a>
<a ng-if="(path === '/status')" ng-click="hush(status.name, status.severity)" class="crm-hover-button" crm-icon="fa-bell-slash-o" title="{{ts('Hush')}}"></a>
<a ng-if="(path === '/status/hushed')" ng-click="unhush(status.name)" class="crm-hover-button" crm-icon="fa-bell-o" title="{{ts('Unhush And Unsnooze')}}"></a>
</h3>
<h4>
<div class="crm-block">
<div class="crm-group">
<div class="crm-status-message-body">
<span ng-bind-html="status.message | trusted"></span>
<a
ng-if="status.help"
class="helpicon"
ng-click="alert(status.help, status.title, 'info');"
href="javascript:void(0)"
>
</a>
<div crm-ui-tab-set>
<div
ng-repeat="tab in [{is_visible: 1, name: 'visible'}, {is_visible: 0, name: 'hidden'}]"
crm-ui-tab id="tab-{{tab.name}}"
crm-title="tab.is_visible ? ts('Active') : ts('Hushed/Snoozed')"
>
<div id="crm-status-list" ng-repeat="status in statuses.values | filter:{is_visible: tab.is_visible}" >
<h3 class="crm-severity-{{status.severity}}">
<i ng-if="status.icon" class="crm-i {{status.icon}}"></i>
{{status.title}}
<span class="status-snooze-options" ng-show="status.snoozeOptions.show" style="display: inline-block">
<div crm-snooze-options style="display: inline"></div>
</span>
<a ng-if="status.is_visible" ng-click="showSnoozeOptions(status)" ng-show="!status.snoozeOptions.show" class="crm-hover-button" crm-icon="fa-clock-o" title="{{ts('Snooze')}}"></a>
<a ng-click="showSnoozeOptions(status)" ng-show="status.snoozeOptions.show" class="crm-hover-button" crm-icon="fa-times" style="display: inline" title="{{ts('Close')}}"></a>
<a ng-if="status.is_visible" ng-click="hush(status.name, status.severity)" class="crm-hover-button" crm-icon="fa-bell-slash-o" title="{{ts('Hush')}}"></a>
<a ng-if="!status.is_visible" ng-click="unhush(status.name)" class="crm-hover-button" crm-icon="fa-bell-o" title="{{ts('Unhush And Unsnooze')}}"></a>
</h3>
<h4>
<div class="crm-block">
<div class="crm-group">
<div class="crm-status-message-body">
<span ng-bind-html="status.message | trusted"></span>
<a
ng-if="status.help"
class="helpicon"
ng-click="alert(status.help, status.title, 'info');"
href="javascript:void(0)"
>
</a>
</div>
</div>
</div>
</div>
</h4><br/>
</div>
</h4><br/>
</div>
</div>
</form>
......
......@@ -3,13 +3,9 @@
// controller
angular.module('statuspage').controller('statuspageStatusPage',
function($scope, $location, crmApi, crmStatus, crmUiHelp, statuses, crmNavigator, preferences) {
// The ts() and hs() functions help load strings for this module.
var ts = $scope.ts = CRM.ts('statuspage');
// var hs = $scope.hs = crmUiHelp({file: 'CRM/statuspage/StatusPage'}); // See: templates/CRM/statuspage/StatusPage.hlp
function($scope, crmApi, crmStatus, crmUiHelp, statuses, preferences) {
$scope.path = $location.path();
$scope.navigator = crmNavigator;
var ts = $scope.ts = CRM.ts();
$scope.statuses = statuses;
$scope.preferences = preferences;
$scope.alert = CRM.alert;
......@@ -33,7 +29,6 @@
return crmStatus(
{ start: ts('Saving Status Preference...') , success: ts('Preference Saved') },
crmApi('StatusPreference', 'create', {
"sequential": 1,
"name": name,
"ignore_severity": 0,
"hush_until": ""
......@@ -48,7 +43,6 @@
return crmStatus(
{ status: ts('Saving Status Preference...') , success: ts('Preference Saved') },
crmApi('StatusPreference', 'create', {
"sequential": 1,
"name": status.name,
"ignore_severity": status.snoozeOptions.severity,
"hush_until": status.snoozeOptions.until
......
......@@ -29,7 +29,6 @@
_.each(apiResults.values, function(status){
status.severity_id = status.severity;
status.severity = statuspageSeverityList[status.severity];
status.displayTitle = status.name+' - '+status.title +' - '+status.severity.toUpperCase();
status.snoozeOptions = {
show: false,
severity: status.severity
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment