diff options
author | Brecht Van Lommel <brecht@blender.org> | 2023-02-13 07:09:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-13 14:09:52 +0800 |
commit | 49919c636e4788a14f3762a0d9137ee2e0092790 (patch) | |
tree | acac92af0eff851eaea32416e17001ba0776032c /templates | |
parent | b6d77229cfbab146da6445467acab2125e9e5edb (diff) | |
download | gitea-49919c636e4788a14f3762a0d9137ee2e0092790.tar.gz gitea-49919c636e4788a14f3762a0d9137ee2e0092790.zip |
Pull Requests: setting to allow edits by maintainers by default, tweak UI (#22862)
Add setting to allow edits by maintainers by default, to avoid having to
often ask contributors to enable this.
This also reorganizes the pull request settings UI to improve clarity.
It was unclear which checkbox options were there to control available
merge styles and which merge styles they correspond to.
Now there is a "Merge Styles" label followed by the merge style options
with the same name as in other menus. The remaining checkboxes were
moved to the bottom, ordered rougly by typical order of operations.
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/issue/new_form.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/settings/options.tmpl | 66 | ||||
-rw-r--r-- | templates/swagger/v1_json.tmpl | 9 |
3 files changed, 49 insertions, 28 deletions
diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index ed1fd4778f..2e55686725 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -238,7 +238,7 @@ <div class="inline field"> <div class="ui checkbox"> <label class="tooltip" data-content="{{.locale.Tr "repo.pulls.allow_edits_from_maintainers_desc"}}"><strong>{{.locale.Tr "repo.pulls.allow_edits_from_maintainers"}}</strong></label> - <input name="allow_maintainer_edit" type="checkbox"> + <input name="allow_maintainer_edit" type="checkbox" {{if .AllowMaintainerEdit}}checked{{end}}> </div> </div> {{end}} diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 6715a3c4eb..7b8f9923af 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -478,59 +478,41 @@ </div> <div class="field{{if not $pullRequestEnabled}} disabled{{end}}" id="pull_box"> <div class="field"> - <div class="ui checkbox"> - <input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.ignore_whitespace"}}</label> - </div> + <p> + {{.locale.Tr "repo.settings.merge_style_desc"}} + </p> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_allow_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowMerge)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.allow_merge_commits"}}</label> + <label>{{.locale.Tr "repo.pulls.merge_pull_request"}}</label> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_allow_rebase" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebase)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.allow_rebase_merge"}}</label> + <label>{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</label> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_allow_rebase_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseMerge)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.allow_rebase_merge_commit"}}</label> + <label>{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</label> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_allow_squash" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowSquash)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.allow_squash_commits"}}</label> + <label>{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}</label> </div> </div> <div class="field"> <div class="ui checkbox"> <input name="pulls_allow_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowManualMerge)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.allow_manual_merge"}}</label> - </div> - </div> - <div class="field"> - <div class="ui checkbox"> - <input name="enable_autodetect_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AutodetectManualMerge)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.enable_autodetect_manual_merge"}}</label> - </div> - </div> - <div class="field"> - <div class="ui checkbox"> - <input name="pulls_allow_rebase_update" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseUpdate)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label> - </div> - </div> - <div class="field"> - <div class="ui checkbox"> - <input name="default_delete_branch_after_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge)}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label> + <label>{{.locale.Tr "repo.pulls.merge_manually"}}</label> </div> </div> + <div class="field"> <p> {{.locale.Tr "repo.settings.default_merge_style_desc"}} @@ -564,6 +546,36 @@ </div> </div> </div> + <div class="field"> + <div class="ui checkbox"> + <input name="default_allow_maintainer_edit" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultAllowMaintainerEdit)}}checked{{end}}> + <label>{{.locale.Tr "repo.settings.pulls.default_allow_edits_from_maintainers"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="pulls_allow_rebase_update" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AllowRebaseUpdate)}}checked{{end}}> + <label>{{.locale.Tr "repo.settings.pulls.allow_rebase_update"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="default_delete_branch_after_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.DefaultDeleteBranchAfterMerge)}}checked{{end}}> + <label>{{.locale.Tr "repo.settings.pulls.default_delete_branch_after_merge"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="enable_autodetect_manual_merge" type="checkbox" {{if or (not $pullRequestEnabled) ($prUnit.PullRequestsConfig.AutodetectManualMerge)}}checked{{end}}> + <label>{{.locale.Tr "repo.settings.pulls.enable_autodetect_manual_merge"}}</label> + </div> + </div> + <div class="field"> + <div class="ui checkbox"> + <input name="pulls_ignore_whitespace" type="checkbox" {{if and $pullRequestEnabled ($prUnit.PullRequestsConfig.IgnoreWhitespaceConflicts)}}checked{{end}}> + <label>{{.locale.Tr "repo.settings.pulls.ignore_whitespace"}}</label> + </div> + </div> </div> {{end}} diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 5b07965d2a..e096faf3f3 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -16497,6 +16497,11 @@ "type": "boolean", "x-go-name": "AutodetectManualMerge" }, + "default_allow_maintainer_edit": { + "description": "set to `true` to allow edits from maintainers by default", + "type": "boolean", + "x-go-name": "DefaultAllowMaintainerEdit" + }, "default_branch": { "description": "sets the default branch for this repository.", "type": "string", @@ -19015,6 +19020,10 @@ "format": "date-time", "x-go-name": "Created" }, + "default_allow_maintainer_edit": { + "type": "boolean", + "x-go-name": "DefaultAllowMaintainerEdit" + }, "default_branch": { "type": "string", "x-go-name": "DefaultBranch" |