diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-04-26 13:09:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-04-26 13:09:14 +0000 |
commit | b557393252cc961c2f47dc90d50b75f76d7d7dca (patch) | |
tree | f7ebe7cfa18e256431393c7183146450e5377048 /app/views | |
parent | 24875be705fdca8e53b7c39a58023d13421628e3 (diff) | |
download | redmine-b557393252cc961c2f47dc90d50b75f76d7d7dca.tar.gz redmine-b557393252cc961c2f47dc90d50b75f76d7d7dca.zip |
Ticket grouping (#2679).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2696 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/issues/_list.rhtml | 10 | ||||
-rw-r--r-- | app/views/issues/index.rhtml | 8 | ||||
-rw-r--r-- | app/views/queries/_form.rhtml | 3 |
3 files changed, 20 insertions, 1 deletions
diff --git a/app/views/issues/_list.rhtml b/app/views/issues/_list.rhtml index b19e1d719..89756e42c 100644 --- a/app/views/issues/_list.rhtml +++ b/app/views/issues/_list.rhtml @@ -9,8 +9,18 @@ <%= column_header(column) %> <% end %> </tr></thead> + <% group = false %> <tbody> <% issues.each do |issue| -%> + <% if @query.grouped? && issue.send(@query.group_by) != group %> + <% group = issue.send(@query.group_by) %> + <% reset_cycle %> + <tr class="group"> + <td colspan="<%= query.columns.size + 2 %>"> + <%= group.blank? ? 'None' : group %> <span class="count">(<%= @issue_count_by_group[group] %>)</span> + </td> + </tr> + <% end %> <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>"> <td class="checkbox"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td> <td><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td> diff --git a/app/views/issues/index.rhtml b/app/views/issues/index.rhtml index 7c381d825..e74dbafc1 100644 --- a/app/views/issues/index.rhtml +++ b/app/views/issues/index.rhtml @@ -4,9 +4,15 @@ <% form_tag({ :controller => 'queries', :action => 'new' }, :id => 'query_form') do %> <%= hidden_field_tag('project_id', @project.to_param) if @project %> + <div id="query_form_content"> <fieldset id="filters"><legend><%= l(:label_filter_plural) %></legend> <%= render :partial => 'queries/filters', :locals => {:query => @query} %> + </fieldset> + <p><%= l(:field_group_by) %> + <%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, @query.group_by)) %></p> + </div> <p class="buttons"> + <%= link_to_remote l(:button_apply), { :url => { :set_filter => 1 }, :update => "content", @@ -23,7 +29,6 @@ <%= link_to l(:button_save), {}, :onclick => "$('query_form').submit(); return false;", :class => 'icon icon-save' %> <% end %> </p> - </fieldset> <% end %> <% else %> <div class="contextual"> @@ -36,6 +41,7 @@ <div id="query_form"></div> <% html_title @query.name %> <% end %> + <%= error_messages_for 'query' %> <% if @query.valid? %> <% if @issues.empty? %> diff --git a/app/views/queries/_form.rhtml b/app/views/queries/_form.rhtml index 7c227a9f6..28faba177 100644 --- a/app/views/queries/_form.rhtml +++ b/app/views/queries/_form.rhtml @@ -19,6 +19,9 @@ <p><label for="query_default_columns"><%=l(:label_default_columns)%></label> <%= check_box_tag 'default_columns', 1, @query.has_default_columns?, :id => 'query_default_columns', :onclick => 'if (this.checked) {Element.hide("columns")} else {Element.show("columns")}' %></p> + +<p><label for="query_group_by"><%= l(:field_group_by) %></label> +<%= select 'query', 'group_by', @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, :include_blank => true %></p> </div> <fieldset><legend><%= l(:label_filter_plural) %></legend> |