aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2025-01-15 06:51:17 +0800
committerGitHub <noreply@github.com>2025-01-15 00:51:17 +0200
commitb4e2d5e8ee88e6f1cef93a6689caa5c156b2afc1 (patch)
tree6c3a555525fcdc20a8837cb5c75d0e84842c8cfd
parent2984a7c121963c7c975d3b29666f99e5493c827e (diff)
downloadgitea-b4e2d5e8ee88e6f1cef93a6689caa5c156b2afc1.tar.gz
gitea-b4e2d5e8ee88e6f1cef93a6689caa5c156b2afc1.zip
Add a confirm dialog for "sync fork" (#33270) (#33273)
Backport #33270 by @wxiaoguang Try to quickly fix #33264 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
-rw-r--r--options/locale/locale_en-US.ini1
-rw-r--r--templates/repo/code/upstream_diverging_info.tmpl5
2 files changed, 5 insertions, 1 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index 2c10a4dbe1..c7cede4dc0 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -1951,6 +1951,7 @@ pulls.upstream_diverging_prompt_behind_1 = This branch is %[1]d commit behind %[
pulls.upstream_diverging_prompt_behind_n = This branch is %[1]d commits behind %[2]s
pulls.upstream_diverging_prompt_base_newer = The base branch %s has new changes
pulls.upstream_diverging_merge = Sync fork
+pulls.upstream_diverging_merge_confirm = Would you like to merge base repository's default branch onto this repository's branch %s?
pull.deleted_branch = (deleted):%s
pull.agit_documentation = Review documentation about AGit
diff --git a/templates/repo/code/upstream_diverging_info.tmpl b/templates/repo/code/upstream_diverging_info.tmpl
index bdcd99a7f7..a1f37b8c05 100644
--- a/templates/repo/code/upstream_diverging_info.tmpl
+++ b/templates/repo/code/upstream_diverging_info.tmpl
@@ -10,7 +10,10 @@
{{end}}
</div>
{{if .CanWriteCode}}
- <button class="ui compact primary button tw-m-0 link-action" data-url="{{.Repository.Link}}/branches/merge-upstream?branch={{.BranchName}}">
+ <button class="ui compact primary button tw-m-0 link-action"
+ data-modal-confirm-header="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge"}}"
+ data-modal-confirm-content="{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge_confirm" .BranchName}}"
+ data-url="{{.Repository.Link}}/branches/merge-upstream?branch={{.BranchName}}">
{{ctx.Locale.Tr "repo.pulls.upstream_diverging_merge"}}
</button>
{{end}}