hier-list.patch

Fri Flaj, 2010-03-17 14:36

Download (2.39 KB)

View differences:

app/controllers/issues_controller.rb
70 70
      
71 71
      @issue_count = @query.issue_count
72 72
      @issue_pages = Paginator.new self, @issue_count, limit, params['page']
73

  
74
      hier_sort_clause = sort_clause
75
      if hier_sort_clause == 'issues.id DESC'
76
        hier_sort_clause = 'issues.root_id DESC, issues.lft'
77
      elsif hier_sort_clause == 'issues.id'
78
        hier_sort_clause = 'issues.root_id, issues.lft'
79
      end
80

  
73 81
      @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
74
                              :order => sort_clause, 
82
                              :order => hier_sort_clause, 
75 83
                              :offset => @issue_pages.current.offset, 
76 84
                              :limit => limit)
77 85
      @issue_count_by_group = @query.issue_count_by_group
app/models/issue.rb
207 207
    done_ratio
208 208
    estimated_hours
209 209
    custom_field_values
210
    level
210 211
  ) unless const_defined?(:SAFE_ATTRIBUTES)
211 212
  
212 213
  # Safely sets attributes
app/views/issues/_list.rhtml
27 27
	<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>">
28 28
	    <td class="checkbox"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
29 29
		<td><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td>
30
        <% query.columns.each do |column| %><%= content_tag 'td', column_content(column, issue), :class => column.name %><% end %>
30
        <% query.columns.each do |column| %>
31
            <%
32
                if column.name == :subject
33
                    indent = "padding-left: #{issue.level}em"
34
                else
35
                    indent = ""
36
                end
37
            %>
38
            <%= content_tag 'td', column_content(column, issue), :style => indent, :class => column.name %>
39
        <% end %>
31 40
	</tr>
32 41
	<% end -%>
33 42
	</tbody>