##// END OF EJS Templates
Makes zoom buttons on gantt looks like the others....
Jean-Philippe Lang -
r4169:a29c35e08f23
parent child
Show More
@@ -18,27 +18,25
18 module GanttHelper
18 module GanttHelper
19
19
20 def gantt_zoom_link(gantt, in_or_out)
20 def gantt_zoom_link(gantt, in_or_out)
21 img_attributes = {:style => 'height:1.4em; width:1.4em; margin-left: 3px;'} # em for accessibility
22
23 case in_or_out
21 case in_or_out
24 when :in
22 when :in
25 if gantt.zoom < 4
23 if gantt.zoom < 4
26 link_to_remote(l(:text_zoom_in) + image_tag('zoom_in.png', img_attributes.merge(:alt => l(:text_zoom_in))),
24 link_to_remote(l(:text_zoom_in),
27 {:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :method => :get, :update => 'content'},
25 {:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :method => :get, :update => 'content'},
28 {:href => url_for(gantt.params.merge(:zoom => (gantt.zoom+1)))})
26 {:href => url_for(gantt.params.merge(:zoom => (gantt.zoom+1))),
27 :class => 'icon icon-zoom-in'})
29 else
28 else
30 l(:text_zoom_in) +
29 content_tag('span', l(:text_zoom_in), :class => 'icon icon-zoom-in')
31 image_tag('zoom_in_g.png', img_attributes.merge(:alt => l(:text_zoom_in)))
32 end
30 end
33
31
34 when :out
32 when :out
35 if gantt.zoom > 1
33 if gantt.zoom > 1
36 link_to_remote(l(:text_zoom_out) + image_tag('zoom_out.png', img_attributes.merge(:alt => l(:text_zoom_out))),
34 link_to_remote(l(:text_zoom_out),
37 {:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :method => :get, :update => 'content'},
35 {:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :method => :get, :update => 'content'},
38 {:href => url_for(gantt.params.merge(:zoom => (gantt.zoom-1)))})
36 {:href => url_for(gantt.params.merge(:zoom => (gantt.zoom-1))),
37 :class => 'icon icon-zoom-out'})
39 else
38 else
40 l(:text_zoom_out) +
39 content_tag('span', l(:text_zoom_out), :class => 'icon icon-zoom-out')
41 image_tag('zoom_out_g.png', img_attributes.merge(:alt => l(:text_zoom_out)))
42 end
40 end
43 end
41 end
44 end
42 end
@@ -10,7 +10,7
10 </div>
10 </div>
11 </fieldset>
11 </fieldset>
12
12
13 <p style="float:right;">
13 <p class="contextual">
14 <%= gantt_zoom_link(@gantt, :in) %>
14 <%= gantt_zoom_link(@gantt, :in) %>
15 <%= gantt_zoom_link(@gantt, :out) %>
15 <%= gantt_zoom_link(@gantt, :out) %>
16 </p>
16 </p>
@@ -854,6 +854,8 padding-bottom: 3px;
854 .icon-summary { background-image: url(../images/lightning.png); }
854 .icon-summary { background-image: url(../images/lightning.png); }
855 .icon-server-authentication { background-image: url(../images/server_key.png); }
855 .icon-server-authentication { background-image: url(../images/server_key.png); }
856 .icon-issue { background-image: url(../images/ticket.png); }
856 .icon-issue { background-image: url(../images/ticket.png); }
857 .icon-zoom-in { background-image: url(../images/zoom_in.png); }
858 .icon-zoom-out { background-image: url(../images/zoom_out.png); }
857
859
858 .icon-file { background-image: url(../images/files/default.png); }
860 .icon-file { background-image: url(../images/files/default.png); }
859 .icon-file.text-plain { background-image: url(../images/files/text.png); }
861 .icon-file.text-plain { background-image: url(../images/files/text.png); }
General Comments 0
You need to be logged in to leave comments. Login now