From c0df133804632f672fb0abd9b1f0b2653806ecae Mon Sep 17 00:00:00 2001 From: Gogs Date: Sun, 23 Feb 2025 21:41:43 +0100 Subject: [PATCH] change the repo settings form over to the new data model, presenting the two settings as one composite --- conf/locale/locale_en-US.ini | 5 ++++- internal/form/repo.go | 2 +- templates/repo/settings/options.tmpl | 24 +++++++++++++++++++++--- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/conf/locale/locale_en-US.ini b/conf/locale/locale_en-US.ini index d39f709e7..a377bfda8 100644 --- a/conf/locale/locale_en-US.ini +++ b/conf/locale/locale_en-US.ini @@ -758,7 +758,10 @@ settings.tracker_issue_style.alphanumeric = Alphanumeric settings.tracker_url_format_desc = You can use placeholder {user} {repo} {index} for user name, repository name and issue index. settings.pulls_desc = Enable pull requests to accept contributions between repositories and branches settings.pulls.ignore_whitespace = Ignore changes in whitespace -settings.pulls.allow_rebase_merge = Allow use rebase to merge commits +settings.pulls.merge_only = Always use merge to merge commits +settings.pulls.merge_default = Merge by default, but allow to use rebase to merge commits +settings.pulls.rebase_default = Rebase by default, but allow to use merge to merge commits +settings.pulls.rebase_only = Always use rebase to merge commits settings.danger_zone = Danger Zone settings.cannot_fork_to_same_owner = You cannot fork a repository to its original owner. settings.new_owner_has_same_repo = The new owner already has a repository with same name. Please choose another name. diff --git a/internal/form/repo.go b/internal/form/repo.go index 67066de29..c94be28ab 100644 --- a/internal/form/repo.go +++ b/internal/form/repo.go @@ -117,7 +117,7 @@ type RepoSetting struct { TrackerIssueStyle string EnablePulls bool PullsIgnoreWhitespace bool - PullsAllowRebase bool + PullsMergeType string } func (f *RepoSetting) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 5122fc37c..98f400cfa 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -231,9 +231,27 @@
-
- - +
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +