gantt_helper.rb
43 lines
| 1.5 KiB
| text/x-ruby
|
RubyLexer
|
r8090 | # encoding: utf-8 | ||
# | ||||
|
r5156 | # Redmine - project management software | ||
|
r10939 | # Copyright (C) 2006-2013 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. | ||||
|
r6354 | # | ||
|
r3958 | # 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. | ||||
|
r6354 | # | ||
|
r3958 | # 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), | ||
|
r10792 | params.merge(gantt.params.merge(:zoom => (gantt.zoom + 1))), | ||
|
r5181 | :class => 'icon icon-zoom-in' | ||
|
r4167 | else | ||
|
r10792 | content_tag(:span, l(:text_zoom_in), :class => 'icon icon-zoom-in').html_safe | ||
|
r4167 | end | ||
|
r6354 | |||
|
r4167 | when :out | ||
if gantt.zoom > 1 | ||||
|
r5181 | link_to_content_update l(:text_zoom_out), | ||
|
r10792 | params.merge(gantt.params.merge(:zoom => (gantt.zoom - 1))), | ||
|
r5181 | :class => 'icon icon-zoom-out' | ||
|
r4167 | else | ||
|
r10792 | content_tag(:span, l(:text_zoom_out), :class => 'icon icon-zoom-out').html_safe | ||
|
r4167 | end | ||
end | ||||
end | ||||
|
r3958 | end | ||