##// END OF EJS Templates
Adds p/n access keys for previous/next links (#18692)....
Jean-Philippe Lang -
r13412:bfd811304601
parent child
Show More
@@ -111,7 +111,8 module ApplicationHelper
111 link_to(
111 link_to(
112 h(text),
112 h(text),
113 {:controller => 'repositories', :action => 'revision', :id => repository.project, :repository_id => repository.identifier_param, :rev => rev},
113 {:controller => 'repositories', :action => 'revision', :id => repository.project, :repository_id => repository.identifier_param, :rev => rev},
114 :title => l(:label_revision_id, format_revision(revision))
114 :title => l(:label_revision_id, format_revision(revision)),
115 :accesskey => options[:accesskey]
115 )
116 )
116 end
117 end
117
118
@@ -53,6 +53,6 module CalendarsHelper
53 end
53 end
54
54
55 def link_to_month(link_name, year, month, options={})
55 def link_to_month(link_name, year, month, options={})
56 link_to_content_update(h(link_name), params.merge(:year => year, :month => month))
56 link_to_content_update(h(link_name), params.merge(:year => year, :month => month), options)
57 end
57 end
58 end
58 end
@@ -24,12 +24,14
24 <div style="float:left;">
24 <div style="float:left;">
25 <%= link_to_content_update("\xc2\xab " + l(:label_previous),
25 <%= link_to_content_update("\xc2\xab " + l(:label_previous),
26 params.merge(:from => @date_to - @days - 1),
26 params.merge(:from => @date_to - @days - 1),
27 :title => l(:label_date_from_to, :start => format_date(@date_to - 2*@days), :end => format_date(@date_to - @days - 1))) %>
27 :title => l(:label_date_from_to, :start => format_date(@date_to - 2*@days), :end => format_date(@date_to - @days - 1)),
28 :accesskey => accesskey(:previous)) %>
28 </div>
29 </div>
29 <div style="float:right;">
30 <div style="float:right;">
30 <%= link_to_content_update(l(:label_next) + " \xc2\xbb",
31 <%= link_to_content_update(l(:label_next) + " \xc2\xbb",
31 params.merge(:from => @date_to + @days - 1),
32 params.merge(:from => @date_to + @days - 1),
32 :title => l(:label_date_from_to, :start => format_date(@date_to), :end => format_date(@date_to + @days - 1))) unless @date_to >= Date.today %>
33 :title => l(:label_date_from_to, :start => format_date(@date_to), :end => format_date(@date_to + @days - 1)),
34 :accesskey => accesskey(:next)) unless @date_to >= Date.today %>
33 </div>
35 </div>
34 &nbsp;
36 &nbsp;
35 <% other_formats_links do |f| %>
37 <% other_formats_links do |f| %>
@@ -11,7 +11,7
11 </fieldset>
11 </fieldset>
12
12
13 <p style="float:right;">
13 <p style="float:right;">
14 <%= link_to_previous_month(@year, @month) %> | <%= link_to_next_month(@year, @month) %>
14 <%= link_to_previous_month(@year, @month, :accesskey => accesskey(:previous)) %> | <%= link_to_next_month(@year, @month, :accesskey => accesskey(:next)) %>
15 </p>
15 </p>
16
16
17 <p class="buttons">
17 <p class="buttons">
@@ -295,11 +295,13
295 <tr>
295 <tr>
296 <td style="text-align:left;">
296 <td style="text-align:left;">
297 <%= link_to_content_update("\xc2\xab " + l(:label_previous),
297 <%= link_to_content_update("\xc2\xab " + l(:label_previous),
298 params.merge(@gantt.params_previous)) %>
298 params.merge(@gantt.params_previous),
299 :accesskey => accesskey(:previous)) %>
299 </td>
300 </td>
300 <td style="text-align:right;">
301 <td style="text-align:right;">
301 <%= link_to_content_update(l(:label_next) + " \xc2\xbb",
302 <%= link_to_content_update(l(:label_next) + " \xc2\xbb",
302 params.merge(@gantt.params_next)) %>
303 params.merge(@gantt.params_next),
304 :accesskey => accesskey(:next)) %>
303 </td>
305 </td>
304 </tr>
306 </tr>
305 </table>
307 </table>
@@ -8,14 +8,16
8 <%= link_to_if @prev_issue_id,
8 <%= link_to_if @prev_issue_id,
9 "\xc2\xab #{l(:label_previous)}",
9 "\xc2\xab #{l(:label_previous)}",
10 (@prev_issue_id ? issue_path(@prev_issue_id) : nil),
10 (@prev_issue_id ? issue_path(@prev_issue_id) : nil),
11 :title => "##{@prev_issue_id}" %> |
11 :title => "##{@prev_issue_id}",
12 :accesskey => accesskey(:previous) %> |
12 <% if @issue_position && @issue_count %>
13 <% if @issue_position && @issue_count %>
13 <span class="position"><%= l(:label_item_position, :position => @issue_position, :count => @issue_count) %></span> |
14 <span class="position"><%= l(:label_item_position, :position => @issue_position, :count => @issue_count) %></span> |
14 <% end %>
15 <% end %>
15 <%= link_to_if @next_issue_id,
16 <%= link_to_if @next_issue_id,
16 "#{l(:label_next)} \xc2\xbb",
17 "#{l(:label_next)} \xc2\xbb",
17 (@next_issue_id ? issue_path(@next_issue_id) : nil),
18 (@next_issue_id ? issue_path(@next_issue_id) : nil),
18 :title => "##{@next_issue_id}" %>
19 :title => "##{@next_issue_id}",
20 :accesskey => accesskey(:next) %>
19 </div>
21 </div>
20 <% end %>
22 <% end %>
21
23
@@ -1,13 +1,15
1 <div class="contextual">
1 <div class="contextual">
2 &#171;
2 &#171;
3 <% unless @changeset.previous.nil? -%>
3 <% unless @changeset.previous.nil? -%>
4 <%= link_to_revision(@changeset.previous, @repository, :text => l(:label_previous)) %>
4 <%= link_to_revision(@changeset.previous, @repository,
5 :text => l(:label_previous), :accesskey => accesskey(:previous)) %>
5 <% else -%>
6 <% else -%>
6 <%= l(:label_previous) %>
7 <%= l(:label_previous) %>
7 <% end -%>
8 <% end -%>
8 |
9 |
9 <% unless @changeset.next.nil? -%>
10 <% unless @changeset.next.nil? -%>
10 <%= link_to_revision(@changeset.next, @repository, :text => l(:label_next)) %>
11 <%= link_to_revision(@changeset.next, @repository,
12 :text => l(:label_next), :accesskey => accesskey(:next)) %>
11 <% else -%>
13 <% else -%>
12 <%= l(:label_next) %>
14 <%= l(:label_next) %>
13 <% end -%>
15 <% end -%>
@@ -21,7 +21,9 module Redmine
21 :preview => 'r',
21 :preview => 'r',
22 :quick_search => 'f',
22 :quick_search => 'f',
23 :search => '4',
23 :search => '4',
24 :new_issue => '7'
24 :new_issue => '7',
25 :previous => 'p',
26 :next => 'n'
25 }.freeze unless const_defined?(:ACCESSKEYS)
27 }.freeze unless const_defined?(:ACCESSKEYS)
26
28
27 def self.key_for(action)
29 def self.key_for(action)
@@ -176,7 +176,8 module Redmine
176 if paginator.previous_page
176 if paginator.previous_page
177 # \xc2\xab(utf-8) = &#171;
177 # \xc2\xab(utf-8) = &#171;
178 text = "\xc2\xab " + l(:label_previous)
178 text = "\xc2\xab " + l(:label_previous)
179 html << yield(text, {page_param => paginator.previous_page}, :class => 'previous') + ' '
179 html << yield(text, {page_param => paginator.previous_page},
180 :class => 'previous', :accesskey => accesskey(:previous)) + ' '
180 end
181 end
181
182
182 previous = nil
183 previous = nil
@@ -196,7 +197,8 module Redmine
196 if paginator.next_page
197 if paginator.next_page
197 # \xc2\xbb(utf-8) = &#187;
198 # \xc2\xbb(utf-8) = &#187;
198 text = l(:label_next) + " \xc2\xbb"
199 text = l(:label_next) + " \xc2\xbb"
199 html << yield(text, {page_param => paginator.next_page}, :class => 'next') + ' '
200 html << yield(text, {page_param => paginator.next_page},
201 :class => 'next', :accesskey => accesskey(:next)) + ' '
200 end
202 end
201
203
202 html << content_tag('span', "(#{paginator.first_item}-#{paginator.last_item}/#{paginator.item_count})", :class => 'items') + ' '
204 html << content_tag('span', "(#{paginator.first_item}-#{paginator.last_item}/#{paginator.item_count})", :class => 'items') + ' '
General Comments 0
You need to be logged in to leave comments. Login now