From: Andrea Zagli <azagli@libero.it> Date: Sat, 4 Mar 2023 14:23:45 +0000 (+0100) Subject: Field: to_load/save default to true. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=a9eda6207975e82c2f96219f0955cc2ce3950628;p=rust%2Fzakform Field: to_load/save default to true. --- diff --git a/src/fields.rs b/src/fields.rs index 4e79e67..251362c 100644 --- a/src/fields.rs +++ b/src/fields.rs @@ -164,6 +164,8 @@ impl FieldText { f.field.name = String::from(name); f.field.label = String::from(name); + f.field.to_load = true; + f.field.to_save = true; match f.field.tmpl.add_raw_template("field", r#"{% if label %}<div class="mb-3"> <label for="{{ name }}" class="form-label">{{ label }}</label>{% endif %} @@ -299,6 +301,8 @@ impl FieldTextArea { f.field.name = String::from(name); f.field.label = String::from(name); + f.field.to_load = true; + f.field.to_save = true; f.rows = 5; @@ -449,6 +453,8 @@ impl FieldRadio { f.field.name = String::from(name); f.field.label = String::from(name); + f.field.to_load = true; + f.field.to_save = true; match f.field.tmpl.add_raw_template("field", r#"{% if label %}<div class="mb-3"> <label for="{{ name }}" class="form-label">{{ label }}</label><br/>{% endif %} @@ -616,6 +622,8 @@ impl FieldSelect { f.field.name = String::from(name); f.field.label = String::from(name); + f.field.to_load = true; + f.field.to_save = true; match f.field.tmpl.add_raw_template("field", r#"{% if label %}<div class="mb-3"> <label for="{{ name }}" class="form-label">{{ label }}</label><br/>{% endif %} @@ -747,6 +755,8 @@ impl FieldCheck { f.field.name = String::from(name); f.field.label = String::from(name); + f.field.to_load = true; + f.field.to_save = true; match f.field.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 %}/>