gantt_helper.rb
41 lines
| 1.5 KiB
| text/x-ruby
|
RubyLexer
|
r5156 | # Redmine - project management software | ||
# Copyright (C) 2006-2011 Jean-Philippe Lang | ||||
|
r3958 | # | ||
# This program is free software; you can redistribute it and/or | ||||
# modify it under the terms of the GNU General Public License | ||||
# as published by the Free Software Foundation; either version 2 | ||||
# of the License, or (at your option) any later version. | ||||
# | ||||
# This program is distributed in the hope that it will be useful, | ||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
# GNU General Public License for more details. | ||||
# | ||||
# You should have received a copy of the GNU General Public License | ||||
# along with this program; if not, write to the Free Software | ||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
module GanttHelper | ||||
|
r4167 | |||
def gantt_zoom_link(gantt, in_or_out) | ||||
case in_or_out | ||||
when :in | ||||
if gantt.zoom < 4 | ||||
|
r5181 | link_to_content_update l(:text_zoom_in), | ||
params.merge(gantt.params.merge(:zoom => (gantt.zoom+1))), | ||||
:class => 'icon icon-zoom-in' | ||||
|
r4167 | else | ||
|
r4169 | content_tag('span', l(:text_zoom_in), :class => 'icon icon-zoom-in') | ||
|
r4167 | end | ||
when :out | ||||
if gantt.zoom > 1 | ||||
|
r5181 | link_to_content_update l(:text_zoom_out), | ||
params.merge(gantt.params.merge(:zoom => (gantt.zoom-1))), | ||||
:class => 'icon icon-zoom-out' | ||||
|
r4167 | else | ||
|
r4169 | content_tag('span', l(:text_zoom_out), :class => 'icon icon-zoom-out') | ||
|
r4167 | end | ||
end | ||||
end | ||||
|
r3958 | end | ||