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 '[BUG] Escape editor.add_tmpl translation' (#3269) from gusted/forgejo-escape-tr into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3269
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>

+14 -1
+1 -1
templates/repo/editor/commit_form.tmpl
··· 9 9 {{ctx.Locale.Tr "repo.editor.commit_changes"}} 10 10 {{- end}}</h3> 11 11 <div class="field"> 12 - <input name="commit_summary" maxlength="100" placeholder="{{if .PageIsDelete}}{{ctx.Locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{ctx.Locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{ctx.Locale.Tr "repo.editor.patch"}}{{else}}{{ctx.Locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus> 12 + <input name="commit_summary" maxlength="100" placeholder="{{if .PageIsDelete}}{{ctx.Locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{ctx.Locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{ctx.Locale.TrString "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{ctx.Locale.Tr "repo.editor.patch"}}{{else}}{{ctx.Locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus> 13 13 </div> 14 14 <div class="field"> 15 15 <textarea name="commit_message" placeholder="{{ctx.Locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>
+13
tests/integration/editor_test.go
··· 187 187 }) 188 188 } 189 189 190 + func TestEditorAddTranslation(t *testing.T) { 191 + defer tests.PrepareTestEnv(t)() 192 + 193 + session := loginUser(t, "user2") 194 + req := NewRequest(t, "GET", "/user2/repo1/_new/master") 195 + resp := session.MakeRequest(t, req, http.StatusOK) 196 + htmlDoc := NewHTMLParser(t, resp.Body) 197 + 198 + placeholder, ok := htmlDoc.Find("input[name='commit_summary']").Attr("placeholder") 199 + assert.True(t, ok) 200 + assert.EqualValues(t, `Add "<filename>"`, placeholder) 201 + } 202 + 190 203 func TestCommitMail(t *testing.T) { 191 204 onGiteaRun(t, func(t *testing.T, _ *url.URL) { 192 205 user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})