diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2009-12-22 23:23:54 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2009-12-22 23:23:54 +0000 |
commit | 9f59cd64ab9fd10668cad6bbeae3c4daadb0325a (patch) | |
tree | 846352fd78214964d9f4be927b52e61b8bf1cb93 | |
parent | ffe8222257d4d9da793c8085b3cca39599d2e812 (diff) | |
download | redmine-9f59cd64ab9fd10668cad6bbeae3c4daadb0325a.tar.gz redmine-9f59cd64ab9fd10668cad6bbeae3c4daadb0325a.zip |
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
39 files changed, 48 insertions, 4 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cdb64f417..0876127a1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -96,6 +96,15 @@ module ApplicationHelper link_to(h(text), {:controller => 'attachments', :action => action, :id => attachment, :filename => attachment.filename }, options) 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={}) onclick = "Element.toggle('#{id}'); " onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ") diff --git a/app/views/repositories/_dir_list_content.rhtml b/app/views/repositories/_dir_list_content.rhtml index 8b6a067b3..4e4589e1e 100644 --- a/app/views/repositories/_dir_list_content.rhtml +++ b/app/views/repositories/_dir_list_content.rhtml @@ -17,7 +17,7 @@ </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 %> -<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="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> diff --git a/app/views/repositories/_revisions.rhtml b/app/views/repositories/_revisions.rhtml index 8fb15525f..26fb5b699 100644 --- a/app/views/repositories/_revisions.rhtml +++ b/app/views/repositories/_revisions.rhtml @@ -13,7 +13,7 @@ <% line_num = 1 %> <% revisions.each do |changeset| %> <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_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> diff --git a/app/views/repositories/revision.rhtml b/app/views/repositories/revision.rhtml index b205be37c..92597dff7 100644 --- a/app/views/repositories/revision.rhtml +++ b/app/views/repositories/revision.rhtml @@ -1,13 +1,13 @@ <div class="contextual"> « <% 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 -%> <%= l(:label_previous) %> <% end -%> | <% 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 -%> <%= l(:label_next) %> <% end -%> diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 4302542ce..1bc29d0ba 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -856,3 +856,4 @@ bg: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/bs.yml b/config/locales/bs.yml index 5e33bb8ad..35097cf24 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -880,3 +880,4 @@ bs: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/ca.yml b/config/locales/ca.yml index c5120180d..07feeea06 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -859,3 +859,4 @@ ca: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 4ad8ad62a..7ab2c2113 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -862,3 +862,4 @@ cs: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/da.yml b/config/locales/da.yml index 246855811..2b2b378a4 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -882,3 +882,4 @@ da: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/de.yml b/config/locales/de.yml index e11ffb525..fc2699f47 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -882,3 +882,4 @@ de: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/el.yml b/config/locales/el.yml index 13f8f37c7..3b88da26f 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -862,3 +862,4 @@ el: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/en.yml b/config/locales/en.yml index 3eee529d1..cab7ff4a7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -580,6 +580,7 @@ en: label_tag: Tag label_revision: Revision label_revision_plural: Revisions + label_revision_id: "Revision {{value}}" label_associated_revisions: Associated revisions label_added: added label_modified: modified diff --git a/config/locales/es.yml b/config/locales/es.yml index c0aa91dba..a5c38a7c2 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -903,3 +903,4 @@ es: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 93d354dc4..c9e4c3136 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -892,3 +892,4 @@ fi: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/fr.yml b/config/locales/fr.yml index aa7fdafa9..b676cd2e6 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -885,3 +885,4 @@ fr: enumeration_system_activity: Activité système setting_gravatar_default: Default Gravatar image setting_start_of_week: Start calendars on + label_revision_id: Revision {{value}} diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 363a54ef3..f540981fb 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -882,3 +882,4 @@ gl: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/he.yml b/config/locales/he.yml index bc1723826..1eb00484e 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -866,3 +866,4 @@ he: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 8c9f289f9..a0961cd80 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -887,3 +887,4 @@ setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/it.yml b/config/locales/it.yml index 627daf347..2b5ee2fd3 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -869,3 +869,4 @@ it: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 1257db260..5bf9fa185 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -891,3 +891,4 @@ ja: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 081c3acd4..91d8c0988 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -922,3 +922,4 @@ ko: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/lt.yml b/config/locales/lt.yml index b21fb5c31..957f9ff88 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -930,3 +930,4 @@ lt: label_update_issue_done_ratios: Update issue done ratios permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 3acefe89f..37fa32a34 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -844,3 +844,4 @@ nl: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/no.yml b/config/locales/no.yml index a8b064c0e..b4956011a 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -857,3 +857,4 @@ setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/pl.yml b/config/locales/pl.yml index d3e502196..64cec48ee 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -885,3 +885,4 @@ pl: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 6491b0c54..69da727b3 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -890,3 +890,4 @@ pt-BR: permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 24c24190c..7601b2022 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -874,3 +874,4 @@ pt: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/ro.yml b/config/locales/ro.yml index 9a089118a..6217b8492 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -859,3 +859,4 @@ ro: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/ru.yml b/config/locales/ru.yml index c01e52a64..cde29d94a 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -970,3 +970,4 @@ ru: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/sk.yml b/config/locales/sk.yml index a20630837..16a9f2607 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -861,3 +861,4 @@ sk: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 61f84ad8b..736e3db49 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -858,3 +858,4 @@ sl: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/sr.yml b/config/locales/sr.yml index b58df8c60..ed4255501 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -877,3 +877,4 @@ setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/sv.yml b/config/locales/sv.yml index c73a75688..f674e77fd 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -911,3 +911,4 @@ sv: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/th.yml b/config/locales/th.yml index 8ad86d00a..745c340fc 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -859,3 +859,4 @@ th: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/tr.yml b/config/locales/tr.yml index e98b53f02..e41385979 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -889,3 +889,4 @@ tr: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 55dc50c56..df6469144 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -858,3 +858,4 @@ uk: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/vi.yml b/config/locales/vi.yml index d498cb53c..31e6d0a41 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -921,3 +921,4 @@ vi: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 03ca09c1d..46cbcafde 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -955,3 +955,4 @@ enumeration_doc_categories: 文件分類 enumeration_activities: 活動 (時間追蹤) enumeration_system_activity: 系統活動 + label_revision_id: Revision {{value}} diff --git a/config/locales/zh.yml b/config/locales/zh.yml index e34c5c3f3..1a41b40bc 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -886,3 +886,4 @@ zh: setting_start_of_week: Start calendars on permission_view_issues: View Issues label_display_used_statuses_only: Only display statuses that are used by this tracker + label_revision_id: Revision {{value}} |