the select options to add a filter are separated by the object they apply on

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1277 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
p.tessenow 15 years ago
parent ae37bff213
commit d4a415c986
  1. 9
      app/views/cost_reports/_filters.rhtml

@ -26,8 +26,13 @@
<%= l(:label_filter_add) %>: <%= l(:label_filter_add) %>:
<select onchange="add_filter(this, 'costs');" id="add_filter_select" class="select-small"> <select onchange="add_filter(this, 'costs');" id="add_filter_select" class="select-small">
<option value=""></option> <option value=""></option>
<% CostQuery::Filter.all.each do |filter| %> <% filters = CostQuery::Filter.all.group_by { |f| f.applies_for } %>
<option value="<%= filter.underscore_name %>"><%= l(filter.label) %></option> <% filters.each do |label, filter_ary| %>
<optgroup label="<%= l(label) %>">
<% filter_ary.each do |filter| %>
<option value="<%= filter.underscore_name %>"><%= l(filter.label) %></option>
<% end %>
</optgroup>
<% end %> <% end %>
</select> </select>
</td> </td>

Loading…
Cancel
Save