Merge pull request #2178 from SIkebe/redirect-to-releasePage-from-activity

Allow to redirect to Release page from activity
This commit is contained in:
Naoki Takezoe
2018-11-03 02:03:03 +09:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -360,7 +360,7 @@ trait ActivityService {
repositoryName,
activityUserName,
"release",
s"[user:${activityUserName}] released ${name} at [repo:${userName}/${repositoryName}]",
s"[user:${activityUserName}] released [release:${userName}/${repositoryName}/${name}] at [repo:${userName}/${repositoryName}]",
None,
currentDate
)

View File

@@ -232,6 +232,12 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
s"""<a href="${context.path}/${m.group(1)}/${m.group(2)}/commit/${m.group(3)}">${m.group(1)}/${m
.group(2)}@${m.group(3).substring(0, 7)}</a>"""
)
.replaceAll(
"\\[release:([^\\s]+?)/([^\\s]+?)/([^\\s]+?)\\]",
(m: Match) =>
s"""<a href="${context.path}/${m.group(1)}/${m.group(2)}/releases/${encodeRefName(m.group(3))}">${m
.group(3)}</a>"""
)
)
/**