Skip to content

Commit 454e475

Browse files
committed
Merge main, rename to gitea-auto
* origin/main: When comparing with an non-exist repository, return 404 but 500 (go-gitea#27437) Fix pr template (go-gitea#27436) Use minimal required version on CI and remove unnecessary services (go-gitea#27429) Fix missing `ctx` in new_form.tmpl (go-gitea#27434) Use flex-container for repo and org settings (go-gitea#27418) Fix yet another `ctx` template bug (go-gitea#27417) Add Index to `action.user_id` (go-gitea#27403) [skip ci] Updated translations via Crowdin
2 parents f4a07f3 + fe68bbe commit 454e475

File tree

15 files changed

+42
-31
lines changed

15 files changed

+42
-31
lines changed

.github/workflows/pull-db-tests.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
runs-on: ubuntu-latest
1818
services:
1919
pgsql:
20-
image: postgres:16
20+
image: postgres:12
2121
env:
2222
POSTGRES_DB: test
2323
POSTGRES_PASSWORD: postgres
@@ -85,13 +85,6 @@ jobs:
8585
needs: files-changed
8686
runs-on: ubuntu-latest
8787
services:
88-
mysql:
89-
image: mysql:8.1
90-
env:
91-
MYSQL_ALLOW_EMPTY_PASSWORD: true
92-
MYSQL_DATABASE: test
93-
ports:
94-
- "3306:3306"
9588
elasticsearch:
9689
image: elasticsearch:7.5.0
9790
env:
@@ -104,13 +97,6 @@ jobs:
10497
MEILI_ENV: development # disable auth
10598
ports:
10699
- "7700:7700"
107-
smtpimap:
108-
image: tabascoterrier/docker-imap-devel:latest
109-
ports:
110-
- "25:25"
111-
- "143:143"
112-
- "587:587"
113-
- "993:993"
114100
redis:
115101
image: redis
116102
options: >- # wait until redis has started
@@ -158,7 +144,7 @@ jobs:
158144
runs-on: ubuntu-latest
159145
services:
160146
mysql:
161-
image: mysql:8.1
147+
image: mysql:8.0
162148
env:
163149
MYSQL_ALLOW_EMPTY_PASSWORD: true
164150
MYSQL_DATABASE: testgitea
@@ -203,7 +189,7 @@ jobs:
203189
runs-on: ubuntu-latest
204190
services:
205191
mssql:
206-
image: mcr.microsoft.com/mssql/server:2022-latest
192+
image: mcr.microsoft.com/mssql/server:2017-latest
207193
env:
208194
ACCEPT_EULA: Y
209195
MSSQL_PID: Standard

models/activities/action.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (at ActionType) InActions(actions ...string) bool {
140140
// used in template render.
141141
type Action struct {
142142
ID int64 `xorm:"pk autoincr"`
143-
UserID int64 // Receiver user id.
143+
UserID int64 `xorm:"INDEX"` // Receiver user id.
144144
OpType ActionType
145145
ActUserID int64 // Action user id.
146146
ActUser *user_model.User `xorm:"-"`

models/migrations/migrations.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,12 @@ var migrations = []Migration{
539539
NewMigration("Add Index to issue_user.issue_id", v1_21.AddIndexToIssueUserIssueID),
540540
// v278 -> v279
541541
NewMigration("Add Index to comment.dependent_issue_id", v1_21.AddIndexToCommentDependentIssueID),
542+
// v279 -> v280
543+
NewMigration("Add Index to action.user_id", v1_21.AddIndexToActionUserID),
542544

543-
// Gitea 1.21.0 ends at 279
545+
// Gitea 1.21.0 ends at 280
544546

545-
// v279 -> v280
547+
// v280 -> v281
546548
NewMigration("Rename user themes", v1_22.RenameUserThemes),
547549
}
548550

models/migrations/v1_21/v279.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2023 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
package v1_21 //nolint
5+
6+
import (
7+
"xorm.io/xorm"
8+
)
9+
10+
func AddIndexToActionUserID(x *xorm.Engine) error {
11+
type Action struct {
12+
UserID int64 `xorm:"INDEX"`
13+
}
14+
15+
return x.Sync(new(Action))
16+
}

models/migrations/v1_22/v279.go renamed to models/migrations/v1_22/v280.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ func RenameUserThemes(x *xorm.Engine) error {
2222
return err
2323
}
2424

25+
if _, err := sess.Exec("UPDATE `user` SET `theme` = 'gitea-auto' WHERE `theme` = 'auto'"); err != nil {
26+
return err
27+
}
28+
2529
return sess.Commit()
2630
}

options/locale/locale_el-GR.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ invalid_password_algorithm=Μη έγκυρος αλγόριθμος κωδικο
290290
password_algorithm_helper=Ορίστε τον αλγόριθμο κατακερματισμού για το κωδικό πρόσβασης. Οι αλγόριθμοι διαφέρουν σε απαιτήσεις και αντοχή. Ο αλγόριθμος argon2 είναι αρκετά ασφαλής, αλλά χρησιμοποιεί πολλή μνήμη και μπορεί να είναι ακατάλληλος για μικρά συστήματα.
291291
enable_update_checker=Ενεργοποίηση Ελεγκτή Ενημερώσεων
292292
enable_update_checker_helper=Ελέγχει περιοδικά για νέες εκδόσεις κάνοντας σύνδεση στο gitea.io.
293+
env_config_keys=Ρυθμίσεις Περιβάλλοντος
293294

294295
[home]
295296
uname_holder=Όνομα Χρήστη ή Διεύθυνση Email

routers/web/repo/compare.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
252252
isSameRepo = true
253253
ci.HeadUser = ctx.Repo.Owner
254254
ci.HeadBranch = headInfos[0]
255-
256255
} else if len(headInfos) == 2 {
257256
headInfosSplit := strings.Split(headInfos[0], "/")
258257
if len(headInfosSplit) == 1 {
@@ -407,6 +406,9 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
407406
return nil
408407
}
409408
defer ci.HeadGitRepo.Close()
409+
} else {
410+
ctx.NotFound("ParseCompareInfo", nil)
411+
return nil
410412
}
411413

412414
ctx.Data["HeadRepo"] = ci.HeadRepo

templates/org/settings/layout_head.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{{template "base/head" .ctxData}}
22
<div role="main" aria-label="{{.ctxData.Title}}" class="page-content {{.pageClass}}">
33
{{template "org/header" .ctxData}}
4-
<div class="ui container stackable grid">
4+
<div class="ui container flex-container">
55
{{template "org/settings/navbar" .ctxData}}
6-
<div class="twelve wide column">
6+
<div class="flex-container-main">
77
{{template "base/alert" .ctxData}}
88
{{/* block: org-setting-content */}}
99

templates/org/settings/navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="four wide column">
1+
<div class="flex-container-nav">
22
<div class="ui fluid vertical menu">
33
<div class="header item">{{ctx.Locale.Tr "org.settings"}}</div>
44
<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.OrgLink}}/settings">

templates/repo/issue/new_form.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
{{ctx.Locale.Tr "repo.issues.new.open_projects"}}
112112
</div>
113113
{{range .OpenProjects}}
114-
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
114+
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}">
115115
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
116116
</a>
117117
{{end}}
@@ -122,7 +122,7 @@
122122
{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
123123
</div>
124124
{{range .ClosedProjects}}
125-
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
125+
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}">
126126
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
127127
</a>
128128
{{end}}

templates/repo/issue/view_content/comments.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@
496496
{{end}}
497497
</div>
498498
</div>
499-
{{$diff := (CommentMustAsDiff (index $comms 0))}}
499+
{{$diff := (CommentMustAsDiff ctx (index $comms 0))}}
500500
{{if $diff}}
501501
{{$file := (index $diff.Files 0)}}
502502
<div id="code-preview-{{(index $comms 0).ID}}" class="ui table segment{{if $resolved}} gt-hidden{{end}}">

templates/repo/settings/layout_head.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{{template "base/head" .ctxData}}
22
<div role="main" aria-label="{{.ctxData.Title}}" class="page-content {{.pageClass}}">
33
{{template "repo/header" .ctxData}}
4-
<div class="ui container stackable grid">
4+
<div class="ui container flex-container">
55
{{template "repo/settings/navbar" .ctxData}}
6-
<div class="twelve wide column">
6+
<div class="flex-container-main">
77
{{template "base/alert" .ctxData}}
88
{{/* block: repo-setting-content */}}
99

templates/repo/settings/navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="four wide column">
1+
<div class="flex-container-nav">
22
<div class="ui fluid vertical menu">
33
<div class="header item">{{ctx.Locale.Tr "repo.settings"}}</div>
44
<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.RepoLink}}/settings">

templates/shared/user/profile_big_avatar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<li>
8484
<ul class="user-orgs">
8585
{{range .Orgs}}
86-
{{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
86+
{{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID ctx $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
8787
<li>
8888
<a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}">
8989
{{ctx.AvatarUtils.Avatar .}}

0 commit comments

Comments
 (0)