e178834244
The form-field radio button functionality has been extended to support separate specification of button label and value. Previously, a single value was used for both items. Change-Id: Id050c47f5fff9e10f4191e03b43ad4fb414ddf2f
57 lines
1.8 KiB
HTML
57 lines
1.8 KiB
HTML
<div class="form-group"
|
|
ng-class="{'has-error': form[field.id].$invalid &&
|
|
form[field.id].$dirty}">
|
|
<label for="{$ field.id $}"
|
|
class="control-label">{$ field.title $}</label>
|
|
<span ng-if="field.desc"
|
|
class="help-icon"
|
|
data-container="body"
|
|
data-html="true"
|
|
title=""
|
|
data-toggle="tooltip"
|
|
data-original-title="{$ field.desc $}">
|
|
<span class="fa fa-question-circle"></span>
|
|
</span>
|
|
<span ng-if="field.info"
|
|
class="help-icon"
|
|
data-container="body"
|
|
data-html="true"
|
|
title=""
|
|
data-toggle="tooltip"
|
|
data-original-title="{$ field.info $}">
|
|
<span class="fa fa-info-circle"></span>
|
|
</span>
|
|
<span ng-if="field.required"
|
|
class="hz-icon-required fa fa-asterisk"></span>
|
|
<div ng-switch="field.type">
|
|
<input ng-switch-when="input"
|
|
type="text"
|
|
class="form-control"
|
|
ng-model="field.value"
|
|
id="{$ field.id $}"
|
|
name="{$ field.id $}"
|
|
ng-required="field.required"
|
|
ng-disabled="field.disabled"
|
|
ng-pattern="field.pattern"
|
|
ng-change="{$ field.change $}"
|
|
placeholder="{$ field.desc $}"/>
|
|
<div ng-switch-when="radio"
|
|
class="btn-group"
|
|
id="{$ field.id $}">
|
|
<label class="btn btn-default"
|
|
ng-model="field.value"
|
|
ng-repeat="opt in field.options"
|
|
ng-disabled="field.disabled"
|
|
uib-btn-radio="opt.value">{$ opt.label $}</label>
|
|
</div>
|
|
<div ng-switch-when="select">
|
|
<select id="field.id"
|
|
class="form-control"
|
|
ng-disabled="field.disabled"
|
|
ng-options="{$ field.options $}"
|
|
ng-model="field.value">
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|