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/work_packages/_query_form.html.erb

78 lines
3.0 KiB

<%= form_tag({ controller: '/queries', action: 'new' }, id: 'query_form', name: 'queryForm') do %>
<%= hidden_field_tag('project_id', project.to_param) if project %>
<div id="query_form_content" class="hide-when-print">
<query-filters></query-filters>
<!-- options angular, under construction -->
<fieldset query-form id="column_options" class="header_collapsible collapsible collapsed">
<legend title="<%= l(:description_option_toggle) %>", ng-click="showQueryOptions = !showQueryOptions"><a ng-href=""><%= l(:label_options) %></a></legend>
<div ng-show="showQueryOptions">
<table style="">
<tbody>
<tr>
<td><%= Query.human_attribute_name(:column_names) %></td>
<td>
<query-columns></query-columns>
<%-# call_hook(:view_issue_query_form_options_bottom, :query => query) %>
</td>
</tr>
<tr>
<td><label for="group_by">Group results by</label></td>
<td>
<select id="group_by"
name="group_by"
ng-options="column.name as column.title for column in columns"
ng-model="groupBy">
</select>
</td>
</tr>
<tr>
<td><label for="display_sums">Display Sums</label></td>
<td>
<input id="display_sums"
name="display_sums"
type="checkbox"
value="1"
ng-model="query.display_sums"/>
</td>
</tr>
</tbody>
</table>
</div>
</fieldset>
</div>
<p class="buttons hide-when-print">
<%= link_to_remote l(:button_apply),
{ :url => { :set_filter => 1 },
:before => 'selectAllOptions("selected_columns");',
:update => "content",
:method => :get,
:complete => "apply_filters_observer(); resetSelectedMenuItem(); initQuerySelectBehaviour();",
:with => "jQuery('#query_form').serialize()"
}, :class => 'icon icon-yes' %>
<%= link_to_remote l(:button_clear),
{ :url => { :set_filter => 1, :sort => WorkPackagesController::DEFAULT_SORT_ORDER.join(':'), :project_id => project },
:method => :get,
:update => "content",
:complete => 'resetSelectedMenuItem(); initQuerySelectBehaviour();',
}, :class => 'icon icon-undo' %>
<% if query.new_record? && User.current.allowed_to?(:save_queries, project, :global => true) %>
<%= link_to l(:button_save), {}, :onclick => "selectAllOptions('selected_columns'); jQuery('#query_form').submit(); return false;", :class => 'icon icon-save1' %>
<% end %>
</p>
<% end %>