pub enum FType {
Text,
TextArea,
+ Check,
Select,
}
<textarea class="form-control{%if help %} is-invalid{% endif %}" name="{{ name }}" id="{{ name }}" rows="{{ rows }}">{{ value }}</textarea>
{% if help %}<div id="helpBox_{{ name }}_" class="invalid-feedback">{{ help }}</div>{% endif %}
{% if label %}</div>{% endif %}"#);
+ },
+ FType::Check => {
+ f.tmpl.add_raw_template("field", r#"<div class="form-check">
+ <input type="checkbox" class="form-check-input{% if help %} is-invalid{% endif %}" name="{{ name }}" id="{{ name }}" {% if value == "1" or value == "on" %}checked{% endif %}/>
+ {% if label %}<label for="{{ name }}" class="form-check-label">{{ label }}</label>{% endif %}
+ {% if help %}<div id="helpBox_{{ name }}_" class="invalid-feedback">{{ help }}</div>{% endif %}
+ </div>"#);
},
FType::Select => {
f.tmpl.add_raw_template("field", r#"{% if label %}<div class="mb-3">