Skip to content

Commit 83b4a57

Browse files
committed
Fixed some Ruby 1.9 Rational.to_s issues within the app/views/gantts/show.html.erb file. Fixed some html_safe issues in the views/issue_moves/new.html.erb file and views/issues/_sidebar.html.erb file
1 parent 0008170 commit 83b4a57

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

app/assets/javascripts/calendar/lang/calendar-hr.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Calendar._FD = 0;
5151
Calendar._MN = new Array
5252
("Sijecanj",
5353
"Veljaca",
54-
"Ožujak",
54+
"Ozujak",
5555
"Travanj",
5656
"Svibanj",
5757
"Lipanj",
@@ -66,7 +66,7 @@ Calendar._MN = new Array
6666
Calendar._SMN = new Array
6767
("Sij",
6868
"Velj",
69-
"Ožu",
69+
"Ozu",
7070
"Tra",
7171
"Svi",
7272
"Lip",
@@ -100,7 +100,7 @@ Calendar._TT["ABOUT_TIME"] = "\n\n" +
100100

101101
Calendar._TT["PREV_YEAR"] = "Prethodna godina (hold for menu)";
102102
Calendar._TT["PREV_MONTH"] = "Prethodni mjesec (hold for menu)";
103-
Calendar._TT["GO_TODAY"] = "Na današnji dan";
103+
Calendar._TT["GO_TODAY"] = "Na danasnji dan";
104104
Calendar._TT["NEXT_MONTH"] = "Naredni mjesec (hold for menu)";
105105
Calendar._TT["NEXT_YEAR"] = "Naredna godina (hold for menu)";
106106
Calendar._TT["SEL_DATE"] = "Odaberite datum";
@@ -109,7 +109,7 @@ Calendar._TT["PART_TODAY"] = " (Danas)";
109109

110110
// the following is to inform that "%s" is to be the first day of week
111111
// %s will be replaced with the day name.
112-
Calendar._TT["DAY_FIRST"] = "Prikaži %s prvo";
112+
Calendar._TT["DAY_FIRST"] = "Prikazi %s prvo";
113113

114114
// This may be locale-dependent. It specifies the week-end days, as an array
115115
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1

app/helpers/issues_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def query_links(title, queries)
148148
content_tag('h3', h(title)) +
149149
queries.collect {|query|
150150
link_to(h(query.name), url_params.merge(:query_id => query))
151-
}.join('<br />')
151+
}.join('<br />').html_safe
152152
end
153153

154154
def render_sidebar_queries

app/views/gantts/show.html.erb

+15-15
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ headers_height = header_heigth
3939
show_weeks = false
4040
show_days = false
4141

42-
if @gantt.zoom >1
42+
if @gantt.zoom > 1
4343
show_weeks = true
44-
headers_height = 2*header_heigth
44+
headers_height = 2 * header_heigth
4545
if @gantt.zoom > 2
4646
show_days = true
47-
headers_height = 3*header_heigth
47+
headers_height = 3 * header_heigth
4848
end
4949
end
5050

5151
# Width of the entire chart
52-
g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom
52+
g_width = (@gantt.date_to - @gantt.date_from + 1) * zoom
5353

5454
@gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width, :subject_width => subject_width)
5555

56-
g_height = [(20 * (@gantt.number_of_rows + 6))+150, 206].max
56+
g_height = [(20 * (@gantt.number_of_rows + 6)) + 150, 206].max
5757
t_height = g_height + headers_height
5858

5959

@@ -80,7 +80,7 @@ t_height = g_height + headers_height
8080
<td>
8181

8282
<div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;">
83-
<div style="width:<%= g_width-1 %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr">&nbsp;</div>
83+
<div style="width:<%= g_width - 1 %>px;height:<%= headers_height %>px;background: #eee;" class="gantt_hdr">&nbsp;</div>
8484
<%
8585
#
8686
# Months headers
@@ -89,7 +89,7 @@ month_f = @gantt.date_from
8989
left = 0
9090
height = (show_weeks ? header_heigth : header_heigth + g_height)
9191
@gantt.months.times do
92-
width = ((month_f >> 1) - month_f) * zoom - 1
92+
width = ((month_f >> 1) - month_f).to_i * zoom - 1
9393
%>
9494
<div style="left:<%= left %>px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
9595
<%= 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}"%>
@@ -105,29 +105,29 @@ end %>
105105
#
106106
if show_weeks
107107
left = 0
108-
height = (show_days ? header_heigth-1 : header_heigth-1 + g_height)
108+
height = (show_days ? header_heigth - 1 : header_heigth - 1 + g_height)
109109
if @gantt.date_from.cwday == 1
110110
# @date_from is monday
111111
week_f = @gantt.date_from
112112
else
113113
# find next monday after @date_from
114114
week_f = @gantt.date_from + (7 - @gantt.date_from.cwday + 1)
115-
width = (7 - @gantt.date_from.cwday + 1) * zoom-1
115+
width = (7 - @gantt.date_from.cwday + 1) * zoom - 1
116116
%>
117117
<div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">&nbsp;</div>
118118
<%
119-
left = left + width+1
119+
left = left + width + 1
120120
end %>
121121
<%
122122
while week_f <= @gantt.date_to
123-
width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom -1 : (@gantt.date_to - week_f + 1) * zoom-1
123+
width = (week_f + 6 <= @gantt.date_to) ? 7 * zoom - 1 : (@gantt.date_to - week_f + 1) * zoom - 1
124124
%>
125125
<div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
126126
<small><%= week_f.cweek if width >= 16 %></small>
127127
</div>
128128
<%
129-
left = left + width+1
130-
week_f = week_f+7
129+
left = left + width + 1
130+
week_f = week_f + 7
131131
end
132132
end %>
133133

@@ -146,7 +146,7 @@ if show_days
146146
<%= day_name(wday).first %>
147147
</div>
148148
<%
149-
left = left + width+1
149+
left = left + width + 1
150150
wday = wday + 1
151151
wday = 1 if wday > 7
152152
end
@@ -159,7 +159,7 @@ end %>
159159
# Today red line (excluded from cache)
160160
#
161161
if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %>
162-
<div style="position: absolute;height:<%= g_height %>px;top:<%= headers_height + 1 %>px;left:<%= ((Date.today-@gantt.date_from+1)*zoom).floor()-1 %>px;width:10px;border-left: 1px dashed red;">&nbsp;</div>
162+
<div style="position: absolute;height:<%= g_height %>px;top:<%= headers_height + 1 %>px;left:<%= ((Date.today-@gantt.date_from+1) * zoom).floor() - 1 %>px;width:10px;border-left: 1px dashed red;">&nbsp;</div>
163163
<% end %>
164164

165165
</div>

app/views/issue_moves/new.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</ul>
88

99
<%= form_tag({:action => 'create'}, :id => 'move_form') do %>
10-
<%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join %>
10+
<%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join.html_safe %>
1111

1212
<div class="box tabular">
1313
<fieldset class="attributes">

app/views/issues/_sidebar.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
<% end %>
1414
<%= call_hook(:view_issues_sidebar_planning_bottom) %>
1515

16-
<%= render_sidebar_queries %>
16+
<%= render_sidebar_queries.html_safe %>
1717
<%= call_hook(:view_issues_sidebar_queries_bottom) %>

config/routes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
map.resources :projects, :shallow => true, :member => {
137137
:copy => [:get, :post],
138138
:settings => :get,
139-
:modules => :post,
139+
:modules => :put,
140140
:archive => :post,
141141
:unarchive => :post
142142
} do |project|

0 commit comments

Comments
 (0)