Skip to content

Commit 514311a

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Make issue meta dropdown support Enter, confirm before reloading (go-gitea#23014) Fix SyncOnCommit always return false in API of push_mirrors (go-gitea#23088) Fix commit name in Apply Patch page (go-gitea#23086) Add wrapper to author to avoid long name ui problem (go-gitea#23030) Avoid Hugo from adding quote to actions url (go-gitea#23097) Remove all package data after tests (go-gitea#22984) Change style to improve whitespaces trimming inside inline markdown code (go-gitea#23093) Nest metadata in refactoring docs (go-gitea#23087) # Conflicts: # templates/repo/issue/view_content/context_menu.tmpl
2 parents 57153f6 + 0bc8bb3 commit 514311a

29 files changed

+139
-44
lines changed

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ PROXY_HOSTS = *.github.com
13361336
## Actions (`actions`)
13371337

13381338
- `ENABLED`: **false**: Enable/Disable actions capabilities
1339-
- `DEFAULT_ACTIONS_URL`: **https://gitea.com**: Default address to get action plugins, e.g. the default value means downloading from "https://gitea.com/actions/checkout" for "uses: actions/checkout@v3"
1339+
- `DEFAULT_ACTIONS_URL`: **https://gitea.com**: Default address to get action plugins, e.g. the default value means downloading from "<https://gitea.com/actions/checkout>" for "uses: actions/checkout@v3"
13401340

13411341
`DEFAULT_ACTIONS_URL` indicates where should we find the relative path action plugin. i.e. when use an action in a workflow file like
13421342

docs/content/doc/developers/guidelines-refactoring.en-us.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ weight: 20
66
toc: false
77
draft: false
88
menu:
9-
sidebar:
10-
parent: "developers"
11-
name: "Guidelines for Refactoring"
12-
weight: 20
13-
identifier: "guidelines-refactoring"
9+
sidebar:
10+
parent: "developers"
11+
name: "Guidelines for Refactoring"
12+
weight: 20
13+
identifier: "guidelines-refactoring"
1414
---
1515

1616
# Guidelines for Refactoring

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ require (
117117
mvdan.cc/xurls/v2 v2.4.0
118118
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
119119
xorm.io/builder v0.3.12
120-
xorm.io/xorm v1.3.3-0.20221209153726-f1bfc5ce9830
120+
xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e
121121
)
122122

123123
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,5 +2075,5 @@ strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:
20752075
xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
20762076
xorm.io/builder v0.3.12 h1:ASZYX7fQmy+o8UJdhlLHSW57JDOkM8DNhcAF5d0LiJM=
20772077
xorm.io/builder v0.3.12/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
2078-
xorm.io/xorm v1.3.3-0.20221209153726-f1bfc5ce9830 h1:ohaHCvT7ocSDkTEa2/2z0BXfINYlHm/Z7IzN7MeXQlM=
2079-
xorm.io/xorm v1.3.3-0.20221209153726-f1bfc5ce9830/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw=
2078+
xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e h1:d5PY6mwuQK5/7T6VKfFswaKMzLmGTHkJ/ZS7+cUIAjk=
2079+
xorm.io/xorm v1.3.3-0.20230219231735-056cecc97e9e/go.mod h1:9NbjqdnjX6eyjRRhh01GHm64r6N9shTb/8Ak3YRt8Nw=

models/db/context.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func DecrByIDs(ctx context.Context, ids []int64, decrCol string, bean interface{
209209
return err
210210
}
211211

212-
// DeleteBeans deletes all given beans, beans should contain delete conditions.
212+
// DeleteBeans deletes all given beans, beans must contain delete conditions.
213213
func DeleteBeans(ctx context.Context, beans ...interface{}) (err error) {
214214
e := GetEngine(ctx)
215215
for i := range beans {
@@ -220,6 +220,17 @@ func DeleteBeans(ctx context.Context, beans ...interface{}) (err error) {
220220
return nil
221221
}
222222

223+
// TruncateBeans deletes all given beans, beans may contain delete conditions.
224+
func TruncateBeans(ctx context.Context, beans ...interface{}) (err error) {
225+
e := GetEngine(ctx)
226+
for i := range beans {
227+
if _, err = e.Truncate(beans[i]); err != nil {
228+
return err
229+
}
230+
}
231+
return nil
232+
}
233+
223234
// CountByBean counts the number of database records according non-empty fields of the bean as conditions.
224235
func CountByBean(ctx context.Context, bean interface{}) (int64, error) {
225236
return GetEngine(ctx).Count(bean)

models/db/engine.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type Engine interface {
3838
Count(...interface{}) (int64, error)
3939
Decr(column string, arg ...interface{}) *xorm.Session
4040
Delete(...interface{}) (int64, error)
41+
Truncate(...interface{}) (int64, error)
4142
Exec(...interface{}) (sql.Result, error)
4243
Find(interface{}, ...interface{}) error
4344
Get(beans ...interface{}) (bool, error)

routers/web/repo/patch.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const (
2525
func NewDiffPatch(ctx *context.Context) {
2626
canCommit := renderCommitRights(ctx)
2727

28+
ctx.Data["PageIsPatch"] = true
29+
2830
ctx.Data["TreePath"] = ""
2931

3032
ctx.Data["commit_summary"] = ""
@@ -51,6 +53,7 @@ func NewDiffPatchPost(ctx *context.Context) {
5153
if form.CommitChoice == frmCommitChoiceNewBranch {
5254
branchName = form.NewBranchName
5355
}
56+
ctx.Data["PageIsPatch"] = true
5457
ctx.Data["TreePath"] = ""
5558
ctx.Data["BranchLink"] = ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL()
5659
ctx.Data["FileContent"] = form.Content

services/convert/mirror.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func ToPushMirror(pm *repo_model.PushMirror) (*api.PushMirror, error) {
2424
LastUpdateUnix: pm.LastUpdateUnix.FormatLong(),
2525
LastError: pm.LastError,
2626
Interval: pm.Interval.String(),
27+
SyncOnCommit: pm.SyncOnCommit,
2728
}, nil
2829
}
2930

templates/repo/editor/commit_form.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{.locale.Tr "repo.editor.commit_changes"}}
1010
{{- end}}</h3>
1111
<div class="field">
12-
<input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
12+
<input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{.locale.Tr "repo.editor.patch"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
1313
</div>
1414
<div class="field">
1515
<textarea name="commit_message" placeholder="{{.locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>

templates/repo/issue/view_content/add_reaction.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="header">{{.ctx.locale.Tr "repo.pick_reaction"}}</div>
88
<div class="divider"></div>
99
{{range $value := AllowedReactions}}
10-
<div class="item reaction tooltip" data-content="{{$value}}">{{ReactionToEmoji $value}}</div>
10+
<a class="item reaction tooltip" data-content="{{$value}}">{{ReactionToEmoji $value}}</a>
1111
{{end}}
1212
</div>
1313
</div>

0 commit comments

Comments
 (0)