浏览代码

Added some accesskeys:

* e => edit
* r => preview
* f => quick search
* 4 => search


git-svn-id: http://redmine.rubyforge.org/svn/trunk@804 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/0.6.0
Jean-Philippe Lang 16 年前
父节点
当前提交
e8971e5f83

+ 10
- 0
app/helpers/application_helper.rb 查看文件

@@ -126,6 +126,16 @@ module ApplicationHelper
title.compact.join(' - ')
end
ACCESSKEYS = {:edit => 'e',
:preview => 'r',
:quick_search => 'f',
:search => '4',
}.freeze

def accesskey(s)
ACCESSKEYS[s]
end

# format text according to system settings
def textilizable(text, options = {})
return "" if text.blank?

+ 1
- 1
app/views/documents/show.rhtml 查看文件

@@ -1,5 +1,5 @@
<div class="contextual">
<%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'icon icon-edit' %>
<%= link_to_if_authorized l(:button_edit), {:controller => 'documents', :action => 'edit', :id => @document}, :class => 'icon icon-edit', :accesskey => accesskey(:edit) %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'documents', :action => 'destroy', :id => @document}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
</div>


+ 1
- 1
app/views/issues/show.rhtml 查看文件

@@ -1,6 +1,6 @@
<div class="contextual">
<%= show_and_goto_link(l(:label_add_note), 'add-note', :class => 'icon icon-note') if authorize_for('issues', 'add_note') %>
<%= link_to_if_authorized l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue}, :class => 'icon icon-edit' %>
<%= link_to_if_authorized l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue}, :class => 'icon icon-edit', :accesskey => accesskey(:edit) %>
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
<%= watcher_tag(@issue, User.current) %>
<%= link_to_if_authorized l(:button_move), {:controller => 'projects', :action => 'move_issues', :id => @project, "issue_ids[]" => @issue.id }, :class => 'icon icon-move' %>

+ 2
- 1
app/views/layouts/base.rhtml 查看文件

@@ -38,7 +38,8 @@
<div id="header">
<div id="quick-search">
<% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
<%= link_to l(:label_search), :controller => 'search', :action => 'index', :id => @project %>: <%= text_field_tag 'q', @question, :size => 20, :class => 'small' %>
<%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
<%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
<% end %>
<%= render :partial => 'layouts/project_selector' if User.current.memberships.any? %>
</div>

+ 1
- 0
app/views/news/show.rhtml 查看文件

@@ -2,6 +2,7 @@
<%= link_to_if_authorized l(:button_edit),
{:controller => 'news', :action => 'edit', :id => @news},
:class => 'icon icon-edit',
:accesskey => accesskey(:edit),
:onclick => 'Element.show("edit-news"); return false;' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'news', :action => 'destroy', :id => @news}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
</div>

+ 2
- 2
app/views/wiki/edit.rhtml 查看文件

@@ -8,7 +8,7 @@
<%= link_to l(:label_help), {:controller => 'help', :ctrl => 'wiki', :page => 'syntax' },
:onclick => "window.open('#{ url_for :controller => 'help', :ctrl => 'wiki', :page => 'syntax' }', '', 'resizable=yes, location=no, width=300, height=500, menubar=no, status=no, scrollbars=yes'); return false;" %>
</div>
<p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit' %></p>
<p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %></p>
<p><label><%= l(:field_comments) %></label><br /><%= f.text_field :comments, :size => 120 %></p>
<p><%= submit_tag l(:button_save) %>
<%= link_to_remote l(:label_preview),
@@ -17,7 +17,7 @@
:update => 'preview',
:with => "Form.serialize('wiki_form')",
:complete => "location.href='#preview-top'"
} %></p>
}, :accesskey => accesskey(:preview) %></p>
<%= wikitoolbar_for 'content_text' %>
<% end %>


+ 1
- 1
app/views/wiki/show.rhtml 查看文件

@@ -1,5 +1,5 @@
<div class="contextual">
<%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :page => @page.title}, :class => 'icon icon-edit') if @content.version == @page.content.version %>
<%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :page => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) if @content.version == @page.content.version %>
<%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :page => @page.title}, :class => 'icon icon-move') if @content.version == @page.content.version %>
<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :page => @page.title}, :method => :post, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %>
<%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :page => @page.title, :version => @content.version }, :class => 'icon icon-cancel') if @content.version < @page.content.version %>

正在加载...
取消
保存