aboutsummaryrefslogtreecommitdiffstats
path: root/models/user_heatmap.go
diff options
context:
space:
mode:
authorJimmy Praet <jimmy.praet@telenet.be>2020-12-27 20:58:03 +0100
committerGitHub <noreply@github.com>2020-12-27 21:58:03 +0200
commit40274b4a935fff50e223751ce3653c2549352b10 (patch)
treea526f098018a04bbb12bccbebc6122ca209fa732 /models/user_heatmap.go
parent25f8970b2cc5d2c9fd357ef2c60a54886154f6c9 (diff)
downloadgitea-40274b4a935fff50e223751ce3653c2549352b10.tar.gz
gitea-40274b4a935fff50e223751ce3653c2549352b10.zip
Team dashboards (#14159)
Diffstat (limited to 'models/user_heatmap.go')
-rw-r--r--models/user_heatmap.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/models/user_heatmap.go b/models/user_heatmap.go
index 425817e6d1..f518249111 100644
--- a/models/user_heatmap.go
+++ b/models/user_heatmap.go
@@ -17,6 +17,15 @@ type UserHeatmapData struct {
// GetUserHeatmapDataByUser returns an array of UserHeatmapData
func GetUserHeatmapDataByUser(user *User, doer *User) ([]*UserHeatmapData, error) {
+ return getUserHeatmapData(user, nil, doer)
+}
+
+// GetUserHeatmapDataByUserTeam returns an array of UserHeatmapData
+func GetUserHeatmapDataByUserTeam(user *User, team *Team, doer *User) ([]*UserHeatmapData, error) {
+ return getUserHeatmapData(user, team, doer)
+}
+
+func getUserHeatmapData(user *User, team *Team, doer *User) ([]*UserHeatmapData, error) {
hdata := make([]*UserHeatmapData, 0)
if !activityReadable(user, doer) {
@@ -39,6 +48,7 @@ func GetUserHeatmapDataByUser(user *User, doer *User) ([]*UserHeatmapData, error
cond, err := activityQueryCondition(GetFeedsOptions{
RequestedUser: user,
+ RequestedTeam: team,
Actor: doer,
IncludePrivate: true, // don't filter by private, as we already filter by repo access
IncludeDeleted: true,