<% if !defined?(i) %>
<% end %>
Delete <% if defined?(i) %> <%= f.hidden_field :_destroy, :value => "false", :class => "attribute_field_to_delete" %>

<%= column.title %>

<% else %>

ColumnXX

<% end %>
<%= f.text_field :key %>
<% @site_in_use_locales.each do |locale| %> <% active = (locale == @site_in_use_locales.first ? "active in" : "") %> <% id = (defined?(i) ? "table_column_#{i}_title_translations_#{locale.to_s}" : "table_column_XXX_title_translations_#{locale.to_s}") %>
<%= f.fields_for :title_translations do |f| %> <%= f.text_field locale, :value => column.title_translations[locale] %> <% end %>
<% end %>
<% @site_in_use_locales.each do |locale| %> <% active = (locale == @site_in_use_locales.first ? "active" : "") %> <% id = (defined?(i) ? "table_column_#{i}_title_translations_#{locale.to_s}" : "table_column_XXX_title_translations_#{locale.to_s}") %> <%= link_to t(locale).to_s,"##{id}",:class=>"btn #{active}",:data=>{:toggle=>"tab"}%> <% end %>
<% select_values = UTable::FIELD_TYPES.collect{|ft| [ft.capitalize,ft]} %> <%= f.select :type, select_values, {}, {class: "type-selector"} %>
<% if defined?(i) %> <% if column.order.nil? %> <%= f.hidden_field :order, :value => i %> <% else %> <%= f.hidden_field :order %> <% end %> <% else %> <%= f.hidden_field :order, :value=> "XXX" %> <% end %>
<% if !defined?(i) %>
<% end %>