summaryrefslogtreecommitdiffstats
path: root/app/views/enumerations/list.rhtml
blob: 817751ab2c9a38d96e3c45affb5714bcfc98d0de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<h2><%=l(:label_enumerations)%></h2>

<% Enumeration.get_subclasses.each do |klass| %>
<h3><%= l(klass::OptionName) %></h3>

<% enumerations = klass.all %>
<% if enumerations.any? %>
<table class="list">
<tr>
    <th><%= l(:field_name) %></th>
    <th style="width:15%;"><%= l(:field_is_default) %></th>
    <th style="width:15%;"><%= l(:field_active) %></th>
    <th style="width:15%;"></th>
    <th align="center" style="width:10%;"> </th>
</tr>
<% enumerations.each do |enumeration| %>
<tr class="<%= cycle('odd', 'even') %>">
    <td><%= link_to h(enumeration), :action => 'edit', :id => enumeration %></td>
    <td style="width:15%;"><%= image_tag('true.png') if enumeration.is_default? %></td>
    <td style="width:15%;"><%= image_tag('true.png') if enumeration.active? %></td>
    <td style="width:15%;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}) %></td>
    <td class="buttons">
    <%= link_to l(:button_delete), { :action => 'destroy', :id => enumeration }, 
    															 :method => :post,
    															 :confirm => l(:text_are_you_sure),
    															 :class => 'icon icon-del' %>
    </td>
</tr>
<% end %>
</table>
<% reset_cycle %>
<% end %>

<p><%= link_to l(:label_enumeration_new), { :action => 'new', :type => klass.name } %></p>
<% end %>

<% html_title(l(:label_enumerations)) -%>