Commit ec3dda5b authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'pull_external_issue_tracker_fix_from_ce' into 'master'

Pull external issue tracker fix from ce

See merge request !171
parents 1e3f2e4b 7f0c15c8
...@@ -192,10 +192,12 @@ module Gitlab ...@@ -192,10 +192,12 @@ module Gitlab
link_to("##{identifier}", url, options) link_to("##{identifier}", url, options)
end end
elsif project.redmine_tracker? else
reference_redmine_issue(identifier, project) config = Gitlab.config
elsif project.jira_tracker? external_issue_tracker = config.issues_tracker[project.issues_tracker]
reference_jira_issue(identifier, project) if external_issue_tracker.present?
reference_external_issue(identifier, external_issue_tracker, project)
end
end end
end end
...@@ -231,26 +233,15 @@ module Gitlab ...@@ -231,26 +233,15 @@ module Gitlab
end end
end end
def reference_jira_issue(identifier, project = @project) def reference_external_issue(identifier, issue_tracker, project = @project)
url = url_for_issue(identifier) url = url_for_issue(identifier, project)
title = Gitlab.config.issues_tracker[project.issues_tracker]["title"] title = issue_tracker['title']
options = html_options.merge(
title: "Issue in #{title}",
class: "gfm gfm-issue #{html_options[:class]}"
)
link_to("#{identifier}", url, options)
end
def reference_redmine_issue(identifier, project = @project)
url = url_for_issue(identifier)
title = Gitlab.config.issues_tracker[project.issues_tracker]["title"]
options = html_options.merge( options = html_options.merge(
title: "Issue in #{title}", title: "Issue in #{title}",
class: "gfm gfm-issue #{html_options[:class]}" class: "gfm gfm-issue #{html_options[:class]}"
) )
link_to("rm##{identifier}", url, options) link_to("##{identifier}", url, options)
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment