To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / helpers / gantt_helper.rb @ 912:5e80956cc792

History | View | Annotate | Download (1.49 KB)

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