Orbit/app/views/panel/users/_attribute_attr.html.erb

26 lines
1.0 KiB
Plaintext
Raw Normal View History

<%= fields_for 'user[user_attributes][attribute_attrs]', attribute_attr, :index => nil do |f| %>
<%#= f.hidden_field :id unless attribute_attr.new_record? %>
<% if attr["locale"] %>
<p>
<%#= f.hidden_field :key, :value => attr["key"] %>
<% if attr["markup"] == "text_field" %>
<% @site_valid_locales.each do |locale| %>
<%= f.label attr.i18n_variable[locale] %>
<%= text_field_tag "user[user_attributes][attribute_attrs][i18n_user][#{locale}]", (attribute_attr.i18n_user[locale] rescue nil) %>
<% end -%>
<% elsif attr["markup"] == "select" %>
<%= f.select "#{attr["key"]}_#{I18n.locale}", attr["options_#{I18n.locale}"].to_a %>
<% end -%>
</p>
<% else %>
<p>
<%= f.label attr["name"] %>
<% if attr["markup"] == "text_field" %>
<%= f.text_field "#{attr["key"]}" %>
<% elsif attr["markup"] == "select" %>
<%= f.select "#{attr["key"]}", attr["options"].to_a %>
<% end -%>
</p>
<% end -%>
<% end %>