diff options
author | Michael Litvak <mlitbk@gmail.com> | 2014-05-13 23:37:09 +0300 |
---|---|---|
committer | Michael Litvak <mlitbk@gmail.com> | 2014-05-13 23:37:09 +0300 |
commit | cca2a53d6f756ac9adee2570703558a545ec2f1f (patch) | |
tree | f54b9c0bc017038f7724a509c25a6fcdcd98b5e6 | |
parent | 5d5c4535cb971f14c2cbde655e7f09d4f6b62eb1 (diff) | |
download | gitea-cca2a53d6f756ac9adee2570703558a545ec2f1f.tar.gz gitea-cca2a53d6f756ac9adee2570703558a545ec2f1f.zip |
Fix issue link in issues page
The link assumes that the issue belongs to the signed in
user, which is not necessarily the case
I changed it to use repository owner name instead
-rw-r--r-- | routers/user/home.go | 6 | ||||
-rw-r--r-- | templates/issue/user.tmpl | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/routers/user/home.go b/routers/user/home.go index 0a805903ec..b19f3ff4ac 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -235,6 +235,12 @@ func Issues(ctx *middleware.Context) { return } + err = issues[i].Repo.GetOwner() + if err != nil { + ctx.Handle(500, "user.Issues(GetOwner)", err) + return + } + issues[i].Poster, err = models.GetUserById(issues[i].PosterId) if err != nil { ctx.Handle(500, "user.Issues(GetUserById)", err) diff --git a/templates/issue/user.tmpl b/templates/issue/user.tmpl index f480c63a8f..d1c2bd9941 100644 --- a/templates/issue/user.tmpl +++ b/templates/issue/user.tmpl @@ -36,7 +36,7 @@ {{range .Issues}}{{if .}} <div class="list-group-item issue-item" id="issue-{{.Id}}"> <span class="number pull-right">#{{.Index}}</span> - <h5 class="title"><a href="/{{$.SignedUser.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Name}}</a></h5> + <h5 class="title"><a href="/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Name}}</a></h5> <p class="info"> <span class="author"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" width="20"/> <a href="/user/{{.Poster.Name}}">{{.Poster.Name}}</a></span> |