Skip to content

Commit

Permalink
Add links to link_to_revision
Browse files Browse the repository at this point in the history
  • Loading branch information
masamitsu-murase committed Nov 28, 2011
1 parent a96ab40 commit 05b691d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/redmine_add_subversion_links_application_helper_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 05b691d

Please sign in to comment.