ui/app/components/form-container-links/template.hbs

62 lines
2.3 KiB
Handlebars

<div class="row form-group">
<div class="col-sm-12 col-md-2 form-label">
<label>{{t 'formContainerLinks.label'}}</label>
</div>
<div class="col-sm-12 col-md-8">
{{#unless editing}}
<div>
{{#if containersOnRequestedHostIfUnmanaged.length}}
<button class="btn-circle" {{action "addLink"}}><i class="icon icon-plus-circle"/> {{t 'formContainerLinks.addActionLabel'}}</button>
{{else}}
<span class="text-muted">{{t 'formContainerLinks.noContainers'}}</span>
{{/if}}
</div>
{{/unless}}
{{#if linksArray.length}}
<table class="table fixed no-lines no-top-padding tight small">
<tr class="text-muted">
<th>{{t 'formContainerLinks.targetInstance.label'}}</th>
<th width="30">&nbsp;</th>
<th>{{t 'formContainerLinks.name.label'}}</th>
<th width="30">&nbsp;</th>
</tr>
{{#each linksArray as |link|}}
<tr>
<td>
{{new-select
classNames="form-control link-container input-sm"
prompt="formContainerLinks.targetInstance.prompt"
value=link.targetInstanceId
content=containersOnRequestedHostIfUnmanaged
optionValuePath="id"
optionLabelPath="name"
optionGroupPath="group"
}}
</td>
<td class="text-center">
<p class="form-control-static"><i class="icon icon-chevron-right"></i></p>
</td>
<td>
{{#if editing}}
<p class="form-control-static input-sm text-muted">{{link.name}}</p>
{{else}}
{{input class="form-control input-sm" type="text" value=link.name placeholder=(t 'formContainerLinks.name.placeholder')}}
{{/if}}
</td>
<td class="text-right">
{{#unless link.existing}}
<button class="btn btn-primary btn-sm" {{action "removeLink" link}}><i class="icon icon-minus"/><span class="sr-only">{{t 'generic.remove'}}</span></button>
{{/unless}}
</td>
</tr>
{{/each}}
</table>
{{else}}
{{#if editing}}
<span class="text-center text-muted">{{t 'formContainerLinks.noLinks'}}</span>
{{/if}}
{{/if}}
</div>
</div>