From 14ed59bedf8fd11a9573da2344b3dcf1b50ae51d Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Sun, 30 Jun 2013 04:34:26 -0400 Subject: [PATCH] AC-175 dynamically set Event link color and cursor for each row. Used ng-class to dynamically set a css class. Now child rows that cannot be expanded appear to have no link -the text color is charcoal and the cursor is the default arrow. --- awx/ui/static/css/ansible-ui.css | 5 +++++ awx/ui/static/js/controllers/JobEvents.js | 4 ++++ awx/ui/static/js/helpers/Children.js | 4 ++++ awx/ui/static/js/lists/JobEvents.js | 3 ++- awx/ui/static/lib/ansible/generator-helpers.js | 2 +- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/awx/ui/static/css/ansible-ui.css b/awx/ui/static/css/ansible-ui.css index b349eca375..3f67846fd2 100644 --- a/awx/ui/static/css/ansible-ui.css +++ b/awx/ui/static/css/ansible-ui.css @@ -386,6 +386,11 @@ margin-top: 25px; } + .child-event a { + color: #36454F; + cursor: default; + } + /* End Jobs Page */ diff --git a/awx/ui/static/js/controllers/JobEvents.js b/awx/ui/static/js/controllers/JobEvents.js index 582f4e6e63..b26219eed9 100644 --- a/awx/ui/static/js/controllers/JobEvents.js +++ b/awx/ui/static/js/controllers/JobEvents.js @@ -28,6 +28,9 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest, $rootScope.flashMessage = null; scope.selected = []; scope.expand = true; //on load, automatically expand all nodes + + scope.parentNode = 'parent-event'; // used in ngClass to dynamicall set row level class and control + scope.childNode = 'child-event'; // link color and cursor if (scope.RemovePostRefresh) { scope.RemovePostRefresh(); @@ -44,6 +47,7 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest, set[i]['ngicon'] = 'icon-expand-alt'; set[i]['level'] = 0; set[i]['spaces'] = 0; + set[i]['class'] = 'parentNode'; } scope.jobevents[i].status = (scope.jobevents[i].failed) ? 'error' : 'success'; cDate = new Date(set[i].created); diff --git a/awx/ui/static/js/helpers/Children.js b/awx/ui/static/js/helpers/Children.js index d604c5f601..3b153d5dea 100644 --- a/awx/ui/static/js/helpers/Children.js +++ b/awx/ui/static/js/helpers/Children.js @@ -54,6 +54,10 @@ angular.module('ChildrenHelper', ['RestServices', 'Utilities']) if (data.results[j].related.children) { data.results[j]['ngclick'] = "toggleChildren(" + data.results[j].id + ", \"" + data.results[j].related.children + "\")"; data.results[j]['ngicon'] = 'icon-expand-alt'; + data.results[j]['class'] = 'parentNode'; + } + else { + data.results[j]['class'] = 'childNode'; } if (clicked == (set.length - 1)) { set.push(data.results[j]); diff --git a/awx/ui/static/js/lists/JobEvents.js b/awx/ui/static/js/lists/JobEvents.js index 8dc69e7c7d..defbf8fbc9 100644 --- a/awx/ui/static/js/lists/JobEvents.js +++ b/awx/ui/static/js/lists/JobEvents.js @@ -40,7 +40,8 @@ angular.module('JobEventsListDefinition', []) hasChildren: true, ngClick: "toggleChildren(\{\{ jobevent.id \}\}, '\{\{ jobevent.related.children \}\}')", nosort: true, - searchable: false + searchable: false, + ngClass: '\{\{ jobevent.class \}\}' }, host: { label: 'Host', diff --git a/awx/ui/static/lib/ansible/generator-helpers.js b/awx/ui/static/lib/ansible/generator-helpers.js index 3b00c38b54..981dc3ae6f 100644 --- a/awx/ui/static/lib/ansible/generator-helpers.js +++ b/awx/ui/static/lib/ansible/generator-helpers.js @@ -84,7 +84,7 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers']) html += "