1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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
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.