ui/lib/shared/addon/components/form-sources-row/template.hbs

73 lines
1.9 KiB
Handlebars

<td data-title="{{t 'formSources.kind.label'}}">
{{#if editing}}
{{new-select
classNames="form-control"
optionValuePath="id"
content=sources
value=source.source
}}
{{else}}
{{#if source.source}}
{{source.source}}
{{else}}
<span class="text-muted">{{t 'generic.na'}}</span>
{{/if}}
{{/if}}
</td>
<td>&nbsp;</td>
<td data-title="{{t 'formSources.kind.label'}}">
{{#if (and editing (eq source.source 'secret'))}}
{{schema/input-secret
namespace=namespace
value=source.sourceName
valueKey='name'
selectedSecret=selectedSecret
}}
{{else if (and editing (eq source.source 'configMap'))}}
{{schema/input-config-map
namespace=namespace
value=source.sourceName
valueKey='name'
selectedConfigMap=selectedConfigMap
}}
{{else}}
{{#if source}}
{{source.sourceName}}
{{else}}
<span class="text-muted">{{t 'generic.na'}}</span>
{{/if}}
{{/if}}
</td>
<td>&nbsp;</td>
<td data-title="{{t 'formSources.prefixOrKey.label'}}">
{{searchable-select
classNames="form-control"
optionValuePath="id"
optionLabelPath="label"
content=prefixOrKeys
value=source.sourceKey
readOnly=(or (not source.sourceName) (not editing))
}}
</td>
<td>
<div class="text-center">
{{#if (eq source.sourceKey null)}}
{{t 'generic.prefix'}}
{{else}}
{{t 'generic.as'}}
{{/if}}
</div>
</td>
<td data-title="{{t 'formSources.prefix.label'}}">
{{#input-or-display editable=editing value=prefixOrTarget classesForDisplay="text-muted form-control-static"}}
{{input type="text" value=prefixOrTarget classNames="form-control" disabled=(not source.sourceName)}}
{{/input-or-display}}
</td>
<td>
{{#if editing}}
<button class="btn bg-primary btn-sm" {{action remove source}}>
<i class="icon icon-minus"/><span class="sr-only">{{t 'generic.remove'}}</span>
</button>
{{/if}}
</td>