Skip to content

Commit 59edd92

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Simplify the code to get issue count (go-gitea#19380) use IsLoopback (go-gitea#19477) [skip ci] Updated translations via Crowdin Add RSS Feed buttons to Repo, User and Org pages (go-gitea#19370) [doctor] authorized-keys: fix displayed check name (go-gitea#19464) [skip ci] Updated translations via Crowdin Use horizontal tabs for repo header on mobile (go-gitea#19468)
2 parents 4c3d09a + fc00286 commit 59edd92

File tree

12 files changed

+49
-42
lines changed

12 files changed

+49
-42
lines changed

models/issue.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,20 +1510,10 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
15101510
func CountIssues(opts *IssuesOptions) (int64, error) {
15111511
e := db.GetEngine(db.DefaultContext)
15121512

1513-
countsSlice := make([]*struct {
1514-
Count int64
1515-
}, 0, 1)
1516-
15171513
sess := e.Select("COUNT(issue.id) AS count").Table("issue")
15181514
sess.Join("INNER", "repository", "`issue`.repo_id = `repository`.id")
15191515
opts.setupSessionNoLimit(sess)
1520-
if err := sess.Find(&countsSlice); err != nil {
1521-
return 0, fmt.Errorf("unable to CountIssues: %w", err)
1522-
}
1523-
if len(countsSlice) != 1 {
1524-
return 0, fmt.Errorf("unable to get one row result when CountIssues, row count=%d", len(countsSlice))
1525-
}
1526-
return countsSlice[0].Count, nil
1516+
return sess.Count()
15271517
}
15281518

15291519
// GetParticipantsIDsByIssueID returns the IDs of all users who participated in comments of an issue,

modules/doctor/authorizedkeys.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ func checkAuthorizedKeys(ctx context.Context, logger log.Logger, autofix bool) e
7272
"authorized_keys file %q is out of date.\nRegenerate it with:\n\t\"%s\"\nor\n\t\"%s\"",
7373
fPath,
7474
"gitea admin regenerate keys",
75-
"gitea doctor --run authorized_keys --fix")
76-
return fmt.Errorf(`authorized_keys is out of date and should be regenerated with "gitea admin regenerate keys" or "gitea doctor --run authorized_keys --fix"`)
75+
"gitea doctor --run authorized-keys --fix")
76+
return fmt.Errorf(`authorized_keys is out of date and should be regenerated with "gitea admin regenerate keys" or "gitea doctor --run authorized-keys --fix"`)
7777
}
7878
logger.Warn("authorized_keys is out of date. Attempting rewrite...")
7979
err = asymkey_model.RewriteAllPublicKeys()

modules/validation/helpers.go

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,10 @@ import (
1313
"code.gitea.io/gitea/modules/setting"
1414
)
1515

16-
var loopbackIPBlocks []*net.IPNet
17-
1816
var externalTrackerRegex = regexp.MustCompile(`({?)(?:user|repo|index)+?(}?)`)
1917

20-
func init() {
21-
for _, cidr := range []string{
22-
"127.0.0.0/8", // IPv4 loopback
23-
"::1/128", // IPv6 loopback
24-
} {
25-
if _, block, err := net.ParseCIDR(cidr); err == nil {
26-
loopbackIPBlocks = append(loopbackIPBlocks, block)
27-
}
28-
}
29-
}
30-
3118
func isLoopbackIP(ip string) bool {
32-
pip := net.ParseIP(ip)
33-
if pip == nil {
34-
return false
35-
}
36-
for _, block := range loopbackIPBlocks {
37-
if block.Contains(pip) {
38-
return true
39-
}
40-
}
41-
return false
19+
return net.ParseIP(ip).IsLoopback()
4220
}
4321

4422
// IsValidURL checks if URL is valid

options/locale/locale_en-US.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ error404 = The page you are trying to reach either <strong>does not exist</stron
105105

106106
never = Never
107107

108+
rss_feed = RSS Feed
109+
108110
[error]
109111
occurred = An error occurred
110112
report_message = If you are sure this is a Gitea bug, please search for issues on <a href="https://github.com/go-gitea/gitea/issues" target="_blank">GitHub</a> or open a new issue if necessary.

options/locale/locale_ja-JP.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3051,6 +3051,9 @@ container.labels.key=キー
30513051
container.labels.value=値
30523052
generic.download=コマンドラインでパッケージをダウンロードします:
30533053
generic.documentation=汎用 レジストリの詳細については、<a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/generic">ドキュメント</a> を参照してください。
3054+
helm.registry=このレジストリをコマンドラインからセットアップします:
3055+
helm.install=パッケージをインストールするには、次のコマンドを実行します:
3056+
helm.documentation=Helm レジストリの詳細については、 <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/helm/">ドキュメント</a> を参照してください。
30543057
maven.registry=あなたのプロジェクトの <code>pom.xml</code> ファイルに、このレジストリをセットアップします:
30553058
maven.install=パッケージを使用するため <code>pom.xml</code> ファイル内の <code>dependencies</code> ブロックに以下を含めます:
30563059
maven.install2=コマンドラインで実行します:

options/locale/locale_pt-BR.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ organizations=Organizações
267267
search=Pesquisar
268268
code=Código
269269
search.fuzzy=Similar
270+
search.match=Correspondência
270271
code_search_unavailable=A pesquisa por código não está disponível no momento. Entre em contato com o administrador do site.
271272
repo_no_results=Nenhum repositório correspondente foi encontrado.
272273
user_no_results=Nenhum usuário correspondente foi encontrado.
@@ -566,6 +567,7 @@ comment_type_group_lock=Status de Bloqueio
566567
comment_type_group_review_request=Revisar solicitação
567568
comment_type_group_pull_request_push=Commits adicionados
568569
comment_type_group_project=Projeto
570+
comment_type_group_issue_ref=Referência do issue
569571
saved_successfully=Suas configurações foram salvas com sucesso.
570572
privacy=Privacidade
571573
keep_activity_private=Ocultar a atividade da página de perfil
@@ -2987,6 +2989,8 @@ empty.documentation=Para obter mais informações sobre o registro de pacote, co
29872989
filter.type=Tipo
29882990
filter.type.all=Todos
29892991
filter.no_result=Seu filtro não produziu resultados.
2992+
filter.container.tagged=Marcado
2993+
filter.container.untagged=Desmarcado
29902994
published_by=Publicado %[1]s por <a href="%[2]s">%[3]s</a>
29912995
published_by_in=Publicado %[1]s por <a href="%[2]s">%[3]s</a> em <a href="%[4]s"><strong>%[5]s</strong></a>
29922996
installation=Instalação
@@ -2998,6 +3002,7 @@ details=Detalhes
29983002
details.author=Autor
29993003
details.project_site=Site do Projeto
30003004
details.license=Licença
3005+
assets=Recursos
30013006
versions=Versões
30023007
versions.on=em
30033008
versions.view_all=Ver todas
@@ -3019,6 +3024,7 @@ container.details.documentation_site=Site da Documentação
30193024
container.pull=Puxe a imagem pela linha de comando:
30203025
container.documentation=Para obter mais informações sobre o registro de Container, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/container/">a documentação</a>.
30213026
container.multi_arch=S.O. / Arquitetura
3027+
container.layers=Camadas da Imagem
30223028
container.labels=Rótulos
30233029
container.labels.key=Chave
30243030
container.labels.value=Valor
@@ -3041,6 +3047,7 @@ npm.install2=ou adicione-o ao arquivo package.json:
30413047
npm.documentation=Para obter mais informações sobre o registro npm, consulte <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/npm/">a documentação</a>.
30423048
npm.dependencies=Dependências
30433049
npm.dependencies.development=Dependências de Desenvolvimento
3050+
npm.dependencies.peer=Dependências Peer
30443051
npm.dependencies.optional=Dependências Opcionais
30453052
npm.details.tag=Tag
30463053
pypi.requires=Requer Python

templates/org/home.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<div id="org-info">
66
<div class="ui header">
77
{{.Org.DisplayName}}
8+
<a href="{{.Org.HomeLink}}.rss"><i class="ui grey icon tooltip ml-3" data-content="{{.i18n.Tr "rss_feed"}}" data-position="top center">{{svg "octicon-rss" 36}}</i></a>
89
<span class="org-visibility">
910
{{if .Org.Visibility.IsLimited}}<div class="ui large basic horizontal label">{{.i18n.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
1011
{{if .Org.Visibility.IsPrivate}}<div class="ui large basic horizontal label">{{.i18n.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}

templates/repo/header.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>
1414
<div class="mx-2">/</div>
1515
<a href="{{$.RepoLink}}">{{.Name}}</a>
16+
<a href="{{$.RepoLink}}.rss"><i class="ui grey icon tooltip ml-3" data-content="{{$.i18n.Tr "rss_feed"}}" data-position="top center">{{svg "octicon-rss" 18}}</i></a>
1617
<div class="labels df ac fw">
1718
{{if .IsTemplate}}
1819
{{if .IsPrivate}}
@@ -144,7 +145,7 @@
144145
</div><!-- end grid -->
145146
</div><!-- end container -->
146147
{{end}}
147-
<div class="ui tabs container">
148+
<div class="ui tabs container repo-header-container">
148149
{{if not (or .Repository.IsBeingCreated .Repository.IsBroken)}}
149150
<div class="ui tabular stackable menu navbar">
150151
{{if .Permission.CanRead $.UnitTypeCode}}

templates/user/profile.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<div class="content word-break profile-avatar-name">
1717
{{if .Owner.FullName}}<span class="header text center">{{.Owner.FullName}}</span>{{end}}
1818
<span class="username text center">{{.Owner.Name}}</span>
19+
<a href="{{.Owner.HomeLink}}.rss"><i class="ui grey icon tooltip ml-3" data-content="{{.i18n.Tr "rss_feed"}}" data-position="bottom center">{{svg "octicon-rss" 18}}</i></a>
1920
</div>
2021
<div class="extra content word-break">
2122
<ul>

web_src/less/_organization.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
overflow-wrap: anywhere;
5151

5252
.ui.header {
53+
display: flex;
54+
align-items: center;
5355
font-size: 36px;
5456
margin-bottom: 0;
5557
.org-visibility .label {

0 commit comments

Comments
 (0)