]> source.dussan.org Git - gitea.git/commitdiff
Fix invalid reference in feeds template (#1820)
authorEthan Koenig <etk39@cornell.edu>
Sat, 27 May 2017 03:34:11 +0000 (23:34 -0400)
committerLunny Xiao <xiaolunwen@gmail.com>
Sat, 27 May 2017 03:34:11 +0000 (11:34 +0800)
* Fix invalid reference in feeds template

* Comment for GetActAvatar

* Add integration test

integrations/issue_test.go
models/action.go
templates/user/dashboard/feeds.tmpl

index 61ddc12adbb8eeb2cb6e87d01f3a90d61d55d770..51fcc96f8c65c68086709843d329457cec4d9750 100644 (file)
@@ -11,6 +11,15 @@ import (
        "github.com/stretchr/testify/assert"
 )
 
+func TestNoLoginViewIssues(t *testing.T) {
+       prepareTestEnv(t)
+
+       req, err := http.NewRequest("GET", "/user2/repo1/issues", nil)
+       assert.NoError(t, err)
+       resp := MakeRequest(req)
+       assert.EqualValues(t, http.StatusOK, resp.HeaderCode)
+}
+
 func TestNoLoginViewIssue(t *testing.T) {
        prepareTestEnv(t)
 
index 4af81ce80a6c9c5ef45fd5794ecde57c2de8a5ab..a09e420660e37c5b047ce6a6306d05451928c134 100644 (file)
@@ -142,6 +142,12 @@ func (a *Action) ShortActUserName() string {
        return base.EllipsisString(a.GetActUserName(), 20)
 }
 
+// GetActAvatar the action's user's avatar link
+func (a *Action) GetActAvatar() string {
+       a.loadActUser()
+       return a.ActUser.AvatarLink()
+}
+
 // GetRepoUserName returns the name of the action repository owner.
 func (a *Action) GetRepoUserName() string {
        a.loadRepo()
index fcc9b9cac5b14de48f58923a51bc458adf2931d6..12768bca528582711186dc93cccb81e96008afcd 100644 (file)
@@ -1,7 +1,7 @@
 {{range .Feeds}}
        <div class="news">
                <div class="ui left">
-                       <img class="ui avatar image" src="{{.ActAvatar}}" alt="">
+                       <img class="ui avatar image" src="{{.GetActAvatar}}" alt="">
                </div>
                <div class="ui grid">
                        <div class="ui fifteen wide column">