Add icons for activity.
@@ -112,7 +112,7 @@ trait ActivityService {
|
|||||||
|
|
||||||
def recordCreateBranchActivity(userName: String, repositoryName: String, activityUserName: String, branchName: String) =
|
def recordCreateBranchActivity(userName: String, repositoryName: String, activityUserName: String, branchName: String) =
|
||||||
Activities.autoInc insert(userName, repositoryName, activityUserName,
|
Activities.autoInc insert(userName, repositoryName, activityUserName,
|
||||||
"create_tag",
|
"create_branch",
|
||||||
s"[user:${activityUserName}] created branch [tag:${userName}/${repositoryName}#${branchName}] at [repo:${userName}/${repositoryName}]",
|
s"[user:${activityUserName}] created branch [tag:${userName}/${repositoryName}#${branchName}] at [repo:${userName}/${repositoryName}]",
|
||||||
None,
|
None,
|
||||||
currentDate)
|
currentDate)
|
||||||
|
|||||||
@@ -1,28 +1,62 @@
|
|||||||
@(activities: List[model.Activity])(implicit context: app.Context)
|
@(activities: List[model.Activity])(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@import view.helpers._
|
@import view.helpers._
|
||||||
@if(activities.isEmpty){
|
|
||||||
No activity
|
@longActivity(activity: model.Activity, image: String) = {
|
||||||
} else {
|
<div style="position: absolute; padding-top: 8px;"><img src="@assets/common/images/@image"/></div>
|
||||||
@activities.map { activity =>
|
<div style="margin-left: 40px;">
|
||||||
<div class="block">
|
|
||||||
<div class="muted small">@datetime(activity.activityDate)</div>
|
<div class="muted small">@datetime(activity.activityDate)</div>
|
||||||
<div class="strong">
|
<div class="strong">
|
||||||
@avatar(activity.activityUserName, 16)
|
@avatar(activity.activityUserName, 16)
|
||||||
@activityMessage(activity.message)
|
@activityMessage(activity.message)
|
||||||
</div>
|
</div>
|
||||||
@activity.additionalInfo.map { additionalInfo =>
|
@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 {
|
@(activity.activityType match {
|
||||||
case "create_wiki" => {
|
case "open_issue" => longActivity(activity, "activity-issue.png")
|
||||||
<div class="small activity-message">Created <a href={s"${path}/${activity.userName}/${activity.repositoryName}/wiki/${additionalInfo}"}>{additionalInfo}</a>.</div>
|
case "comment_issue" => longActivity(activity, "activity-comment.png")
|
||||||
}
|
case "close_issue" => longActivity(activity, "activity-issue-close.png")
|
||||||
case "edit_wiki" => {
|
case "reopen_issue" => longActivity(activity, "activity-issue-reopen.png")
|
||||||
<div class="small activity-message">Edited <a href={s"${path}/${activity.userName}/${activity.repositoryName}/wiki/${additionalInfo}"}>{additionalInfo}</a>.</div>
|
case "open_pullreq" => longActivity(activity, "activity-merge.png")
|
||||||
}
|
case "merge_pullreq" => longActivity(activity, "activity-merge.png")
|
||||||
case "push" => {
|
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">
|
<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){
|
if(i == 3){
|
||||||
<div>...</div>
|
<div>...</div>
|
||||||
} else {
|
} else {
|
||||||
@@ -31,15 +65,20 @@
|
|||||||
<span>{commit.substring(41)}</span>
|
<span>{commit.substring(41)}</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}}
|
}}}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
case _ => {
|
case "create_wiki" => customActivity(activity, "activity-wiki.png"){
|
||||||
<div class=" activity-message">{additionalInfo}</div>
|
<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>
|
</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 |