1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

fix color of schedule forms and bugs found in color audit

This commit is contained in:
John Mitchell 2017-07-27 14:49:09 -04:00
parent 53700c10b9
commit 5f58f500cc
16 changed files with 65 additions and 36 deletions

View File

@ -2145,7 +2145,7 @@ tr td button i {
} }
.select2-container--default .select2-selection--single { .select2-container--default .select2-selection--single {
background-color: @field-secondary-bg; background-color: @f2grey;
border: 1px solid @d7grey; border: 1px solid @d7grey;
border-radius: 4px; border-radius: 4px;
} }

View File

@ -678,7 +678,7 @@ input[type='radio']:checked:before {
height: inherit; height: inherit;
min-height: 30px; min-height: 30px;
max-height: 120px; max-height: 120px;
overflow-y: scroll; overflow-y: hidden;
} }
.Form-variableHeightButtonGroup { .Form-variableHeightButtonGroup {

View File

@ -43,6 +43,9 @@ return {
activeEditState: 'inventories.edit.inventory_sources.edit', activeEditState: 'inventories.edit.inventory_sources.edit',
detailsClick: "$state.go('inventories.edit.inventory_sources.edit')", detailsClick: "$state.go('inventories.edit.inventory_sources.edit')",
well: false, well: false,
subFormTitles: {
sourceSubForm: i18n._('Source Details'),
},
fields: { fields: {
name: { name: {
label: i18n._('Name'), label: i18n._('Name'),
@ -64,7 +67,8 @@ return {
ngOptions: 'source.label for source in source_type_options track by source.value', ngOptions: 'source.label for source in source_type_options track by source.value',
ngChange: 'sourceChange(source)', ngChange: 'sourceChange(source)',
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
ngModel: 'source' ngModel: 'source',
hasSubForm: true
}, },
credential: { credential: {
label: i18n._('Credential'), label: i18n._('Credential'),
@ -79,6 +83,7 @@ return {
reqExpression: "cloudCredentialRequired", reqExpression: "cloudCredentialRequired",
init: "false" init: "false"
}, },
subForm: 'sourceSubForm',
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
watchBasePath: "credentialBasePath" watchBasePath: "credentialBasePath"
}, },
@ -98,7 +103,8 @@ return {
init: "false" init: "false"
}, },
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
watchBasePath: "projectBasePath" watchBasePath: "projectBasePath",
subForm: 'sourceSubForm'
}, },
inventory_file: { inventory_file: {
label: i18n._('Inventory File'), label: i18n._('Inventory File'),
@ -116,7 +122,8 @@ return {
dataTitle: i18n._('Inventory File'), dataTitle: i18n._('Inventory File'),
dataPlacement: 'right', dataPlacement: 'right',
dataContainer: "body", dataContainer: "body",
includeInventoryFileNotFoundError: true includeInventoryFileNotFoundError: true,
subForm: 'sourceSubForm'
}, },
source_regions: { source_regions: {
label: i18n._('Regions'), label: i18n._('Regions'),
@ -129,7 +136,8 @@ return {
awPopOver: "<p>" + i18n._("Click on the regions field to see a list of regions for your cloud provider. You can select multiple regions, or choose") + awPopOver: "<p>" + i18n._("Click on the regions field to see a list of regions for your cloud provider. You can select multiple regions, or choose") +
"<em>" + i18n._("All") + "</em> " + i18n._("to include all regions. Only Hosts associated with the selected regions will be updated.") + "</p>", "<em>" + i18n._("All") + "</em> " + i18n._("to include all regions. Only Hosts associated with the selected regions will be updated.") + "</p>",
dataContainer: 'body', dataContainer: 'body',
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)' ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
subForm: 'sourceSubForm'
}, },
instance_filters: { instance_filters: {
label: i18n._('Instance Filters'), label: i18n._('Instance Filters'),
@ -140,7 +148,8 @@ return {
awPopOverWatch: 'instanceFilterPopOver', awPopOverWatch: 'instanceFilterPopOver',
awPopOver: '{{ instanceFilterPopOver }}', awPopOver: '{{ instanceFilterPopOver }}',
dataContainer: 'body', dataContainer: 'body',
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)' ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
subForm: 'sourceSubForm'
}, },
group_by: { group_by: {
label: i18n._('Only Group By'), label: i18n._('Only Group By'),
@ -153,7 +162,8 @@ return {
awPopOverWatch: 'groupByPopOver', awPopOverWatch: 'groupByPopOver',
awPopOver: '{{ groupByPopOver }}', awPopOver: '{{ groupByPopOver }}',
dataContainer: 'body', dataContainer: 'body',
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)' ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
subForm: 'sourceSubForm'
}, },
inventory_script: { inventory_script: {
label : i18n._("Custom Inventory Script"), label : i18n._("Custom Inventory Script"),
@ -168,6 +178,7 @@ return {
init: "false" init: "false"
}, },
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
subForm: 'sourceSubForm'
}, },
custom_variables: { custom_variables: {
id: 'custom_variables', id: 'custom_variables',
@ -188,7 +199,8 @@ return {
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" + "<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' + '<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>', '<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
dataContainer: 'body' dataContainer: 'body',
subForm: 'sourceSubForm'
}, },
ec2_variables: { ec2_variables: {
id: 'ec2_variables', id: 'ec2_variables',
@ -211,7 +223,8 @@ return {
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" + "<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' + '<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>', '<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
dataContainer: 'body' dataContainer: 'body',
subForm: 'sourceSubForm'
}, },
vmware_variables: { vmware_variables: {
id: 'vmware_variables', id: 'vmware_variables',
@ -234,7 +247,8 @@ return {
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" + "<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' + '<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>', '<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
dataContainer: 'body' dataContainer: 'body',
subForm: 'sourceSubForm'
}, },
openstack_variables: { openstack_variables: {
id: 'openstack_variables', id: 'openstack_variables',
@ -257,7 +271,8 @@ return {
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" + "<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' + '<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>', '<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
dataContainer: 'body' dataContainer: 'body',
subForm: 'sourceSubForm'
}, },
verbosity: { verbosity: {
label: i18n._('Verbosity'), label: i18n._('Verbosity'),
@ -271,12 +286,14 @@ return {
dataPlacement: 'right', dataPlacement: 'right',
dataContainer: "body", dataContainer: "body",
ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)', ngDisabled: '!(inventory_source_obj.summary_fields.user_capabilities.edit || canAdd)',
subForm: 'sourceSubForm'
}, },
checkbox_group: { checkbox_group: {
label: i18n._('Update Options'), label: i18n._('Update Options'),
type: 'checkbox_group', type: 'checkbox_group',
ngShow: "source && (source.value !== '' && source.value !== null)", ngShow: "source && (source.value !== '' && source.value !== null)",
class: 'Form-checkbox--stacked', class: 'Form-checkbox--stacked',
subForm: 'sourceSubForm',
fields: [{ fields: [{
name: 'overwrite', name: 'overwrite',
label: i18n._('Overwrite'), label: i18n._('Overwrite'),
@ -345,7 +362,8 @@ return {
'and a new inventory sync will be performed.</p>', 'and a new inventory sync will be performed.</p>',
dataTitle: i18n._('Cache Timeout'), dataTitle: i18n._('Cache Timeout'),
dataPlacement: 'right', dataPlacement: 'right',
dataContainer: "body" dataContainer: "body",
subForm: 'sourceSubForm'
} }
}, },

View File

@ -78,7 +78,7 @@ export default ['i18n', 'InventoryCompletedJobsList', function(i18n, InventoryCo
dataTitle: i18n._('Instance Groups'), dataTitle: i18n._('Instance Groups'),
dataPlacement: 'right', dataPlacement: 'right',
dataContainer: 'body', dataContainer: 'body',
control: '<instance-groups-multiselect instance-groups="instance_groups"></instance-groups-multiselect>', control: '<instance-groups-multiselect instance-groups="instance_groups" field-is-disabled="!(inventory_obj.summary_fields.user_capabilities.edit || canAdd)"></instance-groups-multiselect>',
}, },
smartinventory_variables: { smartinventory_variables: {
label: i18n._('Variables'), label: i18n._('Variables'),

View File

@ -86,7 +86,7 @@ function(i18n, InventoryCompletedJobsList) {
dataTitle: i18n._('Instance Groups'), dataTitle: i18n._('Instance Groups'),
dataPlacement: 'right', dataPlacement: 'right',
dataContainer: 'body', dataContainer: 'body',
control: '<instance-groups-multiselect instance-groups="instance_groups"></instance-groups-multiselect>', control: '<instance-groups-multiselect instance-groups="instance_groups" field-is-disabled="!(inventory_obj.summary_fields.user_capabilities.edit || canAdd)"></instance-groups-multiselect>',
}, },
inventory_variables: { inventory_variables: {
realName: 'variables', realName: 'variables',

View File

@ -41,7 +41,7 @@ export default ['NotificationsList', 'i18n',
dataTitle: i18n._('Instance Groups'), dataTitle: i18n._('Instance Groups'),
dataContainer: 'body', dataContainer: 'body',
dataPlacement: 'right', dataPlacement: 'right',
control: '<instance-groups-multiselect instance-groups="instance_groups"></instance-groups-multiselect>', control: '<instance-groups-multiselect instance-groups="instance_groups" field-is-disabled="!(organization_obj.summary_fields.user_capabilities.edit || canAdd)"></instance-groups-multiselect>',
} }
}, },

View File

@ -3,7 +3,8 @@ export default ['templateUrl', '$compile',
function(templateUrl, $compile) { function(templateUrl, $compile) {
return { return {
scope: { scope: {
instanceGroups: '=' instanceGroups: '=',
fieldIsDisabled: '='
}, },
restrict: 'E', restrict: 'E',
templateUrl: templateUrl('shared/instance-groups-multiselect/instance-groups'), templateUrl: templateUrl('shared/instance-groups-multiselect/instance-groups'),

View File

@ -1,10 +1,12 @@
<div class="input-group Form-mixedInputGroup"> <div class="input-group Form-mixedInputGroup">
<span class="input-group-btn"> <span class="input-group-btn">
<button type="button" class="Form-lookupButton btn btn-default" ng-click="openInstanceGroupsModal()"> <button type="button" class="Form-lookupButton btn btn-default" ng-click="openInstanceGroupsModal()"
ng-disabled="fieldIsDisabled">
<i class="fa fa-search"></i> <i class="fa fa-search"></i>
</button> </button>
</span> </span>
<span id="InstanceGroups" class="form-control Form-textInput Form-textInput--variableHeight input-medium lookup LabelList-lookupTags"> <span id="InstanceGroups" class="form-control Form-textInput Form-textInput--variableHeight input-medium lookup LabelList-lookupTags"
ng-disabled="fieldIsDisabled">
<div class="LabelList-tagContainer" ng-repeat="tag in instanceGroupsTags"> <div class="LabelList-tagContainer" ng-repeat="tag in instanceGroupsTags">
<div class="LabelList-deleteContainer" <div class="LabelList-deleteContainer"
ng-click="deleteTag(tag)"> ng-click="deleteTag(tag)">

View File

@ -7,25 +7,26 @@
padding: 6px 12px; padding: 6px 12px;
font-size: 14px; font-size: 14px;
border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px;
border: 1px solid #ccc; border: 1px solid @b7grey;
border-right: 0; border-right: 0;
background-color: @default-bg; background-color: @default-bg;
} }
&-icon:hover { &-icon:hover {
background-color: @default-border; background-color: @f6grey;
} }
&-icon:focus, &-icon:focus,
&-icon:active { &-icon:active {
background-color: #ccc; background-color: @f6grey;
} }
&-input { &-input {
flex: 1 0 auto; flex: 1 0 auto;
border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0;
border: 1px solid #ccc; border: 1px solid @b7grey;
padding: 6px 12px; padding: 6px 12px;
background-color: @f2grey;
} }
&-input:focus, &-input:focus,

View File

@ -18,6 +18,7 @@
.DatePicker-input { .DatePicker-input {
width: 100%; width: 100%;
flex: none; flex: none;
background: @f2grey;
} }
.DatePicker-icon { .DatePicker-icon {

View File

@ -135,7 +135,8 @@ function(NotificationsList, CompletedJobsList, i18n) {
prompt="ask_credential_on_launch" prompt="ask_credential_on_launch"
selected-credentials="selectedCredentials" selected-credentials="selectedCredentials"
credential-not-present="credentialNotPresent" credential-not-present="credentialNotPresent"
credentials-to-post="credentialsToPost"> credentials-to-post="credentialsToPost"
field-is-disabled="!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)">
</multi-credential>`, </multi-credential>`,
required: true, required: true,
awPopOver: "<p>" + i18n._("Select credentials that allow {{BRAND_NAME}} to access the nodes this job will be ran against. You can only select one credential of each type.<br /><br />You must select either a machine (SSH) credential or \"Prompt on launch\". \"Prompt on launch\" requires you to select a machine credential at run time.<br /><br />If you select credentials AND check the \"Prompt on launch\" box, you make the selected credentials the defaults that can be updated at run time.") + "</p>", awPopOver: "<p>" + i18n._("Select credentials that allow {{BRAND_NAME}} to access the nodes this job will be ran against. You can only select one credential of each type.<br /><br />You must select either a machine (SSH) credential or \"Prompt on launch\". \"Prompt on launch\" requires you to select a machine credential at run time.<br /><br />If you select credentials AND check the \"Prompt on launch\" box, you make the selected credentials the defaults that can be updated at run time.") + "</p>",
@ -208,7 +209,7 @@ function(NotificationsList, CompletedJobsList, i18n) {
dataTitle: i18n._('Instance Groups'), dataTitle: i18n._('Instance Groups'),
dataContainer: 'body', dataContainer: 'body',
dataPlacement: 'right', dataPlacement: 'right',
control: '<instance-groups-multiselect instance-groups="instance_groups"></instance-groups-multiselect>', control: '<instance-groups-multiselect instance-groups="instance_groups" field-is-disabled="!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)"></instance-groups-multiselect>',
}, },
job_tags: { job_tags: {
label: i18n._('Job Tags'), label: i18n._('Job Tags'),

View File

@ -41,13 +41,14 @@
padding: 2px 10px; padding: 2px 10px;
margin: 4px 0px; margin: 4px 0px;
font-size: 12px; font-size: 12px;
color: @default-interface-txt;
background-color: @default-bg;
margin-right: 10px; margin-right: 10px;
max-width: 100%; max-width: 100%;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
background-color: @default-link;
color: @default-bg;
padding-left: 15px;
} }
.MultiCredential-tag--deletable { .MultiCredential-tag--deletable {
@ -56,9 +57,8 @@
border-bottom-left-radius: 0px; border-bottom-left-radius: 0px;
border-right: 0; border-right: 0;
max-width: ~"calc(100% - 23px)"; max-width: ~"calc(100% - 23px)";
background-color: @default-link;
color: @default-bg;
margin-right: 10px; margin-right: 10px;
padding-left: 10px;
} }
.MultiCredential-deleteContainer { .MultiCredential-deleteContainer {

View File

@ -12,7 +12,8 @@ export default ['templateUrl', '$compile',
selectedCredentials: '=', selectedCredentials: '=',
prompt: '=', prompt: '=',
credentialNotPresent: '=', credentialNotPresent: '=',
credentialsToPost: '=' credentialsToPost: '=',
fieldIsDisabled: '='
}, },
restrict: 'E', restrict: 'E',
templateUrl: templateUrl('templates/job_templates/multi-credential/multi-credential'), templateUrl: templateUrl('templates/job_templates/multi-credential/multi-credential'),

View File

@ -3,7 +3,8 @@
<button type="button" <button type="button"
class="Form-lookupButton class="Form-lookupButton
Form-lookupButton--variableHeight btn btn-default" Form-lookupButton--variableHeight btn btn-default"
ng-click="openMultiCredentialModal()"> ng-click="openMultiCredentialModal()"
ng-disabled="fieldIsDisabled">
<i class="fa fa-search"></i> <i class="fa fa-search"></i>
</button> </button>
</span> </span>
@ -13,6 +14,7 @@
'ng-invalid': credentialNotPresent, 'ng-invalid': credentialNotPresent,
'ng-dirty': fieldDirty 'ng-dirty': fieldDirty
}" }"
ng-disabled="fieldIsDisabled"
style="padding: 4px 6px;"> style="padding: 4px 6px;">
<div class="MultiCredential-tags"> <div class="MultiCredential-tags">
<div class="MultiCredential-tagSection"> <div class="MultiCredential-tagSection">
@ -20,12 +22,13 @@
<div class="MultiCredential-tagContainer ng-scope" <div class="MultiCredential-tagContainer ng-scope"
ng-repeat="tag in credentialsToPost track by $index"> ng-repeat="tag in credentialsToPost track by $index">
<div class="MultiCredential-deleteContainer" <div class="MultiCredential-deleteContainer"
ng-click="removeCredential(tag.id)"> ng-click="removeCredential(tag.id)"
ng-hide="fieldIsDisabled">
<i class="fa fa-times MultiCredential-tagDelete"> <i class="fa fa-times MultiCredential-tagDelete">
</i> </i>
</div> </div>
<div class="MultiCredential-tag <div class="MultiCredential-tag"
MultiCredential-tag--deletable"> ng-class="{!fieldIsDisabled: 'MultiCredential-tag--deletable'}">
<span class="MultiCredential-name--label <span class="MultiCredential-name--label
ng-binding"> ng-binding">
{{ tag.kind }} {{ tag.kind }}

View File

@ -88,6 +88,7 @@
.LabelList-lookupTags { .LabelList-lookupTags {
display: flex; display: flex;
padding: 0 12px; padding: 0 12px;
overflow-y: hidden;
} }
.LabelList-lookupTags--disabled { .LabelList-lookupTags--disabled {

View File

@ -302,7 +302,7 @@ export default
}, },
buttons: { buttons: {
question_cancel : { question_cancel : {
label: 'Cancel', label: 'Clear',
'class' : 'btn btn-default Form-cancelButton', 'class' : 'btn btn-default Form-cancelButton',
ngClick: 'generateAddQuestionForm()', ngClick: 'generateAddQuestionForm()',
ngDisabled: 'survey_question_form.$pristine' ngDisabled: 'survey_question_form.$pristine'