Commit ab4bdc37 authored by Eric Davis's avatar Eric Davis

Refactor: extract gantt zoom links to a helper.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3756 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent c3c3460e
......@@ -233,4 +233,26 @@ module IssuesHelper
end
export
end
def gantt_zoom_link(gantt, in_or_out)
case in_or_out
when :in
if gantt.zoom < 4
link_to_remote(image_tag('zoom_in.png'),
{:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :update => 'content'},
{:href => url_for(gantt.params.merge(:zoom => (gantt.zoom+1)))})
else
image_tag('zoom_in_g.png')
end
when :out
if gantt.zoom > 1
link_to_remote(image_tag('zoom_out.png'),
{:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :update => 'content'},
{:href => url_for(gantt.params.merge(:zoom => (gantt.zoom-1)))})
else
image_tag('zoom_out_g.png')
end
end
end
end
......@@ -9,16 +9,8 @@
</fieldset>
<p style="float:right;">
<%= if @gantt.zoom < 4
link_to_remote image_tag('zoom_in.png'), {:url => @gantt.params.merge(:zoom => (@gantt.zoom+1)), :update => 'content'}, {:href => url_for(@gantt.params.merge(:zoom => (@gantt.zoom+1)))}
else
image_tag 'zoom_in_g.png'
end %>
<%= if @gantt.zoom > 1
link_to_remote image_tag('zoom_out.png'), {:url => @gantt.params.merge(:zoom => (@gantt.zoom-1)), :update => 'content'}, {:href => url_for(@gantt.params.merge(:zoom => (@gantt.zoom-1)))}
else
image_tag 'zoom_out_g.png'
end %>
<%= gantt_zoom_link(@gantt, :in) %>
<%= gantt_zoom_link(@gantt, :out) %>
</p>
<p class="buttons">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment