You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gantt_helper.rb 1.5KB

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