diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-14 22:15:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-14 22:15:18 +0800 |
commit | 7a9a5c8a69c2a3ba107a4dbc199f052d58262033 (patch) | |
tree | a6940099182c4427ff010fc2368aeabb67b57ff6 /routers/repo | |
parent | 3a91ac51a93aa6e352896048ce37c01227b42055 (diff) | |
download | gitea-7a9a5c8a69c2a3ba107a4dbc199f052d58262033.tar.gz gitea-7a9a5c8a69c2a3ba107a4dbc199f052d58262033.zip |
Fix assigned issues dashboard (#920)
* Fix assigned/created issues in dashboard. (#3560)
* Fix assigned/created issues in dashboard.
* Use GetUserIssueStats for getting all Dashboard stats.
* Use gofmt to format the file properly.
* Replace &Issue{} with new(Issue).
* Check if user has access to given repository.
* Remove unnecessary filtering of issues.
* Return 404 error if invalid repository is given.
* Use correct number of issues in paginater.
* fix issues on dashboard
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/issue.go | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index e9b60175f3..a06f21b859 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -10,7 +10,6 @@ import ( "fmt" "io" "io/ioutil" - "net/url" "strings" "time" @@ -108,37 +107,17 @@ func Issues(ctx *context.Context) { viewType := ctx.Query("type") sortType := ctx.Query("sort") - types := []string{"assigned", "created_by", "mentioned"} + types := []string{"all", "assigned", "created_by", "mentioned"} if !com.IsSliceContainsStr(types, viewType) { viewType = "all" } - // Must sign in to see issues about you. - if viewType != "all" && !ctx.IsSigned { - ctx.SetCookie("redirect_to", "/"+url.QueryEscape(setting.AppSubURL+ctx.Req.RequestURI), 0, setting.AppSubURL) - ctx.Redirect(setting.AppSubURL + "/user/login") - return - } - var ( assigneeID = ctx.QueryInt64("assignee") posterID int64 mentionedID int64 forceEmpty bool ) - switch viewType { - case "assigned": - if assigneeID > 0 && ctx.User.ID != assigneeID { - // two different assignees, must be empty - forceEmpty = true - } else { - assigneeID = ctx.User.ID - } - case "created_by": - posterID = ctx.User.ID - case "mentioned": - mentionedID = ctx.User.ID - } repo := ctx.Repo.Repository selectLabels := ctx.Query("labels") |