mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Team dashboards (#14159)
This commit is contained in:
parent
25f8970b2c
commit
40274b4a93
12 changed files with 148 additions and 47 deletions
|
@ -289,6 +289,7 @@ func (a *Action) GetIssueContent() string {
|
|||
// GetFeedsOptions options for retrieving feeds
|
||||
type GetFeedsOptions struct {
|
||||
RequestedUser *User // the user we want activity for
|
||||
RequestedTeam *Team // the team we want activity for
|
||||
Actor *User // the user viewing the activity
|
||||
IncludePrivate bool // include private actions
|
||||
OnlyPerformedBy bool // only actions performed by requested user
|
||||
|
@ -357,6 +358,15 @@ func activityQueryCondition(opts GetFeedsOptions) (builder.Cond, error) {
|
|||
}
|
||||
}
|
||||
|
||||
if opts.RequestedTeam != nil {
|
||||
env := opts.RequestedUser.AccessibleTeamReposEnv(opts.RequestedTeam)
|
||||
teamRepoIDs, err := env.RepoIDs(1, opts.RequestedUser.NumRepos)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("GetTeamRepositories: %v", err)
|
||||
}
|
||||
cond = cond.And(builder.In("repo_id", teamRepoIDs))
|
||||
}
|
||||
|
||||
cond = cond.And(builder.Eq{"user_id": opts.RequestedUser.ID})
|
||||
|
||||
if opts.OnlyPerformedBy {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue