make link_to_revision respect custom options

pull/2823/head
Florian Kraft 10 years ago
parent 66bdab706c
commit e2f35f1961
  1. 10
      lib/open_project/object_linking.rb

@ -75,11 +75,11 @@ module OpenProject
# Options:
# * :text - Link text (default to the formatted revision)
def link_to_revision(revision, project, options = {})
text = options.delete(:text) || format_revision(revision)
rev = revision.respond_to?(:identifier) ? revision.identifier : revision
link_to(h(text), { controller: '/repositories', action: 'revision', project_id: project, rev: rev },
title: l(:label_revision_id, format_revision(revision)))
text = options.delete(:text) || format_revision(revision)
rev = revision.respond_to?(:identifier) ? revision.identifier : revision
url_options = { controller: '/repositories', action: 'revision', project_id: project, rev: rev }
html_options = { title: l(:label_revision_id, format_revision(revision)) }.merge options
link_to(h(text), url_options, html_options)
end
# Generates a link to a message

Loading…
Cancel
Save