index.html.erb 1.15 KB
Newer Older
1
<h2><%=l(:label_enumerations)%></h2>
jplang's avatar
jplang committed
2

3 4
<% Enumeration.get_subclasses.each do |klass| %>
<h3><%= l(klass::OptionName) %></h3>
jplang's avatar
jplang committed
5

6
<% enumerations = klass.shared %>
jplang's avatar
jplang committed
7
<% if enumerations.any? %>
8
<table class="list enumerations"><thead>
9 10
<tr>
    <th><%= l(:field_name) %></th>
11 12 13
    <th><%= l(:field_is_default) %></th>
    <th><%= l(:field_active) %></th>
    <th></th>
jplang's avatar
jplang committed
14
</tr></thead>
jplang's avatar
jplang committed
15
<% enumerations.each do |enumeration| %>
16
<tr class="<%= cycle('odd', 'even') %>">
jplang's avatar
jplang committed
17
    <td class="name"><%= link_to enumeration, edit_enumeration_path(enumeration) %></td>
18 19
    <td class="tick"><%= checked_image enumeration.is_default? %></td>
    <td class="tick"><%= checked_image enumeration.active? %></td>
20 21 22 23
    <td class="buttons">
      <%= reorder_handle(enumeration, :url => enumeration_path(enumeration), :param => 'enumeration') %>
      <%= delete_link enumeration_path(enumeration) %>
    </td>
jplang's avatar
jplang committed
24 25 26
</tr>
<% end %>
</table>
27
<% reset_cycle %>
jplang's avatar
jplang committed
28
<% end %>
29

jplang's avatar
jplang committed
30
<p><%= link_to l(:label_enumeration_new), new_enumeration_path(:type => klass.name) %></p>
jplang's avatar
jplang committed
31
<% end %>
32

33
<% html_title(l(:label_enumerations)) -%>
34 35 36 37

<%= javascript_tag do %>
  $(function() { $("table.enumerations tbody").positionedItems(); });
<% end %>