|
|
|
@ -8,38 +8,32 @@ |
|
|
|
|
<% grouped_filters = CostQuery::Filter.all_grouped.sort_by { |label, group_by_ary| l(label) } %> |
|
|
|
|
<% partial_prefix = File.join(File.basename(File.dirname(__FILE__)), 'filters') %> |
|
|
|
|
|
|
|
|
|
<table width="100%"> |
|
|
|
|
<tr> |
|
|
|
|
<td> |
|
|
|
|
<table id="filter_table"> |
|
|
|
|
|
|
|
|
|
<table id="filter_table"> |
|
|
|
|
<% grouped_filters.each do |label, filter_ary| %> |
|
|
|
|
<tr id="tr_<%= label.to_s %>" style="display:none"><td><h3><%= l(label) %></h3></td></tr> |
|
|
|
|
<% filter_ary.sort_by { |f| l(f.label)}.each do |filter| %> |
|
|
|
|
<% next unless filter.display? %> |
|
|
|
|
<tr id="tr_<%= filter.underscore_name %>" class="filter" style="display:none" data-label="tr_<%= label.to_s %>"> |
|
|
|
|
<% html_elements(filter).each do |element| %> |
|
|
|
|
<%= render :partial => File.join(partial_prefix, element[:name].to_s), |
|
|
|
|
:locals => {:element => element, :f => f, :filter => filter} %> |
|
|
|
|
<% end %> |
|
|
|
|
</tr> |
|
|
|
|
<% end %> |
|
|
|
|
<% end %> |
|
|
|
|
</table> |
|
|
|
|
<div id="add_filter_block"> |
|
|
|
|
<select onchange="add_filter(this);" id="add_filter_select" class="select-small"> |
|
|
|
|
<option value="">-- <%= l(:label_filter_add) %> --</option> |
|
|
|
|
<% grouped_filters.each do |label, filter_ary| %> |
|
|
|
|
<tr id="tr_<%= label.to_s %>" style="display:none"><td><h3><%= l(label) %></h3></td></tr> |
|
|
|
|
<optgroup label="<%= l(label) %>"> |
|
|
|
|
<% filter_ary.sort_by { |f| l(f.label)}.each do |filter| %> |
|
|
|
|
<% next unless filter.display? %> |
|
|
|
|
<tr id="tr_<%= filter.underscore_name %>" class="filter" style="display:none" data-label="tr_<%= label.to_s %>"> |
|
|
|
|
<% html_elements(filter).each do |element| %> |
|
|
|
|
<%= render :partial => File.join(partial_prefix, element[:name].to_s), |
|
|
|
|
:locals => {:element => element, :f => f, :filter => filter} %> |
|
|
|
|
<% end %> |
|
|
|
|
</tr> |
|
|
|
|
<% next unless filter.selectable? %> |
|
|
|
|
<option value="<%= filter.underscore_name %>"><%= l(filter.label) %></option> |
|
|
|
|
<% end %> |
|
|
|
|
</optgroup> |
|
|
|
|
<% end %> |
|
|
|
|
</table> |
|
|
|
|
</td> |
|
|
|
|
<td class="add-filter"> |
|
|
|
|
<%= l(:label_filter_add) %>: |
|
|
|
|
<select onchange="add_filter(this);" id="add_filter_select" class="select-small"> |
|
|
|
|
<option value=""></option> |
|
|
|
|
<% grouped_filters.each do |label, filter_ary| %> |
|
|
|
|
<optgroup label="<%= l(label) %>"> |
|
|
|
|
<% filter_ary.sort_by { |f| l(f.label)}.each do |filter| %> |
|
|
|
|
<% next unless filter.selectable? %> |
|
|
|
|
<option value="<%= filter.underscore_name %>"><%= l(filter.label) %></option> |
|
|
|
|
<% end %> |
|
|
|
|
</optgroup> |
|
|
|
|
<% end %> |
|
|
|
|
</select> |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
</table> |
|
|
|
|
</select> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|