2011-04-13 10:19:51 +00:00
|
|
|
<fieldset id="attribute_<%= ua.key %>"<%= raw(' style="display: none;"') unless (@user.active_attributes.include?(ua.key) rescue nil) %>>
|
|
|
|
|
2011-02-01 02:46:26 +00:00
|
|
|
<%= fields_for 'user[user_roles]', user_role, :index => nil do |f| %>
|
2011-04-13 10:19:51 +00:00
|
|
|
<legend><%= ua.i18n_variable[I18n.locale] %></legend>
|
|
|
|
<%= f.hidden_field :key, :value => ua.key %>
|
2011-02-01 02:46:26 +00:00
|
|
|
<%= f.hidden_field :id unless user_role.new_record? %>
|
2011-04-13 10:19:51 +00:00
|
|
|
|
|
|
|
<table>
|
|
|
|
|
|
|
|
<tr>
|
2011-02-01 02:46:26 +00:00
|
|
|
<th><%= t('admin.role') %></th>
|
2011-04-13 10:19:51 +00:00
|
|
|
<% @site_valid_locales.each do |locale| %>
|
|
|
|
<th style="color:<%= colorize_in_use_locale(locale) %>"><%= locale %></th>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
|
2011-02-01 02:46:26 +00:00
|
|
|
<% ua.attribute_models.each do |attr| %>
|
2011-04-13 10:19:51 +00:00
|
|
|
<tr>
|
|
|
|
<td><%= attr.i18n_variable[I18n.locale] %></td>
|
|
|
|
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
|
|
|
<% @site_valid_locales.each do |locale| %>
|
|
|
|
<td>
|
2011-02-01 02:46:26 +00:00
|
|
|
<%= text_field_tag "user[user_roles][][#{attr.key}_#{locale}]", (user_role["#{attr.key}_#{locale}"] rescue nil) %>
|
2011-04-13 10:19:51 +00:00
|
|
|
</td>
|
|
|
|
<% end -%>
|
|
|
|
<% else %>
|
|
|
|
<td colspan=<%= @site_valid_locales.size %>>
|
|
|
|
<% if attr["markup"] == "text_field" %>
|
2011-02-01 02:46:26 +00:00
|
|
|
<%= text_field_tag "user[user_roles][][#{attr.key}]", (user_role[attr.key] rescue nil) %>
|
2011-04-13 10:19:51 +00:00
|
|
|
<% elsif attr["markup"] == "select" %>
|
2011-02-01 02:46:26 +00:00
|
|
|
<%= select_tag "user[user_roles][][#{attr.key}]", options_for_select(attr["options"], user_role[attr.key]) %>
|
2011-04-13 10:19:51 +00:00
|
|
|
<% end -%>
|
|
|
|
</td>
|
|
|
|
<% end -%>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</fieldset>
|