mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 10:27:37 -02:30
add disabled toggle to job templte diff mode
This commit is contained in:
@@ -258,7 +258,8 @@
|
|||||||
</label>
|
</label>
|
||||||
<div>
|
<div>
|
||||||
<div class="ScheduleToggle" ng-class="{'is-on': other_prompt_data.diff_mode}" aw-tool-tip="" data-placement="top" data-original-title="" title="">
|
<div class="ScheduleToggle" ng-class="{'is-on': other_prompt_data.diff_mode}" aw-tool-tip="" data-placement="top" data-original-title="" title="">
|
||||||
<button ng-show="other_prompt_data.diff_mode" class="ScheduleToggle-switch is-on" ng-click="toggleForm('diff_mode')" translate>ON</button>
|
<button ng-show="other_prompt_data.diff_mode" class="ScheduleToggle-switch is-on" ng-click="toggleForm('diff_mode')"
|
||||||
|
translate>ON</button>
|
||||||
<button ng-show="!other_prompt_data.diff_mode" class="ScheduleToggle-switch ng-hide" ng-click="toggleForm('diff_mode')" translate>OFF</button>
|
<button ng-show="!other_prompt_data.diff_mode" class="ScheduleToggle-switch ng-hide" ng-click="toggleForm('diff_mode')" translate>OFF</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -758,10 +758,12 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
|
|||||||
|
|
||||||
html += label(labelOptions);
|
html += label(labelOptions);
|
||||||
|
|
||||||
html += `<div class="ScheduleToggle" ng-class="{'is-on': ${field.toggleSource}}" aw-tool-tip=""
|
html += `<div class="ScheduleToggle" ng-class="{'is-on': ${field.toggleSource}, 'ScheduleToggle--disabled': ${field.ngDisabled}}" aw-tool-tip=""
|
||||||
data-placement="top">
|
data-placement="top">
|
||||||
<button ng-show="${field.toggleSource}" class="ScheduleToggle-switch is-on" ng-click="toggleForm('${field.toggleSource}')">ON</button>
|
<button ng-show="${field.toggleSource}" class="ScheduleToggle-switch is-on" ng-click="toggleForm('${field.toggleSource}')"
|
||||||
<button ng-show="!${field.toggleSource}" class="ScheduleToggle-switch" ng-click="toggleForm('${field.toggleSource}')">OFF</button>
|
ng-disabled="${field.ngDisabled}">ON</button>
|
||||||
|
<button ng-show="!${field.toggleSource}" class="ScheduleToggle-switch" ng-click="toggleForm('${field.toggleSource}')"
|
||||||
|
ng-disabled="${field.ngDisabled}">OFF</button>
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -272,6 +272,7 @@ function(NotificationsList, CompletedJobsList, i18n) {
|
|||||||
variable: 'ask_diff_mode_on_launch',
|
variable: 'ask_diff_mode_on_launch',
|
||||||
text: i18n._('Prompt on launch')
|
text: i18n._('Prompt on launch')
|
||||||
},
|
},
|
||||||
|
ngDisabled: '!(job_template_obj.summary_fields.user_capabilities.edit || canAddJobTemplate)'
|
||||||
},
|
},
|
||||||
checkbox_group: {
|
checkbox_group: {
|
||||||
label: i18n._('Options'),
|
label: i18n._('Options'),
|
||||||
|
|||||||
Reference in New Issue
Block a user