##// END OF EJS Templates
Moves a method to the appropriate helper....
Jean-Philippe Lang -
r4167:a6f891d1b184
parent child
Show More
@@ -16,6 +16,33
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 module GanttHelper
19
20 def gantt_zoom_link(gantt, in_or_out)
21 img_attributes = {:style => 'height:1.4em; width:1.4em; margin-left: 3px;'} # em for accessibility
22
23 case in_or_out
24 when :in
25 if gantt.zoom < 4
26 link_to_remote(l(:text_zoom_in) + image_tag('zoom_in.png', img_attributes.merge(:alt => l(:text_zoom_in))),
27 {:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :method => :get, :update => 'content'},
28 {:href => url_for(gantt.params.merge(:zoom => (gantt.zoom+1)))})
29 else
30 l(:text_zoom_in) +
31 image_tag('zoom_in_g.png', img_attributes.merge(:alt => l(:text_zoom_in)))
32 end
33
34 when :out
35 if gantt.zoom > 1
36 link_to_remote(l(:text_zoom_out) + image_tag('zoom_out.png', img_attributes.merge(:alt => l(:text_zoom_out))),
37 {:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :method => :get, :update => 'content'},
38 {:href => url_for(gantt.params.merge(:zoom => (gantt.zoom-1)))})
39 else
40 l(:text_zoom_out) +
41 image_tag('zoom_out_g.png', img_attributes.merge(:alt => l(:text_zoom_out)))
42 end
43 end
44 end
45
19 46 def number_of_issues_on_versions(gantt)
20 47 versions = gantt.events.collect {|event| (event.is_a? Version) ? event : nil}.compact
21 48
@@ -246,30 +246,4 module IssuesHelper
246 246 end
247 247 export
248 248 end
249
250 def gantt_zoom_link(gantt, in_or_out)
251 img_attributes = {:style => 'height:1.4em; width:1.4em; margin-left: 3px;'} # em for accessibility
252
253 case in_or_out
254 when :in
255 if gantt.zoom < 4
256 link_to_remote(l(:text_zoom_in) + image_tag('zoom_in.png', img_attributes.merge(:alt => l(:text_zoom_in))),
257 {:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :method => :get, :update => 'content'},
258 {:href => url_for(gantt.params.merge(:zoom => (gantt.zoom+1)))})
259 else
260 l(:text_zoom_in) +
261 image_tag('zoom_in_g.png', img_attributes.merge(:alt => l(:text_zoom_in)))
262 end
263
264 when :out
265 if gantt.zoom > 1
266 link_to_remote(l(:text_zoom_out) + image_tag('zoom_out.png', img_attributes.merge(:alt => l(:text_zoom_out))),
267 {:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :method => :get, :update => 'content'},
268 {:href => url_for(gantt.params.merge(:zoom => (gantt.zoom-1)))})
269 else
270 l(:text_zoom_out) +
271 image_tag('zoom_out_g.png', img_attributes.merge(:alt => l(:text_zoom_out)))
272 end
273 end
274 end
275 249 end
General Comments 0
You need to be logged in to leave comments. Login now