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/admin/attributes/index.html.erb

40 lines
1.9 KiB
Plaintext
Raw Normal View History

<% content_for :secondary do %>
<%= render 'admin/users/side_bar' %>
<% end %>
<div class="main_list">
<div class="button_bar up">
<%= link_to t("admin.new_#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path"), :class => 'new' %>
</div>
<table>
<thead>
<tr>
<td class="<%= @attribute_type %>s"><%= t("admin.#{@attribute_type}") %></td>
<td class="action"><%= t('admin.action') %></td>
</tr>
</thead>
<tbody>
<% @attributes.each do |attribute| %>
<tr id="attribute_<%= attribute.id %>" class="have <%= "#{attribute.is_disabled? ? 'disable' : ''}" %>">
<td class="<%= @attribute_type %>s <%= attribute.key.downcase %>"><%= attribute.i18n_variable[I18n.locale] %></span>
<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? %>
<%= link_to t(:delete), eval("admin_#{@attribute_type}_path(attribute)"), :class => 'delete', :confirm => t('sure?'), :method => :delete %>
<% end %>
</td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
<% end %>
</tbody>
</table>
<div class="button_bar">
<%= link_to t("admin.new_#{@attribute_type}"), eval("new_admin_#{@attribute_type}_path"), :class => 'new' %>
</div>
</div>