##// END OF EJS Templates
Handle the case of none existing enumerations using no-data blocks (#24776)....
Jean-Philippe Lang -
r15806:bbede05f2e50
parent child
Show More
@@ -1,38 +1,40
1 <h2><%=l(:label_enumerations)%></h2>
1 <h2><%=l(:label_enumerations)%></h2>
2
2
3 <% Enumeration.get_subclasses.each do |klass| %>
3 <% Enumeration.get_subclasses.each do |klass| %>
4 <h3><%= l(klass::OptionName) %></h3>
4 <h3><%= l(klass::OptionName) %></h3>
5
5
6 <% enumerations = klass.shared %>
6 <% enumerations = klass.shared %>
7
7
8 <p><%= link_to l(:label_enumeration_new), new_enumeration_path(:type => klass.name), :class => 'icon icon-add' %></p>
8 <p><%= link_to l(:label_enumeration_new), new_enumeration_path(:type => klass.name), :class => 'icon icon-add' %></p>
9
9
10 <% if enumerations.any? %>
10 <% if enumerations.any? %>
11 <table class="list enumerations"><thead>
11 <table class="list enumerations"><thead>
12 <tr>
12 <tr>
13 <th><%= l(:field_name) %></th>
13 <th><%= l(:field_name) %></th>
14 <th><%= l(:field_is_default) %></th>
14 <th><%= l(:field_is_default) %></th>
15 <th><%= l(:field_active) %></th>
15 <th><%= l(:field_active) %></th>
16 <th></th>
16 <th></th>
17 </tr></thead>
17 </tr></thead>
18 <% enumerations.each do |enumeration| %>
18 <% enumerations.each do |enumeration| %>
19 <tr class="<%= cycle('odd', 'even') %>">
19 <tr class="<%= cycle('odd', 'even') %>">
20 <td class="name"><%= link_to enumeration, edit_enumeration_path(enumeration) %></td>
20 <td class="name"><%= link_to enumeration, edit_enumeration_path(enumeration) %></td>
21 <td class="tick"><%= checked_image enumeration.is_default? %></td>
21 <td class="tick"><%= checked_image enumeration.is_default? %></td>
22 <td class="tick"><%= checked_image enumeration.active? %></td>
22 <td class="tick"><%= checked_image enumeration.active? %></td>
23 <td class="buttons">
23 <td class="buttons">
24 <%= reorder_handle(enumeration, :url => enumeration_path(enumeration), :param => 'enumeration') %>
24 <%= reorder_handle(enumeration, :url => enumeration_path(enumeration), :param => 'enumeration') %>
25 <%= delete_link enumeration_path(enumeration) %>
25 <%= delete_link enumeration_path(enumeration) %>
26 </td>
26 </td>
27 </tr>
27 </tr>
28 <% end %>
28 <% end %>
29 </table>
29 </table>
30 <% reset_cycle %>
30 <% reset_cycle %>
31 <% else %>
32 <p class="nodata"><%= l(:label_no_data) %></p>
31 <% end %>
33 <% end %>
32 <% end %>
34 <% end %>
33
35
34 <% html_title(l(:label_enumerations)) -%>
36 <% html_title(l(:label_enumerations)) -%>
35
37
36 <%= javascript_tag do %>
38 <%= javascript_tag do %>
37 $(function() { $("table.enumerations tbody").positionedItems(); });
39 $(function() { $("table.enumerations tbody").positionedItems(); });
38 <% end %> No newline at end of file
40 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now