Project

General

Profile

Error #449

Version order invalid on sidebar

Added by Luis Serrano over 11 years ago. Updated over 11 years ago.

Status:
Rejected
Priority:
Normal
Category:
Versions
Target version:
Start date:
2011-05-18
Due date:
2011-05-18
% Done:

100%

Estimated time:
Source:
Customer
Detected on version:
Redmine version:
Milestones:

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)

#1

Updated by Luis Serrano over 11 years ago

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| %>

#2

Updated by Emilio González Montaña over 11 years ago

  • Category set to Versions
  • Target version set to Advanced roadmap 0.5.1
  • Start date deleted (2011-03-08)
#3

Updated by Emilio González Montaña over 11 years ago

  • 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.

#4

Updated by Emilio González Montaña over 11 years ago

  • 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