<%= form_for(@tr_set, as: :tr_set, url: update_key_set_path, method: :put, html: { class: 'form-horizontal', role: 'form' }) do |f| %>
<% if @should_show_yaml_warning %>
Please,
note:
At least one translation below is using
Yaml. If you are not familiar with Yaml and serialization, please don't touch the dashes at the beginning of some lines.
<% end %>
<% @tr_set.translations.each do |translation| %>
<% panel_color = translation.value.nil? ? "panel-danger" : "panel-info" %>
<%= f.fields_for "translation[]", translation do |tl_form| %>
<%= translation.locale %>
<% translation.value = translation.value.to_yaml if translation.value && translation.value.class != String %>
<% rows = (translation.value.to_s.length / 120) + 1 %>
<% height = rows * 36 %>
<%= tl_form.text_area :value, class: "form-control", style: "height:#{height}px !important;" %>
<% end %>
<% end %>
<%= f.submit "Save changes", class: "btn btn-primary" %>
<%= link_to 'Cancel', translations_path, class: "btn btn-default" %>
<% end %>