diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-04 17:10:39 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-05 19:10:52 +0100 |
commit | 9910b7ff99c3d7f89f512c1915ce40ed0c1696e3 (patch) | |
tree | 8c1bde789456fd191afd928172174f6516f032b3 /lib | |
parent | 56a456b43dba7d772db45e2b73aa18b5eab53d37 (diff) | |
download | gitlab-ce-9910b7ff99c3d7f89f512c1915ce40ed0c1696e3.tar.gz |
Allow groups to be mentioned.
Resolves #1673.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/markdown.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index c0e83fb3078..78627f413c2 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -202,8 +202,15 @@ module Gitlab if identifier == "all" link_to("@all", project_url(project), options) - elsif User.find_by(username: identifier) - link_to("@#{identifier}", user_url(identifier), options) + elsif namespace = Namespace.find_by(path: identifier) + url = + if namespace.type == "Group" + group_url(identifier) + else + user_url(identifier) + end + + link_to("@#{identifier}", url, options) end end |