From 1bc9ab68ebedad9f8f85ba8db7db45923a76f293 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Thu, 20 Mar 2014 12:25:20 -0400 Subject: [PATCH] Moved jqueryui dialog creation to a shared module along with textarea auto-sizing. Inventory host edit dialog is now constructed using this new module. Fixed host enabled flag on the host edit dialog so that it is disabled for externally managed hosts. --- awx/ui/static/js/forms/Hosts.js | 8 +- awx/ui/static/js/helpers/Groups.js | 11 ++ awx/ui/static/js/helpers/Hosts.js | 117 ++++++++---- awx/ui/static/js/helpers/Variables.js | 3 +- awx/ui/static/less/jquery-ui-overrides.less | 4 + awx/ui/static/lib/ansible/Modal.js | 189 ++++++++++++++++++++ awx/ui/static/lib/ansible/form-generator.js | 1 + awx/ui/static/partials/inventory-edit.html | 2 + awx/ui/templates/ui/index.html | 1 + 9 files changed, 300 insertions(+), 36 deletions(-) create mode 100644 awx/ui/static/lib/ansible/Modal.js diff --git a/awx/ui/static/js/forms/Hosts.js b/awx/ui/static/js/forms/Hosts.js index e056811ed1..eee79408ca 100644 --- a/awx/ui/static/js/forms/Hosts.js +++ b/awx/ui/static/js/forms/Hosts.js @@ -30,7 +30,7 @@ angular.module('HostFormDefinition', []) "", dataTitle: 'Host Name', dataPlacement: 'right', - dataContainer: '#form-modal .modal-content' + dataContainer: 'body' }, description: { label: 'Description', @@ -48,7 +48,7 @@ angular.module('HostFormDefinition', []) "are part of an external inventory, this flag cannot be changed. It will be set by the inventory sync process.

", dataTitle: 'Host Enabled', dataPlacement: 'right', - dataContainer: '#form-modal .modal-content', + dataContainer: 'body', ngDisabled: 'has_inventory_sources == true' }, variables: { @@ -68,7 +68,7 @@ angular.module('HostFormDefinition', []) '

View YAML examples at docs.ansible.com

', dataTitle: 'Host Variables', dataPlacement: 'right', - dataContainer: '#form-modal .modal-content' + dataContainer: 'body' }, inventory: { type: 'hidden', @@ -78,6 +78,7 @@ angular.module('HostFormDefinition', []) }, buttons: { //for now always generates