@(activities: List[gitbucket.core.model.Activity])(implicit context: gitbucket.core.controller.Context) @import context._ @import gitbucket.core.view.helpers._ @if(activities.isEmpty){ No activity } else { @activities.map { activity =>
@(activity.activityType match { case "open_issue" => detailActivity(activity, "issue-opened") case "comment_issue" => detailActivity(activity, "comment-discussion") case "comment_commit" => detailActivity(activity, "comment-discussion") case "close_issue" => detailActivity(activity, "issue-closed") case "reopen_issue" => detailActivity(activity, "issue-reopened") case "open_pullreq" => detailActivity(activity, "git-pull-request") case "merge_pullreq" => detailActivity(activity, "git-merge") case "create_repository" => simpleActivity(activity, "repo") case "create_branch" => simpleActivity(activity, "git-branch") case "delete_branch" => simpleActivity(activity, "circle-slash") case "create_tag" => simpleActivity(activity, "tag") case "delete_tag" => simpleActivity(activity, "circle-slash") case "fork" => simpleActivity(activity, "repo-forked") case "push" => customActivity(activity, "git-commit"){
{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, "book"){
Created {activity.additionalInfo.get}.
} case "edit_wiki" => customActivity(activity, "book"){ activity.additionalInfo.get.split(":") match { case Array(pageName, commitId) =>
Edited {pageName}. View the diff »
case Array(pageName) =>
Edited {pageName}.
} } })
} } @detailActivity(activity: gitbucket.core.model.Activity, image: String) = { @*
*@
@helper.html.datetimeago(activity.activityDate)
@avatar(activity.activityUserName, 16) @activityMessage(activity.message)
@activity.additionalInfo.map { additionalInfo =>
@additionalInfo
}
} @customActivity(activity: gitbucket.core.model.Activity, image: String)(additionalInfo: Any) = { @*
*@
@helper.html.datetimeago(activity.activityDate)
@avatar(activity.activityUserName, 16) @activityMessage(activity.message)
@additionalInfo
} @simpleActivity(activity: gitbucket.core.model.Activity, image: String) = { @*
*@
@helper.html.datetimeago(activity.activityDate)
@avatar(activity.activityUserName, 16) @activityMessage(activity.message)
}