(refs #2)Add issue and pull request icon.

This commit is contained in:
takezoe
2013-08-05 14:40:06 +09:00
parent 4ea23a96ae
commit b58c19b88b
7 changed files with 25 additions and 22 deletions

View File

@@ -51,6 +51,13 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
def link(value: String, repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context): Html =
Html(convertRefsLinks(value, repository))
def cut(value: String, length: Int): String =
if(value.length > length){
value.substring(0, length) + "..."
} else {
value
}
def activityMessage(message: String)(implicit context: app.Context): Html =
Html(message
.replaceAll("\\[issue:([^\\s]+?)/([^\\s]+?)#((\\d+))\\]" , s"""<a href="${context.path}/$$1/$$2/issues/$$3">$$1/$$2#$$3</a>""")