annotate app/helpers/gantt_helper.rb @ 1170:bfd49444c276 feature_523

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