Merge branch 'link-to-issue-tracker' of https://github.com/Undev/gitlabhq into Undev-link-to-issue-tracker

Conflicts:
	Gemfile.lock
This commit is contained in:
Dmitriy Zaporozhets 2013-02-28 17:02:20 +02:00
commit e1f77b9be0
20 changed files with 299 additions and 14 deletions

View file

@ -25,6 +25,8 @@ module Gitlab
# >> gfm(":trollface:")
# => "<img alt=\":trollface:\" class=\"emoji\" src=\"/images/trollface.png" title=\":trollface:\" />
module Markdown
include IssuesHelper
attr_reader :html_options
# Public: Parse the provided text with GitLab-Flavored Markdown
@ -163,8 +165,11 @@ module Gitlab
end
def reference_issue(identifier)
if issue = @project.issues.where(id: identifier).first
link_to("##{identifier}", project_issue_url(@project, issue), html_options.merge(title: "Issue: #{issue.title}", class: "gfm gfm-issue #{html_options[:class]}"))
if @project.issue_exists? identifier
url = url_for_issue(identifier)
title = title_for_issue(identifier)
link_to("##{identifier}", url, html_options.merge(title: "Issue: #{title}", class: "gfm gfm-issue #{html_options[:class]}"))
end
end