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

63 lines
2.5 KiB

<%#
This partial requires the following locals:
f An ActionView::Helpers::FormBuilder
query A CostQuery object
%>
<%#TODO: replace me with a drag&drop group_by selector %>
<table style="border-collapse: collapse; border: 0pt none;" id="group_by_table">
<tbody><tr>
<td>
<select style="width: 150px;" size="9" multiple="multiple" id="group_by_container">
<% CostQuery::GroupBy.all_grouped.each do |label, group_by_ary| %>
<optgroup label="<%= l(label) %>" data-category="<%= label.to_s %>">
<% group_by_ary.each do |group_by| %>
<option value="<%= group_by.underscore_name %>" data-category="<%= label.to_s %>"><%= l(group_by.label) %></option>
<% end %>
</optgroup>
<% end %>
</select>
</td>
<td align="center" valign="middle">
<input type="button" onclick="moveOptions(this.form.group_by_container, this.form.group_by_columns);" value="&#8594;" /><br />
<input type="button" onclick="moveOptions(this.form.group_by_columns, this.form.group_by_container);" value="&#8592;" />
</td>
<td style="padding-left: 0pt;" valign="middle">
<h3>Columns</h3>
<select style="width: 150px;" size="4" name="groups[columns][]" multiple="multiple" id="group_by_columns">
</select>
</td>
<td align="center" valign="middle">
<input type="button" onclick="moveOptionUp(this.form.group_by_columns);" value="&#8593;" /><br />
<input type="button" onclick="moveOptionDown(this.form.group_by_columns);" value="&#8595;" />
</td>
</tr>
<tr>
<td align="center" valign="middle" colspan="2">
<input type="button" onclick="moveOptions(this.form.group_by_container, this.form.group_by_rows);" value="&#8595;" />
<input type="button" onclick="moveOptions(this.form.group_by_rows, this.form.group_by_container);" value="&#8593;" />
</td>
<td colspan="3" rowspan="2" align="center" valign="middle">
&nbsp
</td>
</tr>
<tr>
<td style="padding-left: 0pt;" valign="middle">
<h3>Rows</h3>
<select style="width: 150px;" size="4" name="groups[rows][]" multiple="multiple" id="group_by_rows">
</select>
</td>
<td align="center" valign="middle">
<input type="button" onclick="moveOptionUp(this.form.group_by_rows);" value="&#8593;" /><br />
<input type="button" onclick="moveOptionDown(this.form.group_by_rows);" value="&#8595;" />
</td>
</tr></tbody>
</table>
<%#
up &#8593;
down &#8595;
left &#8592;
right &#8594;
%>