Refactor dashboard/feed.tmpl (#26956)

- ~~Refactor `ActionType` to `models/activities/action_type.go`~~
- Replace the magic number in `feed.tmlp` with `InAction`
This commit is contained in:
CaiCandong 2023-09-07 22:23:13 +08:00 committed by GitHub
parent f20e317d6d
commit 30cea70dd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 30 deletions

View file

@ -126,6 +126,15 @@ func (at ActionType) String() string {
}
}
func (at ActionType) InActions(actions ...string) bool {
for _, action := range actions {
if action == at.String() {
return true
}
}
return false
}
// Action represents user operation type and other information to
// repository. It implemented interface base.Actioner so that can be
// used in template render.