Added the revision title to any revision links.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3216 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis 2009-12-22 23:23:54 +00:00
parent ffe8222257
commit 9f59cd64ab
39 changed files with 48 additions and 4 deletions

View File

@ -96,6 +96,15 @@ module ApplicationHelper
link_to(h(text), {:controller => 'attachments', :action => action, :id => attachment, :filename => attachment.filename }, options) link_to(h(text), {:controller => 'attachments', :action => action, :id => attachment, :filename => attachment.filename }, options)
end end
# Generates a link to a SCM revision
# Options:
# * :text - Link text (default to the formatted revision)
def link_to_revision(revision, project, options={})
text = options.delete(:text) || format_revision(revision)
link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => revision}, :title => l(:label_revision_id, revision))
end
def toggle_link(name, id, options={}) def toggle_link(name, id, options={})
onclick = "Element.toggle('#{id}'); " onclick = "Element.toggle('#{id}'); "
onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ") onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")

View File

@ -17,7 +17,7 @@
</td> </td>
<td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td> <td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>
<% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %> <% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %>
<td class="revision"><%= link_to(format_revision(entry.lastrev.name), :action => 'revision', :id => @project, :rev => entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %></td> <td class="revision"><%= link_to_revision(changeset.revision, @project) if changeset %></td>
<td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td> <td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td>
<td class="author"><%= changeset.nil? ? h(entry.lastrev.author.to_s.split('<').first) : changeset.author if entry.lastrev %></td> <td class="author"><%= changeset.nil? ? h(entry.lastrev.author.to_s.split('<').first) : changeset.author if entry.lastrev %></td>
<td class="comments"><%=h truncate(changeset.comments, :length => 50) unless changeset.nil? %></td> <td class="comments"><%=h truncate(changeset.comments, :length => 50) unless changeset.nil? %></td>

View File

@ -13,7 +13,7 @@
<% line_num = 1 %> <% line_num = 1 %>
<% revisions.each do |changeset| %> <% revisions.each do |changeset| %>
<tr class="changeset <%= cycle 'odd', 'even' %>"> <tr class="changeset <%= cycle 'odd', 'even' %>">
<td class="id"><%= link_to format_revision(changeset.revision), :action => 'revision', :id => project, :rev => changeset.revision %></td> <td class="id"><%= link_to_revision(changeset.revision, project) %></td>
<td class="checkbox"><%= radio_button_tag('rev', changeset.revision, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < revisions.size) %></td> <td class="checkbox"><%= radio_button_tag('rev', changeset.revision, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < revisions.size) %></td>
<td class="checkbox"><%= radio_button_tag('rev_to', changeset.revision, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('cb-#{line_num}').checked==true) {$('cb-#{line_num-1}').checked=true;}") if show_diff && (line_num > 1) %></td> <td class="checkbox"><%= radio_button_tag('rev_to', changeset.revision, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('cb-#{line_num}').checked==true) {$('cb-#{line_num-1}').checked=true;}") if show_diff && (line_num > 1) %></td>
<td class="committed_on"><%= format_time(changeset.committed_on) %></td> <td class="committed_on"><%= format_time(changeset.committed_on) %></td>

View File

@ -1,13 +1,13 @@
<div class="contextual"> <div class="contextual">
&#171; &#171;
<% unless @changeset.previous.nil? -%> <% unless @changeset.previous.nil? -%>
<%= link_to l(:label_previous), :controller => 'repositories', :action => 'revision', :id => @project, :rev => @changeset.previous.revision %> <%= link_to_revision(@changeset.previous.revision, @project, :text => l(:label_previous)) %>
<% else -%> <% else -%>
<%= l(:label_previous) %> <%= l(:label_previous) %>
<% end -%> <% end -%>
| |
<% unless @changeset.next.nil? -%> <% unless @changeset.next.nil? -%>
<%= link_to l(:label_next), :controller => 'repositories', :action => 'revision', :id => @project, :rev => @changeset.next.revision %> <%= link_to_revision(@changeset.next.revision, @project, :text => l(:label_next)) %>
<% else -%> <% else -%>
<%= l(:label_next) %> <%= l(:label_next) %>
<% end -%> <% end -%>

View File

@ -856,3 +856,4 @@ bg:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -880,3 +880,4 @@ bs:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -859,3 +859,4 @@ ca:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -862,3 +862,4 @@ cs:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -882,3 +882,4 @@ da:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -882,3 +882,4 @@ de:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -862,3 +862,4 @@ el:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -580,6 +580,7 @@ en:
label_tag: Tag label_tag: Tag
label_revision: Revision label_revision: Revision
label_revision_plural: Revisions label_revision_plural: Revisions
label_revision_id: "Revision {{value}}"
label_associated_revisions: Associated revisions label_associated_revisions: Associated revisions
label_added: added label_added: added
label_modified: modified label_modified: modified

View File

@ -903,3 +903,4 @@ es:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -892,3 +892,4 @@ fi:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -885,3 +885,4 @@ fr:
enumeration_system_activity: Activité système enumeration_system_activity: Activité système
setting_gravatar_default: Default Gravatar image setting_gravatar_default: Default Gravatar image
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
label_revision_id: Revision {{value}}

View File

@ -882,3 +882,4 @@ gl:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -866,3 +866,4 @@ he:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -887,3 +887,4 @@
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -869,3 +869,4 @@ it:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -891,3 +891,4 @@ ja:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -922,3 +922,4 @@ ko:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -930,3 +930,4 @@ lt:
label_update_issue_done_ratios: Update issue done ratios label_update_issue_done_ratios: Update issue done ratios
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -844,3 +844,4 @@ nl:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -857,3 +857,4 @@
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -885,3 +885,4 @@ pl:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -890,3 +890,4 @@ pt-BR:
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -874,3 +874,4 @@ pt:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -859,3 +859,4 @@ ro:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -970,3 +970,4 @@ ru:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -861,3 +861,4 @@ sk:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -858,3 +858,4 @@ sl:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -877,3 +877,4 @@
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -911,3 +911,4 @@ sv:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -859,3 +859,4 @@ th:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -889,3 +889,4 @@ tr:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -858,3 +858,4 @@ uk:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -921,3 +921,4 @@ vi:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}

View File

@ -955,3 +955,4 @@
enumeration_doc_categories: 文件分類 enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (時間追蹤) enumeration_activities: 活動 (時間追蹤)
enumeration_system_activity: 系統活動 enumeration_system_activity: 系統活動
label_revision_id: Revision {{value}}

View File

@ -886,3 +886,4 @@ zh:
setting_start_of_week: Start calendars on setting_start_of_week: Start calendars on
permission_view_issues: View Issues permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker label_display_used_statuses_only: Only display statuses that are used by this tracker
label_revision_id: Revision {{value}}