Skip to content

Commit

Permalink
Merge main, rename to gitea-auto
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
silverwind committed Oct 4, 2023
2 parents f4a07f3 + fe68bbe commit 454e475
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 31 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/pull-db-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
services:
pgsql:
image: postgres:16
image: postgres:12
env:
POSTGRES_DB: test
POSTGRES_PASSWORD: postgres
Expand Down Expand Up @@ -85,13 +85,6 @@ jobs:
needs: files-changed
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.1
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: test
ports:
- "3306:3306"
elasticsearch:
image: elasticsearch:7.5.0
env:
Expand All @@ -104,13 +97,6 @@ jobs:
MEILI_ENV: development # disable auth
ports:
- "7700:7700"
smtpimap:
image: tabascoterrier/docker-imap-devel:latest
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
redis:
image: redis
options: >- # wait until redis has started
Expand Down Expand Up @@ -158,7 +144,7 @@ jobs:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.1
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: testgitea
Expand Down Expand Up @@ -203,7 +189,7 @@ jobs:
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/mssql/server:2022-latest
image: mcr.microsoft.com/mssql/server:2017-latest
env:
ACCEPT_EULA: Y
MSSQL_PID: Standard
Expand Down
2 changes: 1 addition & 1 deletion models/activities/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (at ActionType) InActions(actions ...string) bool {
// used in template render.
type Action struct {
ID int64 `xorm:"pk autoincr"`
UserID int64 // Receiver user id.
UserID int64 `xorm:"INDEX"` // Receiver user id.
OpType ActionType
ActUserID int64 // Action user id.
ActUser *user_model.User `xorm:"-"`
Expand Down
6 changes: 4 additions & 2 deletions models/migrations/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,12 @@ var migrations = []Migration{
NewMigration("Add Index to issue_user.issue_id", v1_21.AddIndexToIssueUserIssueID),
// v278 -> v279
NewMigration("Add Index to comment.dependent_issue_id", v1_21.AddIndexToCommentDependentIssueID),
// v279 -> v280
NewMigration("Add Index to action.user_id", v1_21.AddIndexToActionUserID),

// Gitea 1.21.0 ends at 279
// Gitea 1.21.0 ends at 280

// v279 -> v280
// v280 -> v281
NewMigration("Rename user themes", v1_22.RenameUserThemes),
}

Expand Down
16 changes: 16 additions & 0 deletions models/migrations/v1_21/v279.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2023 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package v1_21 //nolint

import (
"xorm.io/xorm"
)

func AddIndexToActionUserID(x *xorm.Engine) error {
type Action struct {
UserID int64 `xorm:"INDEX"`
}

return x.Sync(new(Action))
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ func RenameUserThemes(x *xorm.Engine) error {
return err
}

if _, err := sess.Exec("UPDATE `user` SET `theme` = 'gitea-auto' WHERE `theme` = 'auto'"); err != nil {
return err
}

return sess.Commit()
}
1 change: 1 addition & 0 deletions options/locale/locale_el-GR.ini
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ invalid_password_algorithm=Μη έγκυρος αλγόριθμος κωδικο
password_algorithm_helper=Ορίστε τον αλγόριθμο κατακερματισμού για το κωδικό πρόσβασης. Οι αλγόριθμοι διαφέρουν σε απαιτήσεις και αντοχή. Ο αλγόριθμος argon2 είναι αρκετά ασφαλής, αλλά χρησιμοποιεί πολλή μνήμη και μπορεί να είναι ακατάλληλος για μικρά συστήματα.
enable_update_checker=Ενεργοποίηση Ελεγκτή Ενημερώσεων
enable_update_checker_helper=Ελέγχει περιοδικά για νέες εκδόσεις κάνοντας σύνδεση στο gitea.io.
env_config_keys=Ρυθμίσεις Περιβάλλοντος

[home]
uname_holder=Όνομα Χρήστη ή Διεύθυνση Email
Expand Down
4 changes: 3 additions & 1 deletion routers/web/repo/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
isSameRepo = true
ci.HeadUser = ctx.Repo.Owner
ci.HeadBranch = headInfos[0]

} else if len(headInfos) == 2 {
headInfosSplit := strings.Split(headInfos[0], "/")
if len(headInfosSplit) == 1 {
Expand Down Expand Up @@ -407,6 +406,9 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
return nil
}
defer ci.HeadGitRepo.Close()
} else {
ctx.NotFound("ParseCompareInfo", nil)
return nil
}

ctx.Data["HeadRepo"] = ci.HeadRepo
Expand Down
4 changes: 2 additions & 2 deletions templates/org/settings/layout_head.tmpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{template "base/head" .ctxData}}
<div role="main" aria-label="{{.ctxData.Title}}" class="page-content {{.pageClass}}">
{{template "org/header" .ctxData}}
<div class="ui container stackable grid">
<div class="ui container flex-container">
{{template "org/settings/navbar" .ctxData}}
<div class="twelve wide column">
<div class="flex-container-main">
{{template "base/alert" .ctxData}}
{{/* block: org-setting-content */}}

Expand Down
2 changes: 1 addition & 1 deletion templates/org/settings/navbar.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="four wide column">
<div class="flex-container-nav">
<div class="ui fluid vertical menu">
<div class="header item">{{ctx.Locale.Tr "org.settings"}}</div>
<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.OrgLink}}/settings">
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/issue/new_form.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
{{ctx.Locale.Tr "repo.issues.new.open_projects"}}
</div>
{{range .OpenProjects}}
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}">
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
</a>
{{end}}
Expand All @@ -122,7 +122,7 @@
{{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
</div>
{{range .ClosedProjects}}
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link}}">
<a class="item muted sidebar-item-link" data-id="{{.ID}}" data-href="{{.Link ctx}}">
{{svg .IconName 18 "gt-mr-3"}}{{.Title}}
</a>
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/issue/view_content/comments.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@
{{end}}
</div>
</div>
{{$diff := (CommentMustAsDiff (index $comms 0))}}
{{$diff := (CommentMustAsDiff ctx (index $comms 0))}}
{{if $diff}}
{{$file := (index $diff.Files 0)}}
<div id="code-preview-{{(index $comms 0).ID}}" class="ui table segment{{if $resolved}} gt-hidden{{end}}">
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/settings/layout_head.tmpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{template "base/head" .ctxData}}
<div role="main" aria-label="{{.ctxData.Title}}" class="page-content {{.pageClass}}">
{{template "repo/header" .ctxData}}
<div class="ui container stackable grid">
<div class="ui container flex-container">
{{template "repo/settings/navbar" .ctxData}}
<div class="twelve wide column">
<div class="flex-container-main">
{{template "base/alert" .ctxData}}
{{/* block: repo-setting-content */}}

Expand Down
2 changes: 1 addition & 1 deletion templates/repo/settings/navbar.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="four wide column">
<div class="flex-container-nav">
<div class="ui fluid vertical menu">
<div class="header item">{{ctx.Locale.Tr "repo.settings"}}</div>
<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.RepoLink}}/settings">
Expand Down
2 changes: 1 addition & 1 deletion templates/shared/user/profile_big_avatar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<li>
<ul class="user-orgs">
{{range .Orgs}}
{{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
{{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.HasMemberWithUserID ctx $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
<li>
<a href="{{.HomeLink}}" data-tooltip-content="{{.Name}}">
{{ctx.AvatarUtils.Avatar .}}
Expand Down
File renamed without changes.

0 comments on commit 454e475

Please sign in to comment.