Skip to content

Commit 5289f35

Browse files
authored
Merge branch 'main' into katex-rendering
2 parents 7a2387a + f1ea6c9 commit 5289f35

File tree

5 files changed

+35
-29
lines changed

5 files changed

+35
-29
lines changed

.drone.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,9 @@ steps:
569569
TEST_PGSQL_DBNAME: 'testgitea-e2e'
570570
DEBIAN_FRONTEND: noninteractive
571571
depends_on: [build-frontend, deps-backend]
572+
volumes:
573+
- name: deps
574+
path: /go
572575

573576
---
574577
kind: pipeline

docs/content/doc/developers/api-usage.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Note that `/users/:name/tokens` is a special endpoint and requires you
4949
to authenticate using `BasicAuth` and a password, as follows:
5050

5151
```sh
52-
$ curl -H "Content-Type: application/json" -k -d '{"name":"test"}' -u username:password https://gitea.your.host/api/v1/users/<username>/tokens
52+
$ curl -H "Content-Type: application/json" -d '{"name":"test"}' -u username:password https://gitea.your.host/api/v1/users/<username>/tokens
5353
{"id":1,"name":"test","sha1":"9fcb1158165773dd010fca5f0cf7174316c3e37d","token_last_eight":"16c3e37d"}
5454
```
5555

models/user.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ func DeleteUser(ctx context.Context, u *user_model.User, purge bool) (err error)
102102

103103
// Delete Comments
104104
const batchSize = 50
105-
for start := 0; ; start += batchSize {
105+
for {
106106
comments := make([]*issues_model.Comment, 0, batchSize)
107-
if err = e.Where("type=? AND poster_id=?", issues_model.CommentTypeComment, u.ID).Limit(batchSize, start).Find(&comments); err != nil {
107+
if err = e.Where("type=? AND poster_id=?", issues_model.CommentTypeComment, u.ID).Limit(batchSize, 0).Find(&comments); err != nil {
108108
return err
109109
}
110110
if len(comments) == 0 {
@@ -202,7 +202,7 @@ func DeleteUser(ctx context.Context, u *user_model.User, purge bool) (err error)
202202
// ***** END: ExternalLoginUser *****
203203

204204
if _, err = e.ID(u.ID).Delete(new(user_model.User)); err != nil {
205-
return fmt.Errorf("Delete: %v", err)
205+
return fmt.Errorf("delete: %v", err)
206206
}
207207

208208
return nil

options/locale/locale_pt-PT.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,8 @@ settings.event_delete=Eliminar
19561956
settings.event_delete_desc=Ramo ou etiqueta eliminados.
19571957
settings.event_fork=Derivar
19581958
settings.event_fork_desc=Feita a derivação do repositório.
1959+
settings.event_wiki=Wiki
1960+
settings.event_wiki_desc=Página do wiki criada, renomeada, editada ou eliminada.
19591961
settings.event_release=Lançamento
19601962
settings.event_release_desc=Lançamento publicado, modificado ou eliminado num repositório.
19611963
settings.event_push=Enviar

templates/repo/home.tmpl

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,32 +73,33 @@
7373
</a>
7474
{{end}}
7575
<a href="{{.Repository.Link}}/find/{{.BranchNameSubURL}}" class="ui compact basic button tooltip" data-content="{{.locale.Tr "repo.find_file.go_to_file"}}">{{svg "octicon-file-moved" 15}}</a>
76-
{{if or .CanAddFile .CanUploadFile}}
77-
<button class="ui basic small compact dropdown jump icon button mr-2">
78-
<span class="text">{{.locale.Tr "repo.editor.add_file"}}</span>
79-
<div class="menu">
80-
{{if .Repository.CanEnableEditor}}
81-
{{if .CanAddFile}}
82-
<a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
83-
{{.locale.Tr "repo.editor.new_file"}}
84-
</a>
85-
{{end}}
86-
{{if .CanUploadFile}}
87-
<a class="item" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
88-
{{.locale.Tr "repo.editor.upload_file"}}
89-
</a>
90-
{{end}}
91-
{{if .CanAddFile}}
92-
<a class="item" href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
93-
{{.locale.Tr "repo.editor.patch"}}
94-
</a>
95-
{{end}}
76+
{{end}}
77+
{{if or .CanAddFile .CanUploadFile}}
78+
<button class="ui basic small compact dropdown jump icon button mr-2">
79+
<span class="text">{{.locale.Tr "repo.editor.add_file"}}</span>
80+
<div class="menu">
81+
{{if .Repository.CanEnableEditor}}
82+
{{if .CanAddFile}}
83+
<a class="item" href="{{.RepoLink}}/_new/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
84+
{{.locale.Tr "repo.editor.new_file"}}
85+
</a>
9686
{{end}}
97-
</div>
98-
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
99-
</button>
100-
{{end}}
101-
{{else}}
87+
{{if .CanUploadFile}}
88+
<a class="item" href="{{.RepoLink}}/_upload/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
89+
{{.locale.Tr "repo.editor.upload_file"}}
90+
</a>
91+
{{end}}
92+
{{if .CanAddFile}}
93+
<a class="item" href="{{.RepoLink}}/_diffpatch/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
94+
{{.locale.Tr "repo.editor.patch"}}
95+
</a>
96+
{{end}}
97+
{{end}}
98+
</div>
99+
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
100+
</button>
101+
{{end}}
102+
{{if ne $n 0}}
102103
<span class="ui breadcrumb repo-path"><a class="section" href="{{.RepoLink}}/src/{{.BranchNameSubURL}}" title="{{.Repository.Name}}">{{EllipsisString .Repository.Name 30}}</a>{{range $i, $v := .TreeNames}}<span class="divider">/</span>{{if eq $i $l}}<span class="active section" title="{{$v}}">{{EllipsisString $v 30}}</span>{{else}}{{$p := index $.Paths $i}}<span class="section"><a href="{{$.BranchLink}}/{{PathEscapeSegments $p}}" title="{{$v}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span>
103104
{{end}}
104105
</div>

0 commit comments

Comments
 (0)