Permalink
Browse files

Add links to link_to_revision

  • Loading branch information...
1 parent a96ab40 commit 05b691d9595ddf4e36b8b5e88abbf11515b7f298 @masamitsu-murase committed Nov 28, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/redmine_add_subversion_links_application_helper_patch.rb
@@ -8,6 +8,7 @@ def self.included(base)
base.class_eval do
alias_method_chain :parse_redmine_links, :add_subversion_links
+ alias_method_chain :link_to_revision, :add_subversion_links
end
end
@@ -34,6 +35,17 @@ def parse_redmine_links_with_add_subversion_links(text, project, obj, attr, only
parse_redmine_links_without_add_subversion_links(text, project_org, obj, attr, only_path, options)
end
+
+ def link_to_revision_with_add_subversion_links(revision, project, options={})
+ link = link_to_revision_without_add_subversion_links(revision, project, options)
+ if (revision && revision.revision &&
+ project && project.repository && project.repository.scm_name == "Subversion")
+ rev = revision.revision
+ link += " " + link_to(image_tag("svn_icon.png", :plugin => "redmine_add_subversion_links"),
+ project.repository.url, :rel => "tsvn[log][#{rev},#{rev}]")
+ end
+ return link
+ end
end
end

0 comments on commit 05b691d

Please sign in to comment.