universal_table/app/views/admin/universal_tables/_text_field.html.erb

30 lines
1.3 KiB
Plaintext

<div class="control-group">
<%= f.label :text, column.title, :class => "control-label" %>
<div class="controls">
<div class="input-append">
<div class="tab-content">
<% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_in_use_locales.first ? "active in" : "") %>
<% id = "table_entry_column_entries_#{i}_text_translations_#{locale.to_s}" %>
<div class="tab-pane fade in <%= active %>" id="<%= id %>">
<%= f.fields_for :text_translations do |f| %>
<%= f.text_field locale, :value => text_field.text_translations[locale.to_s] %>
<% end %>
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_in_use_locales.each do |locale| %>
<% active = (locale == @site_in_use_locales.first ? "active" : "") %>
<% id = "table_entry_column_entries_#{i}_text_translations_#{locale.to_s}" %>
<%= link_to t(locale).to_s,"##{id}",:class=>"btn #{active}",:data=>{:toggle=>"tab"}%>
<% end %>
</div>
</div>
</div>
<% if !text_field.new_record? %>
<%= f.hidden_field :id %>
<% else %>
<%= f.hidden_field :table_column_id, :value => column.id %>
<% end %>
</div>