Skip to content

Commit ab23a80

Browse files
committed
Merge remote-tracking branch 'origin/main' into forgefriends-mr46
2 parents 6dbd08f + 15a4b1d commit ab23a80

File tree

8 files changed

+32
-19
lines changed

8 files changed

+32
-19
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ require (
8585
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
8686
github.com/msteinert/pam v0.0.0-20201130170657-e61372126161
8787
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
88-
github.com/niklasfasching/go-org v1.5.0
88+
github.com/niklasfasching/go-org v1.6.0
8989
github.com/olekukonko/tablewriter v0.0.5 // indirect
9090
github.com/oliamb/cutter v0.2.2
9191
github.com/olivere/elastic/v7 v7.0.25
@@ -123,9 +123,9 @@ require (
123123
go.uber.org/multierr v1.7.0 // indirect
124124
go.uber.org/zap v1.19.0 // indirect
125125
golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871
126-
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2
126+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
127127
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914
128-
golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1
128+
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
129129
golang.org/x/text v0.3.7
130130
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect
131131
golang.org/x/tools v0.1.0

go.sum

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
203203
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
204204
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
205205
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
206+
github.com/chaseadamsio/goorgeous v2.0.0+incompatible/go.mod h1:6QaC0vFoKWYDth94dHFNgRT2YkT5FHdQp/Yx15aAAi0=
206207
github.com/chi-middleware/proxy v1.1.1 h1:4HaXUp8o2+bhHr1OhVy+VjN0+L7/07JDcn6v7YrTjrQ=
207208
github.com/chi-middleware/proxy v1.1.1/go.mod h1:jQwMEJct2tz9VmtCELxvnXoMfa+SOdikvbVJVHv/M+0=
208209
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
@@ -915,8 +916,8 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS
915916
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
916917
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
917918
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
918-
github.com/niklasfasching/go-org v1.5.0 h1:V8IwoSPm/d61bceyWFxxnQLtlvNT+CjiYIhtZLdnMF0=
919-
github.com/niklasfasching/go-org v1.5.0/go.mod h1:sSb8ylwnAG+h8MGFDB3R1D5bxf8wA08REfhjShg3kjA=
919+
github.com/niklasfasching/go-org v1.6.0 h1:NCWpmDDNjHNsrei6VmnYXzOiyZUxV8LVU19REGQ8dKA=
920+
github.com/niklasfasching/go-org v1.6.0/go.mod h1:gSHyFcAbr2thIpfljLsP/BB8uwAMyooq6ydIrUDdOCs=
920921
github.com/nwaples/rardecode v1.1.0 h1:vSxaY8vQhOcVr4mm5e8XllHWTiM4JF507A0Katqw7MQ=
921922
github.com/nwaples/rardecode v1.1.0/go.mod h1:5DzqNKiOdpKKBH87u8VlvAnPZMXcGRhxWkRpHbbfGS0=
922923
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
@@ -1035,8 +1036,9 @@ github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4=
10351036
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
10361037
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
10371038
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
1038-
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
10391039
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
1040+
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
1041+
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
10401042
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
10411043
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
10421044
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@@ -1358,8 +1360,9 @@ golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5o
13581360
golang.org/x/net v0.0.0-20210331060903-cb1fcc7394e5/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
13591361
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
13601362
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
1361-
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE=
13621363
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
1364+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=
1365+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
13631366
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
13641367
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
13651368
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -1465,11 +1468,13 @@ golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBc
14651468
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
14661469
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
14671470
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1468-
golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1 h1:kwrAHlwJ0DUBZwQ238v+Uod/3eZ8B2K5rYsUHBQvzmI=
14691471
golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1472+
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
1473+
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
14701474
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
1471-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
14721475
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
1476+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
1477+
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
14731478
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
14741479
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
14751480
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

models/issues/content_history.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ func QueryIssueContentHistoryEditedCountMap(dbCtx context.Context, issueID int64
137137
type IssueContentListItem struct {
138138
UserID int64
139139
UserName string
140+
UserFullName string
140141
UserAvatarLink string
141142

142143
HistoryID int64
@@ -148,7 +149,7 @@ type IssueContentListItem struct {
148149
// FetchIssueContentHistoryList fetch list
149150
func FetchIssueContentHistoryList(dbCtx context.Context, issueID, commentID int64) ([]*IssueContentListItem, error) {
150151
res := make([]*IssueContentListItem, 0)
151-
err := db.GetEngine(dbCtx).Select("u.id as user_id, u.name as user_name,"+
152+
err := db.GetEngine(dbCtx).Select("u.id as user_id, u.name as user_name, u.full_name as user_full_name,"+
152153
"h.id as history_id, h.edited_unix, h.is_first_created, h.is_deleted").
153154
Table([]string{"issue_content_history", "h"}).
154155
Join("LEFT", []string{"user", "u"}, "h.poster_id = u.id").

models/issues/content_history_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ func TestContentHistory(t *testing.T) {
4343
when the refactor of models are done, this test will be possible to be run then with a real `User` model.
4444
*/
4545
type User struct {
46-
ID int64
47-
Name string
46+
ID int64
47+
Name string
48+
FullName string
4849
}
4950
_ = dbEngine.Sync2(&User{})
5051

options/locale/locale_ru-RU.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ template_helper=Сделать репозиторий шаблоном
781781
template_description=Шаблонные репозитории дают возможность пользователям создавать новые репозитории с той же структурой каталогов, файлами и дополнительными настройками.
782782
visibility=Видимость
783783
visibility_description=Только владелец или члены организации, при наличии прав, смогут увидеть это.
784-
visibility_helper=Сделать репозиторий приватным
784+
visibility_helper=Сделать репозиторий частным
785785
visibility_helper_forced=Администратор сайта настроил параметр видимости новых репозиториев. Репозиторий приватный по умолчанию.
786786
visibility_fork_helper=(Изменение этого повлияет на все форки.)
787787
clone_helper=Нужна помощь в клонировании? Посетите страницу <a target="_blank" rel="noopener noreferrer" href="%s">помощи</a>.
@@ -930,9 +930,7 @@ migrate.codebase.description=Перенос данных с codebasehq.com.
930930
migrate.gitbucket.description=Перенести данные из экземпляров GitBucket.
931931
migrate.migrating_git=Перенос Git данных
932932
migrate.migrating_topics=Миграция тем
933-
migrate.migrating_milestones=Миграция этапов
934933
migrate.migrating_labels=Миграция меток
935-
migrate.migrating_releases=Миграция релизов
936934
migrate.migrating_issues=Миграция задач
937935
migrate.migrating_pulls=Миграция запросов на слияние
938936

routers/web/repo/issue_content_history.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ import (
99
"fmt"
1010
"html"
1111
"net/http"
12+
"strings"
1213

1314
"code.gitea.io/gitea/models"
1415
"code.gitea.io/gitea/models/db"
1516
issuesModel "code.gitea.io/gitea/models/issues"
1617
"code.gitea.io/gitea/models/unit"
1718
"code.gitea.io/gitea/modules/context"
1819
"code.gitea.io/gitea/modules/log"
20+
"code.gitea.io/gitea/modules/setting"
1921
"code.gitea.io/gitea/modules/timeutil"
2022

2123
"github.com/sergi/go-diff/diffmatchpatch"
@@ -68,9 +70,15 @@ func GetContentHistoryList(ctx *context.Context) {
6870
actionText = ctx.Locale.Tr("repo.issues.content_history.edited")
6971
}
7072
timeSinceText := timeutil.TimeSinceUnix(item.EditedUnix, lang)
73+
74+
username := item.UserName
75+
if setting.UI.DefaultShowFullName && strings.TrimSpace(item.UserFullName) != "" {
76+
username = strings.TrimSpace(item.UserFullName)
77+
}
78+
7179
results = append(results, map[string]interface{}{
7280
"name": fmt.Sprintf("<img class='ui avatar image' src='%s'><strong>%s</strong> %s %s",
73-
html.EscapeString(item.UserAvatarLink), html.EscapeString(item.UserName), actionText, timeSinceText),
81+
html.EscapeString(item.UserAvatarLink), html.EscapeString(username), actionText, timeSinceText),
7482
"value": item.HistoryID,
7583
})
7684
}

services/auth/signin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func UserSignIn(username, password string) (*user_model.User, *auth.Source, erro
6565
return nil, nil, smtp.ErrUnsupportedLoginType
6666
}
6767

68-
user, err := authenticator.Authenticate(user, username, password)
68+
user, err := authenticator.Authenticate(user, user.LoginName, password)
6969
if err != nil {
7070
return nil, nil, err
7171
}

templates/repo/commit_page.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@
202202
<span class="ui text mr-3">{{.i18n.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}:</span>
203203
{{end}}
204204
{{avatar .Verification.SigningUser 28}}
205-
<a href="{{.Verification.SigningUser.HomeLink}}"><strong>{{.Verification.SigningUser.Name}}</strong></a>
205+
<a href="{{.Verification.SigningUser.HomeLink}}"><strong>{{.Verification.SigningUser.GetDisplayName}}</strong></a>
206206
{{else}}
207207
<span title="{{.i18n.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog"}}</span>
208208
<span class="ui text">{{.i18n.Tr "repo.commits.signed_by"}}:</span>
209209
{{avatarByEmail .Verification.SigningEmail "" 28}}
210-
<strong>{{.Verification.SigningUser.Name}}</strong>
210+
<strong>{{.Verification.SigningUser.GetDisplayName}}</strong>
211211
{{end}}
212212
{{else}}
213213
{{svg "gitea-unlock" 16 "mr-3"}}

0 commit comments

Comments
 (0)