Merge pull request #7147 from zzet/patch-12
Update markdown reference to external issues
This commit is contained in:
commit
3131d0609c
1 changed files with 10 additions and 6 deletions
|
@ -192,8 +192,12 @@ module Gitlab
|
|||
|
||||
link_to("##{identifier}", url, options)
|
||||
end
|
||||
elsif project.issues_tracker == 'jira'
|
||||
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
|
||||
|
||||
|
@ -229,15 +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"]
|
||||
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("#{identifier}", url, options)
|
||||
link_to("##{identifier}", url, options)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue