<%# locals: { f, field_label, field_name, multiple, classname, field_name, field_id, required, readonly, validation, ttip } %>
<% field_class = nil if local_assigns[:field_class].nil? %>
<% field_label = field_label || 'No label defined' %>
<% field_label = required ? "* #{field_label}" : field_label%>

<% unless multiple %>
  <div class="col-md-12">
    <%= f.label field_id, field_label, class: 'control-label' %>
  </div>
<% end %>
<div class="col-md-12 dynamic-field">
  <%= f.number_field field_name, 
            value: field_value, 
            multiple: multiple, 
            disabled: readonly,
            class: "form-control #{field_class}",
            data: { toggle: 'tooltip' },
            title: ttip,
            id: field_id  %>
  <% if multiple %>
    <div class="actions">
      <span class="fa fa-plus-square add-record"></span>
      <% if index != 0 %>
        <span class="fa fa-minus-square remove-record"></span>
      <% else %>
        <span class="fa fa-minus-square remove-record" style="display:none"></span>
      <% end %>
    </div>
  <% end %>
  <%= render partial: "shared/dynamic_form/validation_indicator", locals: {
                validation: validation
      } unless validation == "none"
  %>
</div>
