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

40 lines
1.8 KiB
Plaintext
Raw Normal View History

2011-12-23 10:34:21 +00:00
<% content_for :secondary do %>
2012-11-26 02:08:06 +00:00
<%= render 'admin/users_new_interface/side_bar' %>
2011-12-23 10:34:21 +00:00
<% end %>
<div class="main_list">
<div class="button_bar up">
2012-09-12 11:12:50 +00:00
<%= link_to t("new.#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path"), :class => 'new' %>
2011-12-23 10:34:21 +00:00
</div>
<table>
<thead>
<tr>
2012-09-21 04:58:44 +00:00
<td class="<%= @attribute_type %>s"><%= t("#{@attribute_type}") %></td>
2012-09-12 12:36:24 +00:00
<td class="action"><%= t(:action) %></td>
2011-12-23 10:34:21 +00:00
</tr>
</thead>
<tbody>
<% @attributes.each do |attribute| %>
<tr id="attribute_<%= attribute.id %>" class="have <%= "#{attribute.is_disabled? ? 'disable' : ''}" %>">
2012-07-25 21:58:09 +00:00
<td class="<%= @attribute_type %>s <%= attribute.key.downcase %>"><%= attribute.title %></span>
2011-12-23 10:34:21 +00:00
<td class="action">
<%= link_to t(:edit), eval("edit_admin_#{@attribute_type}_path(attribute)"), :class => 'edit' %>
<%= link_to t(:enable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => true})"), :remote => true, :method => :put, :id => "disable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? 'none' : ''}", :class => 'switch' %>
<%= link_to t(:disable), eval("admin_#{@attribute_type}_path(attribute, :authenticity_token => form_authenticity_token, :#{@attribute_type} => {:disabled => false})"), :remote => true, :method => :put, :id => "enable_#{attribute.id}", :style => "display:#{attribute.is_disabled? ? '' : 'none'}", :class => 'switch' %>
<% if !attribute.is_built_in? %>
2012-11-27 03:15:15 +00:00
<%= link_to t(:delete_), eval("admin_#{@attribute_type}_path(attribute)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
2011-12-23 10:34:21 +00:00
<% end %>
</td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
<% end %>
</tbody>
</table>
<div class="button_bar">
2012-09-12 11:12:50 +00:00
<%= link_to t("new.#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path"), :class => 'new' %>
2011-12-23 10:34:21 +00:00
</div>
</div>