<%= fields_for "user[user_#{type}s]", user_attribute, :index => nil do |f| %> <%= f.hidden_field :key, :value => ua.key %> <%= f.hidden_field :id unless user_attribute.new_record? %>
<% @site_valid_locales.each do |locale| %> <% end %> <% ua.get_enabled_attribute_models.each do |attr| %> <% value = user_attribute.attribute_values.detect{|v| v.key == attr.key } %> <%= hidden_field_tag "user[user_#{type}s][][attribute_values][][id]", value.id rescue nil %> <%= hidden_field_tag "user[user_#{type}s][][attribute_values][][key]", attr.key %> <% if attr["locale"] && attr["markup"] == 'text_field' %> <%= hidden_field_tag "user[user_#{type}s][][attribute_values][][non_locale]", nil %> <% @site_valid_locales.each do |locale| %> <% end -%> <% else %> <% end -%> <% end %>
<%= t("admin.key") %><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
<%= attr.i18n_variable[I18n.locale] %> <%= text_field_tag "user[user_#{type}s][][attribute_values][][#{locale}]", (value[locale] rescue nil) %> > <% if attr["markup"] == "text_field" %> <%= text_field_tag "user[user_#{type}s][][attribute_values][][non_locale]", (value['non_locale'] rescue nil) %> <% elsif attr["markup"] == "select" %> <%= select_tag "user[user_#{type}s][][attribute_values][][non_locale]", options_for_select(attr["options"], value['non_locale']) %> <% end -%>
<% end %>