');
}
html.push('');
if (!this.vertical) {
html.push('
');
}
html.push('
');
this.$form.append(html.join(''));
},
_append : function(html, field, isFieldStart) {
var that = this;
var required = field.required;
var name = field.name;
var type = field.type;
if (type == 'separator') {
html.push(this.vertical ? ''
: '
');
html.push('');
html.push('
');
return;
}
var title = field.title;
var disabled = field.disabled;
var help = field.help;
var value = field.value;
var showLabel = field.showLabel;
var col = '';
var labelColumn = '';
if (!this.vertical) {
col = field.col || 'col-xs-8';
}
if (showLabel === undefined) {
showLabel = 'checkbox' !== type && 'button' !== type
&& 'radio' !== type;
showLabel = showLabel || field.options !== undefined;
}
var id = that.prefix + '_' + name;
if (title === undefined) {
title = name.replace(/_/g, ' ');
title = title[0].toUpperCase() + title.substring(1);
}
if (showLabel) {
html.push('');
if (isFieldStart) {
html.push('
');
}
} else if (isFieldStart && !this.vertical) {
html.push('
');
}
if ('radio' === type) {
if (field.options) {
_.each(field.options,
function(choice) {
var isChoiceObject = _.isObject(choice)
&& choice.value !== undefined;
var optionValue = isChoiceObject ? choice.value
: choice;
var optionText = isChoiceObject ? choice.name
: choice;
var selected = value === optionValue;
html.push('');
});
} else {
html.push('');
}
} else if ('checkbox' === type) {
html.push('');
} else if ('checkbox-list' === type) {
html.push('
');
} else if ('select' == type || type == 'bootstrap-select') {
// if (field.multiple) {
// field.type = 'bootstrap-select';
// type = 'bootstrap-select';
// }
if (type == 'bootstrap-select') {
html.push('');
if (field.type == 'bootstrap-select' && field.toggle) {
html.push('