mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 15:21:13 +03:00
Shows the button the add a JT to users with permissions to make JTs.
This commit is contained in:
parent
14d86ef5d3
commit
be507dbefb
@ -1,8 +1,7 @@
|
||||
/* jshint unused: vars */
|
||||
export default
|
||||
[ 'templateUrl',
|
||||
'$state',
|
||||
function JobTemplatesList(templateUrl, $state) {
|
||||
['templateUrl', '$state', 'Rest', 'GetBasePath',
|
||||
function JobTemplatesList(templateUrl, $state, Rest, GetBasePath) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
link: link,
|
||||
@ -25,6 +24,18 @@ export default
|
||||
}
|
||||
});
|
||||
|
||||
scope.canAddJobTemplate = false;
|
||||
let url = GetBasePath('job_templates');
|
||||
Rest.setUrl(url);
|
||||
Rest.options()
|
||||
.then(({ data }) => {
|
||||
if (!data.actions.POST) {
|
||||
scope.canAddJobTemplate = false;
|
||||
} else {
|
||||
scope.canAddJobTemplate = true;
|
||||
}
|
||||
});
|
||||
|
||||
function createList(list) {
|
||||
// smartStatus?, launchUrl, editUrl, name
|
||||
scope.templates = _.map(list, function(template){ return {
|
||||
|
@ -53,7 +53,9 @@
|
||||
<div class="DashboardList-container">
|
||||
<p class="DashboardList-noJobs"><translate>No job templates were recently used.</translate><br />
|
||||
<!-- TODO: Seems $sce.trustAsHtml() does not work here. -->
|
||||
<translate>You can create a job template <a href="#/templates/add_job_template">here</a>.</translate></p>
|
||||
<div ng-show="canAddJobTemplate">
|
||||
<translate>You can create a job template <a href="#/templates/add_job_template">here</a>.</translate></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<prompt prompt-data="promptData" on-finish="launchJob()"></prompt>
|
||||
|
Loading…
Reference in New Issue
Block a user