Add icons for activity.
@@ -112,7 +112,7 @@ trait ActivityService {
|
||||
|
||||
def recordCreateBranchActivity(userName: String, repositoryName: String, activityUserName: String, branchName: String) =
|
||||
Activities.autoInc insert(userName, repositoryName, activityUserName,
|
||||
"create_tag",
|
||||
"create_branch",
|
||||
s"[user:${activityUserName}] created branch [tag:${userName}/${repositoryName}#${branchName}] at [repo:${userName}/${repositoryName}]",
|
||||
None,
|
||||
currentDate)
|
||||
|
||||
@@ -1,28 +1,62 @@
|
||||
@(activities: List[model.Activity])(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@if(activities.isEmpty){
|
||||
No activity
|
||||
} else {
|
||||
@activities.map { activity =>
|
||||
<div class="block">
|
||||
|
||||
@longActivity(activity: model.Activity, image: String) = {
|
||||
<div style="position: absolute; padding-top: 8px;"><img src="@assets/common/images/@image"/></div>
|
||||
<div style="margin-left: 40px;">
|
||||
<div class="muted small">@datetime(activity.activityDate)</div>
|
||||
<div class="strong">
|
||||
@avatar(activity.activityUserName, 16)
|
||||
@activityMessage(activity.message)
|
||||
</div>
|
||||
@activity.additionalInfo.map { additionalInfo =>
|
||||
@if(additionalInfo.nonEmpty){
|
||||
<div class=" activity-message">@additionalInfo</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@customActivity(activity: model.Activity, image: String)(additionalInfo: Any) = {
|
||||
<div style="position: absolute; padding-top: 8px;"><img src="@assets/common/images/@image"/></div>
|
||||
<div style="margin-left: 40px;">
|
||||
<div class="muted small">@datetime(activity.activityDate)</div>
|
||||
<div class="strong">
|
||||
@avatar(activity.activityUserName, 16)
|
||||
@activityMessage(activity.message)
|
||||
</div>
|
||||
@additionalInfo
|
||||
</div>
|
||||
}
|
||||
|
||||
@shortActivity(activity: model.Activity, image: String) = {
|
||||
<div style="position: absolute; padding-left: 8px;"><img src="@assets/common/images/@image"/></div>
|
||||
<div style="margin-left: 40px;">
|
||||
<div>
|
||||
@avatar(activity.activityUserName, 16)
|
||||
@activityMessage(activity.message)
|
||||
<span class="muted small">@datetime(activity.activityDate)</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(activities.isEmpty){
|
||||
No activity
|
||||
} else {
|
||||
@activities.map { activity =>
|
||||
<div class="block">
|
||||
@(activity.activityType match {
|
||||
case "create_wiki" => {
|
||||
<div class="small activity-message">Created <a href={s"${path}/${activity.userName}/${activity.repositoryName}/wiki/${additionalInfo}"}>{additionalInfo}</a>.</div>
|
||||
}
|
||||
case "edit_wiki" => {
|
||||
<div class="small activity-message">Edited <a href={s"${path}/${activity.userName}/${activity.repositoryName}/wiki/${additionalInfo}"}>{additionalInfo}</a>.</div>
|
||||
}
|
||||
case "push" => {
|
||||
case "open_issue" => longActivity(activity, "activity-issue.png")
|
||||
case "comment_issue" => longActivity(activity, "activity-comment.png")
|
||||
case "close_issue" => longActivity(activity, "activity-issue-close.png")
|
||||
case "reopen_issue" => longActivity(activity, "activity-issue-reopen.png")
|
||||
case "open_pullreq" => longActivity(activity, "activity-merge.png")
|
||||
case "merge_pullreq" => longActivity(activity, "activity-merge.png")
|
||||
case "create_repository" => shortActivity(activity, "activity-create-repository.png")
|
||||
case "create_branch" => shortActivity(activity, "activity-branch.png")
|
||||
case "fork" => shortActivity(activity, "activity-fork.png")
|
||||
case "push" => customActivity(activity, "activity-commit.png"){
|
||||
<div class="small activity-message">
|
||||
{additionalInfo.split("\n").reverse.take(4).zipWithIndex.map{ case (commit, i) =>
|
||||
{activity.additionalInfo.map { additionalInfo => additionalInfo.split("\n").reverse.take(4).zipWithIndex.map{ case (commit, i) =>
|
||||
if(i == 3){
|
||||
<div>...</div>
|
||||
} else {
|
||||
@@ -31,15 +65,20 @@
|
||||
<span>{commit.substring(41)}</span>
|
||||
</div>
|
||||
}
|
||||
}}
|
||||
}}}
|
||||
</div>
|
||||
}
|
||||
case _ => {
|
||||
<div class=" activity-message">{additionalInfo}</div>
|
||||
case "create_wiki" => customActivity(activity, "activity-wiki.png"){
|
||||
<div class="small activity-message">
|
||||
Created <a href={s"${path}/${activity.userName}/${activity.repositoryName}/wiki/${activity.additionalInfo.get}"}>{activity.additionalInfo.get}</a>.
|
||||
</div>
|
||||
}
|
||||
case "edit_wiki" => customActivity(activity, "activity-wiki.png"){
|
||||
<div class="small activity-message">
|
||||
Edited <a href={s"${path}/${activity.userName}/${activity.repositoryName}/wiki/${activity.additionalInfo.get}"}>{activity.additionalInfo.get}</a>.
|
||||
</div>
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src/main/webapp/assets/common/images/activity-branch.png
Normal file
|
After Width: | Height: | Size: 300 B |
BIN
src/main/webapp/assets/common/images/activity-comment.png
Normal file
|
After Width: | Height: | Size: 390 B |
BIN
src/main/webapp/assets/common/images/activity-commit.png
Normal file
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 318 B |
BIN
src/main/webapp/assets/common/images/activity-fork.png
Normal file
|
After Width: | Height: | Size: 308 B |
BIN
src/main/webapp/assets/common/images/activity-issue-close.png
Normal file
|
After Width: | Height: | Size: 805 B |
BIN
src/main/webapp/assets/common/images/activity-issue-reopen.png
Normal file
|
After Width: | Height: | Size: 834 B |
BIN
src/main/webapp/assets/common/images/activity-issue.png
Normal file
|
After Width: | Height: | Size: 776 B |
BIN
src/main/webapp/assets/common/images/activity-merge.png
Normal file
|
After Width: | Height: | Size: 581 B |
BIN
src/main/webapp/assets/common/images/activity-wiki.png
Normal file
|
After Width: | Height: | Size: 564 B |