Chris@441
|
1 # Redmine - project management software
|
Chris@441
|
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
|
chris@22
|
3 #
|
chris@22
|
4 # This program is free software; you can redistribute it and/or
|
chris@22
|
5 # modify it under the terms of the GNU General Public License
|
chris@22
|
6 # as published by the Free Software Foundation; either version 2
|
chris@22
|
7 # of the License, or (at your option) any later version.
|
chris@22
|
8 #
|
chris@22
|
9 # This program is distributed in the hope that it will be useful,
|
chris@22
|
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
chris@22
|
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
chris@22
|
12 # GNU General Public License for more details.
|
chris@22
|
13 #
|
chris@22
|
14 # You should have received a copy of the GNU General Public License
|
chris@22
|
15 # along with this program; if not, write to the Free Software
|
chris@22
|
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
chris@22
|
17
|
chris@22
|
18 module GanttHelper
|
chris@37
|
19
|
chris@37
|
20 def gantt_zoom_link(gantt, in_or_out)
|
chris@37
|
21 case in_or_out
|
chris@37
|
22 when :in
|
chris@37
|
23 if gantt.zoom < 4
|
Chris@441
|
24 link_to_content_update l(:text_zoom_in),
|
Chris@441
|
25 params.merge(gantt.params.merge(:zoom => (gantt.zoom+1))),
|
Chris@441
|
26 :class => 'icon icon-zoom-in'
|
chris@37
|
27 else
|
chris@37
|
28 content_tag('span', l(:text_zoom_in), :class => 'icon icon-zoom-in')
|
chris@37
|
29 end
|
chris@37
|
30
|
chris@37
|
31 when :out
|
chris@37
|
32 if gantt.zoom > 1
|
Chris@441
|
33 link_to_content_update l(:text_zoom_out),
|
Chris@441
|
34 params.merge(gantt.params.merge(:zoom => (gantt.zoom-1))),
|
Chris@441
|
35 :class => 'icon icon-zoom-out'
|
chris@37
|
36 else
|
chris@37
|
37 content_tag('span', l(:text_zoom_out), :class => 'icon icon-zoom-out')
|
chris@37
|
38 end
|
chris@37
|
39 end
|
chris@37
|
40 end
|
chris@22
|
41 end
|