mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +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:
parent
f20e317d6d
commit
30cea70dd8
2 changed files with 39 additions and 30 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue