This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/views/panel/users/_user_attribute.html.erb

39 lines
1.4 KiB
Plaintext
Raw Normal View History

2011-02-01 07:12:23 +00:00
<%= fields_for "user[user_#{type}s]", user_attribute, :index => nil do |f| %>
<legend><%= ua.i18n_variable[I18n.locale] %></legend>
<%= f.hidden_field :key, :value => ua.key %>
<%= f.hidden_field :id unless user_attribute.new_record? %>
2011-02-01 07:12:23 +00:00
<table>
<tr>
<th><%= t("admin.key") %></th>
<% @site_valid_locales.each do |locale| %>
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
<% end %>
</tr>
2011-02-01 07:12:23 +00:00
<% ua.attribute_models.each do |attr| %>
<tr>
2011-02-01 07:12:23 +00:00
<td><%= attr.i18n_variable[I18n.locale] %></td>
<% if attr["locale"] && attr["markup"] == 'text_field' %>
<% @site_valid_locales.each do |locale| %>
<td>
<%= text_field_tag "user[user_#{type}s][][#{attr.key}_#{locale}]", (user_attribute["#{attr.key}_#{locale}"] rescue nil) %>
</td>
<% end -%>
<% else %>
<td colspan=<%= @site_valid_locales.size %>>
<% if attr["markup"] == "text_field" %>
<%= text_field_tag "user[user_#{type}s][][#{attr.key}]", (user_attribute[attr.key] rescue nil) %>
<% elsif attr["markup"] == "select" %>
<%= select_tag "user[user_#{type}s][][#{attr.key}]", options_for_select(attr["options"], user_attribute[attr.key]) %>
<% end -%>
</td>
<% end -%>
</tr>
2011-02-01 07:12:23 +00:00
<% end %>
2011-02-01 07:12:23 +00:00
</table>
2011-02-01 07:12:23 +00:00
<% end %>