{{define "types:fields"}}
{{ range .fields }}
<div class="card" style="padding: 10px; margin-top: 10px">
  <div id="Field-{{.Type_field_id}}">
    <div class="row">
      <div class="col half">
        {{ widget_select (print "Fields-"  .Type_field_id "-Widget_id") "Widget" .Widget_id $.widgets `` }}
      </div>
      <div class="half">
        <label for="Fields-{{.Type_field_id}}-Title">Title</label>
        <input type="text" id="Fields-{{.Type_field_id}}-Title" name="Fields-{{.Type_field_id}}-Title" value="{{.Title}}"/>
      </div>
    </div>

    <div class="row">
      <div class="col half">
        <label for="Fields-{{.Type_field_id}}-Valid_values">Valid values</label>
        <input type="text" id="Fields-{{.Type_field_id}}-Valid_values" name="Fields-{{.Type_field_id}}-Valid_values" value="{{.Valid_values}}"/>
      </div>
      <div class="col half">
        {{ widget_select (print "Fields-"  .Type_field_id "-Ui_section") "Section" .Ui_section $.uisections `` }}
      </div>
    </div>

    <p>{{ widget_checkbox (print "Fields-" .Type_field_id "-Show_on_list") "Show on list" "1" .Show_on_list }}</p>
    <p>{{ widget_checkbox (print "Fields-" .Type_field_id "-Show_on_view") "Show on view" "1" .Show_on_view }}</p>
    <p>{{ widget_checkbox (print "Fields-" .Type_field_id "-Is_multiple") "Multiple" "1" .Is_multiple }}</p>

    <input type="hidden" id="Fields-{{.Type_field_id}}-ToRemove" name="Fields-{{.Type_field_id}}-ToRemove" value=""/>
  </div>
  <div class="bar">
    <button id="Delete-{{.Type_field_id}}" type="button" style="float:right; margin-right: 5px;" class="delete" onclick="bm_type_field_delete(this, '{{.Type_field_id}}')"><i class="bi bi-file-minus" title="Remove"></i><span class="hide-xsmall"> Remove</span></button>
    <button id="Undelete-{{.Type_field_id}}" style="float:right; margin-right: 5px;" hidden type="button" class="delete" onclick="bm_type_field_undelete(this, '{{.Type_field_id}}')"><i class="bi bi-arrow-counterclockwise" title="Undo"></i><span class="hide-xsmall"> Undo</span></button>
  </div>
</div>
{{ end }}
{{ end }}
