loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'Fix regression from #4753' (#6029) from JakobDev/forgejo:notefix into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6029
Reviewed-by: 0ko <0ko@noreply.codeberg.org>

0ko 1316f4d3 3674e90c

+30 -2
+2 -2
templates/repo/commit_page.tmpl
··· 278 278 <strong>{{.NoteCommit.Author.Name}}</strong> 279 279 {{end}} 280 280 <span class="text grey" id="note-authored-time">{{DateUtils.TimeSince .NoteCommit.Author.When}}</span> 281 - {{if or ($.Permission.CanWrite $.UnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}} 281 + {{if and ($.Permission.CanWrite $.UnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}} 282 282 <div class="ui right"> 283 - <button id="commit-notes-edit-button" class="ui tiny primary button" data-modal="#delete-note-modal">{{ctx.Locale.Tr "edit"}}</button> 283 + <button id="commit-notes-edit-button" class="ui tiny primary button">{{ctx.Locale.Tr "edit"}}</button> 284 284 <button class="ui tiny button red show-modal" data-modal="#delete-note-modal">{{ctx.Locale.Tr "remove"}}</button> 285 285 </div> 286 286 <div class="ui small modal" id="delete-note-modal">
+28
tests/integration/repo_git_note_test.go
··· 5 5 "net/url" 6 6 "testing" 7 7 8 + "code.gitea.io/gitea/tests" 9 + 8 10 "github.com/stretchr/testify/assert" 9 11 ) 10 12 ··· 42 44 }) 43 45 }) 44 46 } 47 + 48 + func TestRepoGitNotesButtonsVisible(t *testing.T) { 49 + onGiteaRun(t, func(*testing.T, *url.URL) { 50 + t.Run("With Permission", func(t *testing.T) { 51 + defer tests.PrintCurrentTest(t)() 52 + 53 + session := loginUser(t, "user2") 54 + 55 + req := NewRequest(t, "GET", "/user2/repo1/commit/65f1bf27bc3bf70f64657658635e66094edbcb4d") 56 + resp := session.MakeRequest(t, req, http.StatusOK) 57 + 58 + assert.Contains(t, resp.Body.String(), "id=\"commit-notes-edit-button\"") 59 + assert.Contains(t, resp.Body.String(), "data-modal=\"#delete-note-modal\"") 60 + }) 61 + 62 + t.Run("Without Permission", func(t *testing.T) { 63 + defer tests.PrintCurrentTest(t)() 64 + 65 + req := NewRequest(t, "GET", "/user2/repo1/commit/65f1bf27bc3bf70f64657658635e66094edbcb4d") 66 + resp := MakeRequest(t, req, http.StatusOK) 67 + 68 + assert.NotContains(t, resp.Body.String(), "id=\"commit-notes-edit-button\"") 69 + assert.NotContains(t, resp.Body.String(), "data-modal=\"#delete-note-modal\"") 70 + }) 71 + }) 72 + }