summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-09-08 06:43:13 +0000
committerGo MAEDA <maeda@farend.jp>2018-09-08 06:43:13 +0000
commit60ee5e109ee069f1c5ebd0af7f8fee08ff294d07 (patch)
tree9086be156a30a17aa707935ebaf0aad725e82c06 /app
parent2cffbf1d45e0ccabc338adb583284dfe437b9b22 (diff)
downloadredmine-60ee5e109ee069f1c5ebd0af7f8fee08ff294d07.tar.gz
redmine-60ee5e109ee069f1c5ebd0af7f8fee08ff294d07.zip
Adds ##123 extended issue linking syntax (#29488).
Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@17478 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb21
1 files changed, 15 insertions, 6 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 58b988454..546080386 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -830,6 +830,7 @@ module ApplicationHelper
# Examples:
# Issues:
# #52 -> Link to issue #52
+ # ##52 -> Link to issue #52, including the issue's subject
# Changesets:
# r52 -> Link to revision 52
# commit:a85130f -> Link to scmid starting with a85130f
@@ -917,17 +918,25 @@ module ApplicationHelper
:title => truncate_single_line_raw(changeset.comments, 100))
end
end
- elsif sep == '#'
+ elsif sep == '#' || sep == '##'
oid = identifier.to_i
case prefix
when nil
if oid.to_s == identifier &&
issue = Issue.visible.find_by_id(oid)
anchor = comment_id ? "note-#{comment_id}" : nil
- link = link_to("##{oid}#{comment_suffix}",
- issue_url(issue, :only_path => only_path, :anchor => anchor),
- :class => issue.css_classes,
- :title => "#{issue.tracker.name}: #{issue.subject.truncate(100)} (#{issue.status.name})")
+ url = issue_url(issue, :only_path => only_path, :anchor => anchor)
+ link = if sep == '##'
+ link_to("#{issue.tracker.name} ##{oid}#{comment_suffix}",
+ url,
+ :class => issue.css_classes,
+ :title => "#{issue.tracker.name}: #{issue.subject.truncate(100)} (#{issue.status.name})") + ": #{issue.subject}"
+ else
+ link_to("##{oid}#{comment_suffix}",
+ url,
+ :class => issue.css_classes,
+ :title => "#{issue.tracker.name}: #{issue.subject.truncate(100)} (#{issue.status.name})")
+ end
end
when 'document'
if document = Document.visible.find_by_id(oid)
@@ -1038,7 +1047,7 @@ module ApplicationHelper
(?<prefix>attachment|document|version|forum|news|message|project|commit|source|export|user)?
(
(
- (?<sep1>\#)|
+ (?<sep1>\#\#?)|
(
(?<repo_prefix>(?<repo_identifier>[a-z0-9\-_]+)\|)?
(?<sep2>r)