@(activities: List[gitbucket.core.model.Activity])(implicit context: gitbucket.core.controller.Context) @import gitbucket.core.view.helpers @if(activities.isEmpty){ No activity } else { @activities.map { activity =>
@(activity.activityType match { case "open_issue" => simpleActivity(activity) case "comment_issue" => simpleActivity(activity) case "comment_commit" => simpleActivity(activity) case "close_issue" => simpleActivity(activity) case "reopen_issue" => simpleActivity(activity) case "open_pullreq" => simpleActivity(activity) case "merge_pullreq" => simpleActivity(activity) case "release" => simpleActivity(activity) case "create_repository" => simpleActivity(activity) case "delete_repository" => simpleActivity(activity) case "rename_repository" => simpleActivity(activity) case "transfer_repository" => simpleActivity(activity) case "create_branch" => simpleActivity(activity) case "delete_branch" => simpleActivity(activity) case "create_tag" => simpleActivity(activity) case "delete_tag" => simpleActivity(activity) case "fork" => simpleActivity(activity) case "push" => customActivity(activity){
{activity.additionalInfo.get.split("\n").reverse.take(4).zipWithIndex.map{ case (commit, i) => if(i == 3){
...
} else { if(commit.nonEmpty){
{commit.substring(0, 7)} {commit.substring(41)}
} } }}
} case "create_wiki" => customActivity(activity){
Created {activity.additionalInfo.get}.
} case "edit_wiki" => customActivity(activity){ activity.additionalInfo.get.split(":") match { case Array(pageName, commitId) =>
Edited {pageName}. View the diff »
case Array(pageName) =>
Edited {pageName}.
} } })
} } @customActivity(activity: gitbucket.core.model.Activity)(additionalInfo: Any) = {
@gitbucket.core.helper.html.datetimeago(activity.activityDate)
@helpers.avatarLink(activity.activityUserName, 16) @helpers.activityMessage(activity.message)
@additionalInfo
} @simpleActivity(activity: gitbucket.core.model.Activity) = {
@gitbucket.core.helper.html.datetimeago(activity.activityDate)
@helpers.avatarLink(activity.activityUserName, 16) @helpers.activityMessage(activity.message)
}