Commit 3131d060 authored by Marin Jankovski's avatar Marin Jankovski

Merge pull request #7147 from zzet/patch-12

Update markdown reference to external issues
parents 494d15cf 11b707a6
...@@ -192,8 +192,12 @@ module Gitlab ...@@ -192,8 +192,12 @@ module Gitlab
link_to("##{identifier}", url, options) link_to("##{identifier}", url, options)
end end
elsif project.issues_tracker == 'jira' else
reference_jira_issue(identifier, project) 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
end end
...@@ -229,15 +233,15 @@ module Gitlab ...@@ -229,15 +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( 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("#{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