Allow to redirect to Release page from activity

This commit is contained in:
Ikebe Shodai
2018-11-02 17:39:11 +09:00
parent 1abec64da7
commit 7ab1f3e886
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>"""
)
)
/**