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