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

18 lines
917 B

<script type="text/javascript">
//<![CDATA[
function group_by_changed()
{
$('group_by[granularity]').setStyle({
'display': <%= @query.time_groups.inject([]){|r,t| r<<t.to_s}.inspect %>.include($("group_by[name]").value) ? 'inline' : 'none'});
}
//]]>
</script>
<%=
select_tag "group_by[name]", options_for_select(@query.group_by_columns_for_select, (@query.group_by[:name].to_s unless @query.group_by[:name].blank?)),
:class => "select-small", :onchange => "group_by_changed();"
%>
<%=
select_tag("group_by[granularity]", options_for_select([[l(:label_year), "year"], [l(:label_month), "month"], [l(:label_week), "week"], [l(:label_day_plural), "day"]], @query.group_by[:granularity]),
:class => "select-small", :onload => "group_by_changed();", :style => ("display: none" if @query.group_by["name"].blank? || !@query.time_groups.include?(@query.group_by["name"].to_s)))
%>