orbit-basic/app/views/admin/user_attribute_models/index.html.erb

31 lines
2.0 KiB
Plaintext
Raw Normal View History

2011-11-18 08:43:14 +00:00
<div class="main_list">
<div id="add_new" class="buttom clear">
2011-11-19 13:47:18 +00:00
<%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path") %>
2011-11-18 08:43:14 +00:00
</div>
<ul>
<li class="list_head clear">
2011-11-19 13:47:18 +00:00
<span class="<%= @attribute %>s"><%= t("admin.#{@attribute}") %></span>
2011-11-19 18:14:51 +00:00
<span class="action"><%= t('admin.action') %></span>
2011-11-18 08:43:14 +00:00
</li>
<% @user_attribute_models.each do |user_attribute_model| %>
2011-11-19 13:47:18 +00:00
<li id="attribute_<%= user_attribute_model.id %>" class="list_item <%= "#{user_attribute_model.is_disabled? ? 'disable' : ''}" %> clear">
<span class="<%= @attribute %>s <%= user_attribute_model.i18n_variable[:key].downcase %>"><%= user_attribute_model.i18n_variable[I18n.locale] %></span>
2011-11-17 12:02:58 +00:00
<span class="action">
2011-11-19 13:47:18 +00:00
2011-11-17 12:02:58 +00:00
<%= link_to t(:edit), eval("edit_admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'edit' %>
2011-11-19 13:47:18 +00:00
<% if user_attribute_model.is_built_in? %>
<%= link_to t(:enable), eval("admin_user_#{@attribute}_model_path(user_attribute_model, :authenticity_token => form_authenticity_token, :user_#{@attribute}_model => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{user_attribute_model.id}", :style => "display:#{user_attribute_model.is_disabled? ? 'none' : ''}", :class => 'switch' %>
<%= link_to t(:disable), eval("admin_user_#{@attribute}_model_path(user_attribute_model, :authenticity_token => form_authenticity_token, :user_#{@attribute}_model => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{user_attribute_model.id}", :style => "display:#{user_attribute_model.is_disabled? ? '' : 'none'}", :class => 'switch' %>
<% else %>
<%= link_to t(:delete), eval("admin_user_#{@attribute}_model_path(user_attribute_model)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
<% end %>
2011-11-17 12:02:58 +00:00
</span>
</li>
2011-11-18 08:43:14 +00:00
<% end %>
</ul>
<div id="add_new" class="buttom clear">
2011-11-19 13:47:18 +00:00
<%= link_to t("admin.new_user_#{@attribute}"), eval("new_admin_user_#{@attribute}_model_path") %>
2011-11-18 08:43:14 +00:00
</div>
2011-11-17 12:02:58 +00:00
</div>