ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Stacked month (top row) (Bug #887)


Added by Tom Rochette at 2012-02-15 04:52 am. Updated at 2012-04-04 01:50 pm.


Status:Closed Start date:2012-02-14
Priority:Normal Due date:
Assignee:Felix Schäfer % Done:

0%

Category:Gantt chart
Target version:3.1.0
Remote issue URL: Affected version:3.0.0

Description

The top row of the gantt chart which represents each month is somehow stacked when you have more than 1 month to be displayed instead of displaying properly like in the previous 2.X releases.

See the screenshot for a visual presentation of the problem.

This applies to both Google Chrome 17 as well as Firefox 10.


stacked_month_link.PNG (13.9 kB) Tom Rochette, 2012-02-15 04:52 am


Associated revisions

Revision 0a7c6e67
Added by Felix Schäfer at 2012-04-04 09:36 am

Correct handling of Rational#to_s on ruby 1.9 #887

Contributed by Martin S

History

Updated by Martin S at 2012-04-01 06:26 pm

i just fixed that bug in my local copy.

There are some to_i missing in the gantt view calculation.

--- a/app/views/gantts/show.html.erb
+++ b/app/views/gantts/show.html.erb
@@ -98,13 +98,13 @@ month_f = @gantt.date_from
 left = 0
 height = (show_weeks ? header_heigth : header_heigth + g_height)
 @gantt.months.times do
-       width = ((month_f >> 1) - month_f) * zoom - 1
+       width = (((month_f >> 1) - month_f) * zoom - 1).to_i
        %>
        <div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
        <%= link_to h("#{month_f.year}-#{month_f.month}"), @gantt.params.merge(:year => month_f.year, :month => month_f.month), :title => "#{month_name(month_f.month)} #{month_f.year}"%>
        </div>
        <%
-       left = left + width + 1
+       left = (left + width + 1).to_i
        month_f = month_f >> 1

Updated by Felix Schäfer at 2012-04-03 06:04 am

I can't reproduce this (on master). Could you have a look at the source and see what style values the month boxes have?

Updated by Tom Rochette at 2012-04-03 01:11 pm

Source looks like (for a single date item):

<div class="gantt_hdr" style="left:2448/1px;width:479/1px;height:18px;">
<a title="September 2012" href="/projects/p/issues/gantt?month=9&months=6&year=2012&zoom=4">2012-9</a>
</div>

There's obviously something wrong with the inline div style...

Updated by Felix Schäfer at 2012-04-03 02:32 pm

Tom Rochette wrote:

There's obviously something wrong with the inline div style...

Indeed. Do you have more info about your setup? (Ruby? Server? …) I'd like to know the cause of this before fixing it :-)

  • Status changed from Open to Needs more information

Updated by Tom Rochette at 2012-04-04 01:12 am

Felix Schäfer wrote:

Tom Rochette wrote:

There's obviously something wrong with the inline div style...

Indeed. Do you have more info about your setup? (Ruby? Server? …) I'd like to know the cause of this before fixing it :-)

Absolutely:
  • Ruby 1.9.3p30
  • Rails 2.3.14
  • ChiliProject 3.0.0.11e93ff36 (using mysql2 adapter)
  • Thin 1.3.1

If you need anything else... Ask :)

Updated by Felix Schäfer at 2012-04-04 07:33 am

Tom Rochette wrote:

  • Ruby 1.9.3p30

It seems that's the gist of the problem, ruby 1.8 and 1.9 print Rational s out differently. On 1.8:

>> Rational(29,1).to_s
=> "29"

On 1.9:

>> Rational(29,1).to_s
=> "29/1"
  • Status changed from Needs more information to Open

Updated by Felix Schäfer at 2012-04-04 07:40 am

Fixed in 0a7c6e6, thanks!

  • Status changed from Open to Closed

Updated by Holger Just at 2012-04-04 08:01 am

  • Target version set to 3.1.0
  • Assignee set to Felix Schäfer

Updated by Tom Rochette at 2012-04-04 01:15 pm

Confirmed fixed @ 3.1.0 in Firefox 11.

Updated by Felix Schäfer at 2012-04-04 01:50 pm

Tom Rochette wrote:

Confirmed fixed @ 3.1.0 in Firefox 11.

You're fast ;-) Thanks for the feedback!

Also available in: Atom PDF