summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorCaiCandong <50507092+CaiCandong@users.noreply.github.com>2023-09-07 22:23:13 +0800
committerGitHub <noreply@github.com>2023-09-07 16:23:13 +0200
commit30cea70dd8e0a4583d8f63795b21551ce44ce223 (patch)
treed0b81a6b36e1a67e761195f204d20f7251cc414c /models
parentf20e317d6d2e298a75a1c9d3255a1a7340d4c48d (diff)
downloadgitea-30cea70dd8e0a4583d8f63795b21551ce44ce223.tar.gz
gitea-30cea70dd8e0a4583d8f63795b21551ce44ce223.zip
Refactor dashboard/feed.tmpl (#26956)
- ~~Refactor `ActionType` to `models/activities/action_type.go`~~ - Replace the magic number in `feed.tmlp` with `InAction`
Diffstat (limited to 'models')
-rw-r--r--models/activities/action.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/models/activities/action.go b/models/activities/action.go
index 432bf8bf3f..07c8053425 100644
--- a/models/activities/action.go
+++ b/models/activities/action.go
@@ -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.