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
link_to("##{identifier}", url, options)
end
elsif project.redmine_tracker?
reference_redmine_issue(identifier, project)
elsif project.jira_tracker?
reference_jira_issue(identifier, project)
else
config = Gitlab.config
external_issue_tracker = config.issues_tracker[project.issues_tracker]
if external_issue_tracker.present?
reference_external_issue(identifier, external_issue_tracker, project)
end
end
end
......@@ -231,26 +233,15 @@ module Gitlab
end
end
def reference_jira_issue(identifier, project = @project)
url = url_for_issue(identifier)
title = Gitlab.config.issues_tracker[project.issues_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"]
def reference_external_issue(identifier, issue_tracker, project = @project)
url = url_for_issue(identifier, project)
title = issue_tracker['title']
options = html_options.merge(
title: "Issue in #{title}",
class: "gfm gfm-issue #{html_options[:class]}"
)
link_to("rm##{identifier}", url, options)
link_to("##{identifier}", url, options)
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