OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/app/views/cost_reports/_group_by.rhtml

36 lines
1.4 KiB

<%#
This partial requires the following locals:
f An ActionView::Helpers::FormBuilder
query A CostQuery object
%>
<% grouped_gbs = CostQuery::GroupBy.all_grouped %>
<div id="group_by_area">
<%= l(:label_columns) %>:
<div id="group_columns" class="drag_target drag_container">
<select id="group_by_columns" name="groups[columns][]" class="select-small" onchange="add_group_by(this);">
<option value=""></option>
<% grouped_gbs.each do |label , group_by_ary| %>
<optgroup label="<%= l(label) %>">
<% group_by_ary.select(&:display?).sort_by {|gb| l(gb.label)}.each_with_index do |group_by, ix| %>
<option data-sort_by="<%= ix %>" value="<%= group_by.underscore_name %>"><%= l(group_by.label)%></option>
<% end %>
</optgroup>
<% end %>
</select>
</div>
<%= l(:label_rows) %>:
<div id="group_rows" class="drag_target drag_container">
<select id="group_by_rows" name="groups[rows][]" class="select-small" onchange="add_group_by(this);">
<option value=""></option>
<% grouped_gbs.each do |label , group_by_ary| %>
<optgroup label="<%= l(label) %>">
<% group_by_ary.select(&:display?).sort_by {|gb| l(gb.label)}.each_with_index do |group_by, ix| %>
<option data-sort_by="<%= ix %>" value="<%= group_by.underscore_name %>"><%= l(group_by.label)%></option>
<% end %>
</optgroup>
<% end %>
</select>
</div>
</div>