<div class="wrapper" style="">
  <% unless draggable_fields_container_is_empty?(layout_builder.draggable_fields_main_container1) &&
          draggable_fields_container_is_empty?(layout_builder.draggable_fields_main_container2) &&
          draggable_fields_container_is_empty?(layout_builder.draggable_fields_main_container3) %>
    <div class="row m-t white-bg">
      <div class="col-sm-4">
        <div class="table-record-placeholder">
          <%= render 'tables/layout/main_container1', layout_builder: layout_builder %>
        </div>
      </div>

      <div class="col-sm-4">
        <div class="table-record-placeholder">
          <%= render 'tables/layout/main_container2', layout_builder: layout_builder %>
        </div>
      </div>

      <div class="col-sm-4">
        <div class="table-record-placeholder">
          <%= render 'tables/layout/main_container3', layout_builder: layout_builder %>
        </div>
      </div>
    </div>
  <% end %>

  <div class="row m-t m-b">
    <% if @activities %>
      <% if current_admin_user.twilio_setup_complete? || layout_builder.commentable %>
        <div class="col-sm-7 pull-right">
          <div class="row white-bg">
            <div class="p-sm enjoyhint-table-detail-handler">
              <%= render 'shared/activity_history', feedable_type: @target_db.table, feedable_id: @row["id"] %>
            </div>
          </div>
        </div>
      <% end %>
    <% end %>

    <div class="clearfix"></div>
  </div>
</div>

<div class="animated ">
  <% @relatable_tables.each do |relative| %>
    <% if layout_builder.related_tables.include?(relative[:name]) %>
      <div class="row">
        <div class="col-lg-12">
          <div class="ibox margin-bottom">
            <div class="ibox-content">
              <br>
              <%= render 'related_data_table', current_table: relative[:name], headers:  relative[:headers]%>
            </div>
          </div>
        </div>
      </div>
    <% end %>
  <% end %>
</div>
