horizon/horizon/static/framework/widgets/form/fields/radio-buttons.html

24 lines
1.0 KiB
HTML

<div class="form-group hz-radio-buttons {$::form.htmlClass$}"
ng-class="{'has-error': form.disableErrorState !== true && hasError(), 'has-success': form.disableSuccessState !== true && hasSuccess()}">
<div>
<label class="{$::form.labelHtmlClass$}" ng-show="showTitle()">{$::form.title$}</label>
</div>
<div class="btn-group">
<label sf-field-model="replaceAll" class="btn {$:: (item.value === $$value$$) ? form.style.selected || 'btn-default' : form.style.unselected || 'btn-default'; $}"
ng-class="{ active: item.value === $$value$$ }"
ng-repeat="item in form.titleMap">
<input type="radio"
class="{$::form.fieldHtmlClass$}"
sf-changed="form"
style="display: none;"
ng-disabled="form.readonly"
sf-field-model
schema-validate="form"
ng-value="item.value"
name="{$::form.key.join('.')$}">
<span>{$::item.name$}</span>
</label>
</div>
<div class="help-block" sf-message="form.description"></div>
</div>