<% @header_container1_items = items_for_container(layout_builder, 'draggable_fields_header_container1')%>
<% @header_container1_items.each do |k, v|  %>
  <% if v["table"] == layout_builder.table_name %>
    <% @current_row = @row %>
  <% else %>
    <% @current_row = get_related_row(layout_builder.table_name, v["table"], @row["id"]) %>
  <% end %>

  <% if v["editable"] == "true" %>
    <div class="row editable-row">
      <div class="col-xs-9">
        <div class="editable-content-wrapper">
          <% if @current_row &&  !@current_row[v["title"]].blank? %>
            <p class="editable-content header-container1-content">
              <%= @current_row[v["title"]] %>
            </p>
            <% else %>
            <h2 class="editable-content">--</h2>
          <% end %>
        </div>

        <div class="editable-input">
          <% if @current_row %>
            <% if v["kind"] == 'integer' %>
              <input type="number" class="form-control" value="<%= @current_row.nil? ? "" : @current_row[v["title"]] %>">
            <% else %>
              <input type="text" class="form-control" value="<%= @current_row.nil? ? "" : @current_row[v["title"]] %>">
            <% end %>
          <% end %>
        </div>
      </div>
    </div>
  <% else %>
    <div class="">
      <% if @current_row %>
        <p class="editable-content header-container1-content">
          <%= @current_row[v["title"]] %>
        </p>
      <% else %>
        <p>--</p>
      <% end %>
    </div>
  <% end %>
<% end  %>
