Project

General

Profile

Feature #4272 » dynamic-issue-columns-2.patch

Dynamic columns under "Options" - Jean-Philippe Lang, 2009-11-25 21:57

View differences:

app/controllers/issues_controller.rb (working copy)
515 515
          end
516 516
        end
517 517
        @query.group_by = params[:group_by]
518
        session[:query] = {:project_id => @query.project_id, :filters => @query.filters, :group_by => @query.group_by}
518
        @query.column_names = params[:columns]
519
        session[:query] = {:project_id => @query.project_id, :filters => @query.filters, :group_by => @query.group_by, :column_names => @query.column_names}
519 520
      else
520 521
        @query = Query.find_by_id(session[:query][:id]) if session[:query][:id]
521
        @query ||= Query.new(:name => "_", :project => @project, :filters => session[:query][:filters], :group_by => session[:query][:group_by])
522
        @query ||= Query.new(:name => "_", :project => @project, :filters => session[:query][:filters], :group_by => session[:query][:group_by], :column_names => session[:query][:column_names])
522 523
        @query.project = @project
523 524
      end
524 525
    end
app/views/issues/index.rhtml (working copy)
22 22
    	<div style="display: none;">
23 23
				<%= l(:field_group_by) %>
24 24
				<%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, @query.group_by)) %>
25
				<br />
26
        Columns:
27
        <% @query.available_columns.each do |c| %>
28
          <label><%= check_box_tag 'columns[]', c.name, @query.columns.include?(c) %> <%= c.caption %></label>
29
        <% end %>
25 30
			</div>
26 31
		</fieldset>
27 32
		</div>
(3-3/5)