Skip to content

Commit 87b6f5a

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: [skip ci] Updated translations via Crowdin Improve html escape (go-gitea#34911) Adds tooltip on branch commit counts (go-gitea#34869) Fix PR toggle WIP (go-gitea#34920)
2 parents 0f8b7bb + dd1fd89 commit 87b6f5a

32 files changed

+134
-88
lines changed

.eslintrc.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ module.exports = {
9191
plugins: ['@vitest/eslint-plugin'],
9292
globals: vitestPlugin.environments.env.globals,
9393
rules: {
94+
'github/unescaped-html-literal': [0],
9495
'@vitest/consistent-test-filename': [0],
9596
'@vitest/consistent-test-it': [0],
9697
'@vitest/expect-expect': [0],
@@ -423,7 +424,7 @@ module.exports = {
423424
'github/no-useless-passive': [2],
424425
'github/prefer-observers': [2],
425426
'github/require-passive-events': [2],
426-
'github/unescaped-html-literal': [0],
427+
'github/unescaped-html-literal': [2],
427428
'grouped-accessor-pairs': [2],
428429
'guard-for-in': [0],
429430
'id-blacklist': [0],

options/locale/locale_en-US.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,6 +2769,8 @@ branch.new_branch_from = Create new branch from "%s"
27692769
branch.renamed = Branch %s was renamed to %s.
27702770
branch.rename_default_or_protected_branch_error = Only admins can rename default or protected branches.
27712771
branch.rename_protected_branch_failed = This branch is protected by glob-based protection rules.
2772+
branch.commits_divergence_from = Commits divergence: %[1]d behind and %[2]d ahead of %[3]s
2773+
branch.commits_no_divergence = The same as branch %[1]s
27722774
27732775
tag.create_tag = Create tag %s
27742776
tag.create_tag_operation = Create tag

options/locale/locale_ga-IE.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2782,6 +2782,7 @@ topic.done=Déanta
27822782
topic.count_prompt=Ní féidir leat níos mó ná 25 topaicí a roghnú
27832783
topic.format_prompt=Ní mór do thopaicí tosú le litir nó uimhir, is féidir daiseanna ('-') agus poncanna ('.') a áireamh, a bheith suas le 35 carachtar ar fad. Ní mór litreacha a bheith i litreacha beaga.
27842784
2785+
find_file.follow_symlink=Lean an nasc siombalach seo go dtí an áit a bhfuil sé ag pointeáil air
27852786
find_file.go_to_file=Téigh go dtí an comhad
27862787
find_file.no_matching=Níl aon chomhad meaitseála le fáil
27872788

options/locale/locale_pt-PT.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,8 +1562,8 @@ issues.filter_project=Planeamento
15621562
issues.filter_project_all=Todos os planeamentos
15631563
issues.filter_project_none=Nenhum planeamento
15641564
issues.filter_assignee=Encarregado
1565-
issues.filter_assignee_no_assignee=Não atribuído
1566-
issues.filter_assignee_any_assignee=Atribuído a qualquer pessoa
1565+
issues.filter_assignee_no_assignee=Não atribuída
1566+
issues.filter_assignee_any_assignee=Atribuída a alguém
15671567
issues.filter_poster=Autor(a)
15681568
issues.filter_user_placeholder=Procurar utilizadores
15691569
issues.filter_user_no_select=Todos os utilizadores
@@ -1969,6 +1969,7 @@ pulls.cmd_instruction_checkout_title=Checkout
19691969
pulls.cmd_instruction_checkout_desc=A partir do seu repositório, crie um novo ramo e teste nele as modificações.
19701970
pulls.cmd_instruction_merge_title=Integrar
19711971
pulls.cmd_instruction_merge_desc=Integrar as modificações e enviar para o Gitea.
1972+
pulls.cmd_instruction_merge_warning=Aviso: Esta operação não pode executar pedidos de integração porque a opção "auto-identificar integração manual" não está habilitada.
19721973
pulls.clear_merge_message=Apagar mensagem de integração
19731974
pulls.clear_merge_message_hint=Apagar a mensagem de integração apenas remove o conteúdo da mensagem de cometimento e mantém os rodapés do git, tais como "Co-Autorado-Por …".
19741975

@@ -2781,6 +2782,7 @@ topic.done=Concluído
27812782
topic.count_prompt=Não pode escolher mais do que 25 tópicos
27822783
topic.format_prompt=Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') ou pontos ('.') e podem ter até 35 caracteres. As letras têm que ser minúsculas.
27832784

2785+
find_file.follow_symlink=Seguir esta ligação simbólica para onde ela está apontando
27842786
find_file.go_to_file=Ir para o ficheiro
27852787
find_file.no_matching=Não foi encontrado qualquer ficheiro correspondente
27862788

package-lock.json

Lines changed: 0 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"dropzone": "6.0.0-beta.2",
2828
"easymde": "2.20.0",
2929
"esbuild-loader": "4.3.0",
30-
"escape-goat": "4.0.0",
3130
"fast-glob": "3.3.3",
3231
"htmx.org": "2.0.6",
3332
"idiomorph": "0.7.3",

routers/web/repo/issue_view.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,10 @@ func ViewPullMergeBox(ctx *context.Context) {
443443
preparePullViewPullInfo(ctx, issue)
444444
preparePullViewReviewAndMerge(ctx, issue)
445445
ctx.Data["PullMergeBoxReloading"] = issue.PullRequest.IsChecking()
446+
447+
// TODO: it should use a dedicated struct to render the pull merge box, to make sure all data is prepared correctly
448+
ctx.Data["IsIssuePoster"] = ctx.IsSigned && issue.IsPoster(ctx.Doer.ID)
449+
ctx.Data["HasIssuesOrPullsWritePermission"] = ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull)
446450
ctx.HTML(http.StatusOK, tplPullMergeBox)
447451
}
448452

templates/repo/branch/list.tmpl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,14 @@
107107
{{end}}
108108
</td>
109109
<td class="two wide ui">
110-
{{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
111-
<div class="commit-divergence">
110+
{{if and (not .DBBranch.IsDeleted) $.DefaultBranchBranch}}
111+
{{$tooltipDivergence := ""}}
112+
{{if or .CommitsBehind .CommitsAhead}}
113+
{{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_divergence_from" .CommitsBehind .CommitsAhead $.DefaultBranchBranch.DBBranch.Name}}
114+
{{else}}
115+
{{$tooltipDivergence = ctx.Locale.Tr "repo.branch.commits_no_divergence" $.DefaultBranchBranch.DBBranch.Name}}
116+
{{end}}
117+
<div class="commit-divergence" data-tooltip-content="{{$tooltipDivergence}}">
112118
<div class="bar-group">
113119
<div class="count count-behind">{{.CommitsBehind}}</div>
114120
{{/* old code bears 0/0.0 = NaN output, so it might output invalid "width: NaNpx", it just works and doesn't caues any problem. */}}
@@ -119,7 +125,7 @@
119125
<div class="bar bar-ahead" style="width: {{Eval 100 "*" .CommitsAhead "/" "(" .CommitsBehind "+" .CommitsAhead "+" 0.0 ")"}}%"></div>
120126
</div>
121127
</div>
122-
{{end}}
128+
{{end}}
123129
</td>
124130
<td class="two wide tw-text-right">
125131
{{if not .LatestPullRequest}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed) (not .IsPullWorkInProgress)}}
2-
<a class="toggle-wip tw-block tw-mt-2" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
2+
<a data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{index .PullRequestWorkInProgressPrefixes 0}}" data-update-url="{{.Issue.Link}}/title">
33
{{ctx.Locale.Tr "repo.pulls.still_in_progress"}} {{ctx.Locale.Tr "repo.pulls.add_prefix" (index .PullRequestWorkInProgressPrefixes 0)}}
44
</a>
55
{{end}}

templates/repo/issue/view_content/pull_merge_box.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
{{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}}
9696
</div>
9797
{{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}}
98-
<button class="ui compact button toggle-wip" data-title="{{.Issue.Title}}" data-wip-prefix="{{.WorkInProgressPrefix}}" data-update-url="{{.Issue.Link}}/title">
98+
<button class="ui compact button" data-global-init="initPullRequestWipToggle" data-title="{{.Issue.Title}}" data-wip-prefix="{{.WorkInProgressPrefix}}" data-update-url="{{.Issue.Link}}/title">
9999
{{ctx.Locale.Tr "repo.pulls.remove_prefix" .WorkInProgressPrefix}}
100100
</button>
101101
{{end}}

0 commit comments

Comments
 (0)