|
|
@ -277,7 +277,7 @@ func RenderCommitMessage(full bool, msg, urlPrefix string, metas map[string]stri |
|
|
|
|
|
|
|
|
|
|
|
// Actioner describes an action
|
|
|
|
// Actioner describes an action
|
|
|
|
type Actioner interface { |
|
|
|
type Actioner interface { |
|
|
|
GetOpType() int |
|
|
|
GetOpType() models.ActionType |
|
|
|
GetActUserName() string |
|
|
|
GetActUserName() string |
|
|
|
GetRepoUserName() string |
|
|
|
GetRepoUserName() string |
|
|
|
GetRepoName() string |
|
|
|
GetRepoName() string |
|
|
@ -289,25 +289,24 @@ type Actioner interface { |
|
|
|
GetIssueInfos() []string |
|
|
|
GetIssueInfos() []string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ActionIcon accepts a int that represents action operation type
|
|
|
|
// ActionIcon accepts an action operation type and returns an icon class name.
|
|
|
|
// and returns a icon class name.
|
|
|
|
func ActionIcon(opType models.ActionType) string { |
|
|
|
func ActionIcon(opType int) string { |
|
|
|
|
|
|
|
switch opType { |
|
|
|
switch opType { |
|
|
|
case 1, 8: // Create and transfer repository
|
|
|
|
case models.ActionCreateRepo, models.ActionTransferRepo: |
|
|
|
return "repo" |
|
|
|
return "repo" |
|
|
|
case 5, 9: // Commit repository
|
|
|
|
case models.ActionCommitRepo, models.ActionPushTag: |
|
|
|
return "git-commit" |
|
|
|
return "git-commit" |
|
|
|
case 6: // Create issue
|
|
|
|
case models.ActionCreateIssue: |
|
|
|
return "issue-opened" |
|
|
|
return "issue-opened" |
|
|
|
case 7: // New pull request
|
|
|
|
case models.ActionCreatePullRequest: |
|
|
|
return "git-pull-request" |
|
|
|
return "git-pull-request" |
|
|
|
case 10: // Comment issue
|
|
|
|
case models.ActionCommentIssue: |
|
|
|
return "comment-discussion" |
|
|
|
return "comment-discussion" |
|
|
|
case 11: // Merge pull request
|
|
|
|
case models.ActionMergePullRequest: |
|
|
|
return "git-merge" |
|
|
|
return "git-merge" |
|
|
|
case 12, 14: // Close issue or pull request
|
|
|
|
case models.ActionCloseIssue, models.ActionClosePullRequest: |
|
|
|
return "issue-closed" |
|
|
|
return "issue-closed" |
|
|
|
case 13, 15: // Reopen issue or pull request
|
|
|
|
case models.ActionReopenIssue, models.ActionReopenPullRequest: |
|
|
|
return "issue-reopened" |
|
|
|
return "issue-reopened" |
|
|
|
default: |
|
|
|
default: |
|
|
|
return "invalid type" |
|
|
|
return "invalid type" |
|
|
|