Error #449
Version order invalid on sidebar
Added by Luis Serrano over 13 years ago.
Updated over 13 years ago.
Description
When I look in the sidebar the version the order are not correct.
In the file /views/versions/index.html.erb (line 37) put <% @versions.sort.each do |version| > instead < @versions.each do |version| %>
the same in the file /views/milestone/show.rhtml (line 35)
When I look in the sidebar the version the order are not correct.
In the files:
- /views/versions/index.html.erb (line 8 and 37)
- /views/milestone/show.rhtml (line 20 and 35)
Must be added:
<% @versions.sort.each do |version| %>
Instead of:
<% @versions.each do |version| %>
- Category set to Versions
- Target version set to Advanced roadmap 0.5.1
- Start date deleted (
2011-03-08)
- Due date set to 2011-05-18
- Status changed from New to Rejected
- Assignee set to Emilio González Montaña
- Start date set to 2011-05-18
- % Done changed from 0 to 100
Versions were well sorted, but not by name, the algorithm followed is:
versions.sort!{|a, b|
if !a.effective_date.nil? and !b.effective_date.nil?
a.effective_date <=> b.effective_date
elsif a.effective_date.nil? and !b.effective_date.nil?
1
elsif !a.effective_date.nil? and b.effective_date.nil?
-1
elsif a.rest_hours != b.rest_hours
a.rest_hours <=> b.rest_hours
else
a.name.downcase <=> b.name.downcase
end
}
The idea is to sort by due date, if the date is provided on versions it will be used, if not the estimated pending effort will be used, if any of the previous things is valid, then the version name will be used.
- Tracker changed from Feature to Error
- Subject changed from Version order to Version order invalid on sidebar
- Source set to Customer
Also available in: Atom
PDF