2023-04-23 06:21:21 -04:00
|
|
|
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings branches")}}
|
|
|
|
<div class="repo-setting-content">
|
2023-01-16 03:00:22 -05:00
|
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
|
|
<h4 class="ui top attached header">
|
2024-02-25 09:02:20 -05:00
|
|
|
{{ctx.Locale.Tr "repo.settings.branch_protection" .Rule.RuleName}}
|
2023-01-16 03:00:22 -05:00
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment branch-protection">
|
2023-09-25 04:56:50 -04:00
|
|
|
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.protect_patterns"}}</h5>
|
2023-01-16 03:00:22 -05:00
|
|
|
<div class="field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern"}}</label>
|
2023-01-16 03:00:22 -05:00
|
|
|
<input name="rule_name" type="text" value="{{.Rule.RuleName}}">
|
|
|
|
<input name="rule_id" type="hidden" value="{{.Rule.ID}}">
|
2024-09-02 14:36:24 -04:00
|
|
|
<p class="help tw-ml-0">{{ctx.Locale.Tr "repo.settings.protect_branch_name_pattern_desc" "https://github.com/gobwas/glob"}}</p>
|
2017-09-14 04:16:22 -04:00
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_protected_file_patterns"}}</label>
|
2023-04-29 06:44:52 -04:00
|
|
|
<input name="protected_file_patterns" type="text" value="{{.Rule.ProtectedFilePatterns}}">
|
2024-09-02 14:36:24 -04:00
|
|
|
<p class="help tw-ml-0">{{ctx.Locale.Tr "repo.settings.protect_protected_file_patterns_desc" "https://pkg.go.dev/github.com/gobwas/glob#Compile" "github.com/gobwas/glob"}}</p>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_unprotected_file_patterns"}}</label>
|
2023-04-29 06:44:52 -04:00
|
|
|
<input name="unprotected_file_patterns" type="text" value="{{.Rule.UnprotectedFilePatterns}}">
|
2024-09-02 14:36:24 -04:00
|
|
|
<p class="help tw-ml-0">{{ctx.Locale.Tr "repo.settings.protect_unprotected_file_patterns_desc" "https://pkg.go.dev/github.com/gobwas/glob#Compile" "github.com/gobwas/glob"}}</p>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
2023-01-16 03:00:22 -05:00
|
|
|
|
|
|
|
{{.CsrfTokenHtml}}
|
2023-09-25 04:56:50 -04:00
|
|
|
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_push"}}</h5>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="field">
|
|
|
|
<div class="ui radio checkbox">
|
|
|
|
<input name="enable_push" type="radio" value="none" class="toggle-target-disabled" data-target="#whitelist_box" {{if not .Rule.CanPush}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_disable_push"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_disable_push_desc"}}</p>
|
2019-12-03 20:08:56 -05:00
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui radio checkbox">
|
|
|
|
<input name="enable_push" type="radio" value="all" class="toggle-target-disabled" data-target="#whitelist_box" {{if and (.Rule.CanPush) (not .Rule.EnableWhitelist)}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_enable_push"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_push_desc"}}</p>
|
2019-12-03 20:08:56 -05:00
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
|
|
|
<div class="grouped fields">
|
2019-12-03 20:08:56 -05:00
|
|
|
<div class="field">
|
|
|
|
<div class="ui radio checkbox">
|
2023-04-29 06:44:52 -04:00
|
|
|
<input name="enable_push" type="radio" value="whitelist" class="toggle-target-enabled" data-target="#whitelist_box" {{if and (.Rule.CanPush) (.Rule.EnableWhitelist)}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_committers"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_whitelist_committers_desc"}}</p>
|
2017-09-14 04:16:22 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div id="whitelist_box" class="grouped fields {{if not .Rule.EnableWhitelist}}disabled{{end}}">
|
|
|
|
<div class="checkbox-sub-item field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_users"}}</label>
|
2017-09-14 04:16:22 -04:00
|
|
|
<div class="ui multiple search selection dropdown">
|
|
|
|
<input type="hidden" name="whitelist_users" value="{{.whitelist_users}}">
|
2024-03-14 19:24:59 -04:00
|
|
|
<div class="default text">{{ctx.Locale.Tr "search.user_kind"}}</div>
|
2017-09-14 04:16:22 -04:00
|
|
|
<div class="menu">
|
|
|
|
{{range .Users}}
|
|
|
|
<div class="item" data-value="{{.ID}}">
|
2023-08-09 23:19:39 -04:00
|
|
|
{{ctx.AvatarUtils.Avatar . 28 "mini"}}{{template "repo/search_name" .}}
|
2017-09-14 04:16:22 -04:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{if .Owner.IsOrganization}}
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="checkbox-sub-item field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_teams"}}</label>
|
2017-09-14 04:16:22 -04:00
|
|
|
<div class="ui multiple search selection dropdown">
|
|
|
|
<input type="hidden" name="whitelist_teams" value="{{.whitelist_teams}}">
|
2024-03-14 19:24:59 -04:00
|
|
|
<div class="default text">{{ctx.Locale.Tr "search.team_kind"}}</div>
|
2017-09-14 04:16:22 -04:00
|
|
|
<div class="menu">
|
|
|
|
{{range .Teams}}
|
|
|
|
<div class="item" data-value="{{.ID}}">
|
2020-09-11 16:19:00 -04:00
|
|
|
{{svg "octicon-people"}}
|
2017-09-14 04:16:22 -04:00
|
|
|
{{.Name}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="checkbox-sub-item field">
|
2019-10-21 04:21:45 -04:00
|
|
|
<div class="ui checkbox">
|
2023-01-16 03:00:22 -05:00
|
|
|
<input type="checkbox" name="whitelist_deploy_keys" {{if .Rule.WhitelistDeployKeys}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_whitelist_deploy_keys"}}</label>
|
2018-03-25 06:01:32 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-09-18 01:39:45 -04:00
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
|
|
|
<input name="require_signed_commits" type="checkbox" {{if .Rule.RequireSignedCommits}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.require_signed_commits"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.require_signed_commits_desc"}}</p>
|
2018-12-11 06:28:37 -05:00
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
2024-07-05 14:21:56 -04:00
|
|
|
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_force_push"}}</h5>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui radio checkbox">
|
|
|
|
<input type="radio" name="enable_force_push" value="none" class="toggle-target-disabled" data-target="#force_push_allowlist_box" {{if not .Rule.CanForcePush}}checked{{end}}>
|
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_disable_force_push"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_disable_force_push_desc"}}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui radio checkbox">
|
|
|
|
<input type="radio" name="enable_force_push" value="all" class="toggle-target-disabled" data-target="#force_push_allowlist_box" {{if and (.Rule.CanForcePush) (not .Rule.EnableForcePushAllowlist)}}checked{{end}}>
|
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_enable_force_push_all"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_force_push_all_desc"}}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="grouped fields">
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui radio checkbox">
|
|
|
|
<input type="radio" name="enable_force_push" value="whitelist" class="toggle-target-enabled" data-target="#force_push_allowlist_box" {{if and (.Rule.CanForcePush) (.Rule.EnableForcePushAllowlist)}}checked{{end}}>
|
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_enable_force_push_allowlist"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_force_push_allowlist_desc"}}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="force_push_allowlist_box" class="grouped fields {{if not .Rule.EnableForcePushAllowlist}}disabled{{end}}">
|
|
|
|
<div class="checkbox-sub-item field">
|
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_force_push_allowlist_users"}}</label>
|
|
|
|
<div class="ui multiple search selection dropdown">
|
|
|
|
<input type="hidden" name="force_push_allowlist_users" value="{{.force_push_allowlist_users}}">
|
|
|
|
<div class="default text">{{ctx.Locale.Tr "search.user_kind"}}</div>
|
|
|
|
<div class="menu">
|
|
|
|
{{range .Users}}
|
|
|
|
<div class="item" data-value="{{.ID}}">
|
|
|
|
{{ctx.AvatarUtils.Avatar . 28 "mini"}}{{template "repo/search_name" .}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{if .Owner.IsOrganization}}
|
|
|
|
<div class="checkbox-sub-item field">
|
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_force_push_allowlist_teams"}}</label>
|
|
|
|
<div class="ui multiple search selection dropdown">
|
|
|
|
<input type="hidden" name="force_push_allowlist_teams" value="{{.force_push_allowlist_teams}}">
|
|
|
|
<div class="default text">{{ctx.Locale.Tr "search.team_kind"}}</div>
|
|
|
|
<div class="menu">
|
|
|
|
{{range .Teams}}
|
|
|
|
<div class="item" data-value="{{.ID}}">
|
|
|
|
{{svg "octicon-people"}}
|
|
|
|
{{.Name}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
<div class="checkbox-sub-item field">
|
|
|
|
<div class="ui checkbox">
|
|
|
|
<input type="checkbox" name="force_push_allowlist_deploy_keys" {{if .Rule.ForcePushAllowlistDeployKeys}}checked{{end}}>
|
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_force_push_allowlist_deploy_keys"}}</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-09-25 04:56:50 -04:00
|
|
|
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_pull_request_approvals"}}</h5>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_required_approvals"}}</label>
|
2023-04-29 06:44:52 -04:00
|
|
|
<input name="required_approvals" type="number" value="{{.Rule.RequiredApprovals}}">
|
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind,
except `gt-hidden`. Commands ran:
```bash
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/*
perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/*
```
2024-03-24 12:42:49 -04:00
|
|
|
<p class="help tw-ml-0">{{ctx.Locale.Tr "repo.settings.protect_required_approvals_desc"}}</p>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
|
|
|
<div class="grouped fields">
|
2019-12-03 20:08:56 -05:00
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-04-29 06:44:52 -04:00
|
|
|
<input name="enable_approvals_whitelist" type="checkbox" class="toggle-target-enabled" data-target="#approvals_whitelist_box" {{if .Rule.EnableApprovalsWhitelist}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_enabled"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_enabled_desc"}}</p>
|
2019-12-03 20:08:56 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div id="approvals_whitelist_box" class="grouped fields {{if not .Rule.EnableApprovalsWhitelist}}disabled{{end}}">
|
|
|
|
<div class="checkbox-sub-item field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_users"}}</label>
|
2018-12-11 06:28:37 -05:00
|
|
|
<div class="ui multiple search selection dropdown">
|
|
|
|
<input type="hidden" name="approvals_whitelist_users" value="{{.approvals_whitelist_users}}">
|
2024-03-14 19:24:59 -04:00
|
|
|
<div class="default text">{{ctx.Locale.Tr "search.user_kind"}}</div>
|
2018-12-11 06:28:37 -05:00
|
|
|
<div class="menu">
|
|
|
|
{{range .Users}}
|
|
|
|
<div class="item" data-value="{{.ID}}">
|
2023-08-09 23:19:39 -04:00
|
|
|
{{ctx.AvatarUtils.Avatar . 28 "mini"}}{{template "repo/search_name" .}}
|
2018-12-11 06:28:37 -05:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-03 20:08:56 -05:00
|
|
|
{{if .Owner.IsOrganization}}
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="checkbox-sub-item field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_approvals_whitelist_teams"}}</label>
|
2019-12-03 20:08:56 -05:00
|
|
|
<div class="ui multiple search selection dropdown">
|
|
|
|
<input type="hidden" name="approvals_whitelist_teams" value="{{.approvals_whitelist_teams}}">
|
2024-03-14 19:24:59 -04:00
|
|
|
<div class="default text">{{ctx.Locale.Tr "search.team_kind"}}</div>
|
2019-12-03 20:08:56 -05:00
|
|
|
<div class="menu">
|
|
|
|
{{range .Teams}}
|
|
|
|
<div class="item" data-value="{{.ID}}">
|
2020-09-11 16:19:00 -04:00
|
|
|
{{svg "octicon-people"}}
|
2019-12-03 20:08:56 -05:00
|
|
|
{{.Name}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2018-12-11 06:28:37 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-12-03 20:08:56 -05:00
|
|
|
{{end}}
|
2018-12-11 06:28:37 -05:00
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2024-01-15 02:20:01 -05:00
|
|
|
<input id="dismiss_stale_approvals" name="dismiss_stale_approvals" type="checkbox" {{if .Rule.DismissStaleApprovals}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.dismiss_stale_approvals"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.dismiss_stale_approvals_desc"}}</p>
|
2020-01-15 03:32:57 -05:00
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
2024-01-15 02:20:01 -05:00
|
|
|
<div id="ignore_stale_approvals_box" class="field {{if .Rule.DismissStaleApprovals}}disabled{{end}}">
|
|
|
|
<div class="ui checkbox">
|
|
|
|
<input id="ignore_stale_approvals" name="ignore_stale_approvals" type="checkbox" {{if .Rule.IgnoreStaleApprovals}}checked{{end}}>
|
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.ignore_stale_approvals"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.ignore_stale_approvals_desc"}}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="grouped fields">
|
2020-11-28 14:30:46 -05:00
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
2023-04-29 06:44:52 -04:00
|
|
|
<input name="enable_status_check" type="checkbox" class="toggle-target-enabled" data-target="#statuscheck_contexts_box" {{if .Rule.EnableStatusCheck}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts_desc"}}</p>
|
2020-11-28 14:30:46 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div id="statuscheck_contexts_box" class="checkbox-sub-item field {{if not .Rule.EnableStatusCheck}}disabled{{end}}">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_status_check_patterns"}}</label>
|
2023-05-17 04:11:13 -04:00
|
|
|
<textarea id="status_check_contexts" name="status_check_contexts" rows="3">{{.status_check_contexts}}</textarea>
|
2023-09-25 04:56:50 -04:00
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_status_check_patterns_desc"}}</p>
|
2023-04-29 06:44:52 -04:00
|
|
|
<table class="ui celled table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2023-09-25 04:56:50 -04:00
|
|
|
<th>{{ctx.Locale.Tr "repo.settings.protect_check_status_contexts_list"}}</th>
|
2023-04-29 06:44:52 -04:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2023-05-17 04:11:13 -04:00
|
|
|
{{range $.recent_status_checks}}
|
2023-04-29 06:44:52 -04:00
|
|
|
<tr>
|
|
|
|
<td>
|
2023-05-17 04:11:13 -04:00
|
|
|
<span>{{.}}</span>
|
2024-03-24 14:23:38 -04:00
|
|
|
<span class="status-check-matched-mark tw-hidden" data-status-check="{{.}}">{{ctx.Locale.Tr "repo.settings.protect_status_check_matched"}}</span>
|
2023-04-29 06:44:52 -04:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{else}}
|
2023-05-02 05:54:29 -04:00
|
|
|
<tr><td>-</td></tr>
|
2023-04-29 06:44:52 -04:00
|
|
|
{{end}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-09-25 04:56:50 -04:00
|
|
|
<h5 class="ui dividing header">{{ctx.Locale.Tr "repo.settings.event_pull_request_merge"}}</h5>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="grouped fields">
|
2020-01-08 20:47:45 -05:00
|
|
|
<div class="field">
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="ui radio checkbox">
|
|
|
|
<input name="enable_merge_whitelist" type="radio" value="false" class="toggle-target-disabled" data-target="#merge_whitelist_box" {{if not .Rule.EnableMergeWhitelist}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_enable_merge"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_enable_merge_desc"}}</p>
|
2020-01-08 20:47:45 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-15 03:32:57 -05:00
|
|
|
<div class="field">
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="ui radio checkbox">
|
|
|
|
<input name="enable_merge_whitelist" type="radio" value="true" class="toggle-target-enabled" data-target="#merge_whitelist_box" {{if .Rule.EnableMergeWhitelist}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_committers"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_committers_desc"}}</p>
|
2020-01-15 03:32:57 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div id="merge_whitelist_box" class="grouped fields {{if not .Rule.EnableMergeWhitelist}}disabled{{end}}">
|
|
|
|
<div class="checkbox-sub-item field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_users"}}</label>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="ui multiple search selection dropdown">
|
|
|
|
<input type="hidden" name="merge_whitelist_users" value="{{.merge_whitelist_users}}">
|
2024-03-14 19:24:59 -04:00
|
|
|
<div class="default text">{{ctx.Locale.Tr "search.user_kind"}}</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="menu">
|
|
|
|
{{range .Users}}
|
|
|
|
<div class="item" data-value="{{.ID}}">
|
2023-08-09 23:19:39 -04:00
|
|
|
{{ctx.AvatarUtils.Avatar . 28 "mini"}}{{template "repo/search_name" .}}
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-16 21:00:36 -04:00
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
{{if .Owner.IsOrganization}}
|
|
|
|
<div class="checkbox-sub-item field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.protect_merge_whitelist_teams"}}</label>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="ui multiple search selection dropdown">
|
|
|
|
<input type="hidden" name="merge_whitelist_teams" value="{{.merge_whitelist_teams}}">
|
2024-03-14 19:24:59 -04:00
|
|
|
<div class="default text">{{ctx.Locale.Tr "search.team_kind"}}</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
<div class="menu">
|
|
|
|
{{range .Teams}}
|
|
|
|
<div class="item" data-value="{{.ID}}">
|
|
|
|
{{svg "octicon-people"}}
|
|
|
|
{{.Name}}
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2020-04-16 21:00:36 -04:00
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
|
|
|
<input name="block_on_rejected_reviews" type="checkbox" {{if .Rule.BlockOnRejectedReviews}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.block_rejected_reviews"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.block_rejected_reviews_desc"}}</p>
|
2020-03-26 18:26:34 -04:00
|
|
|
</div>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
|
|
|
<input name="block_on_official_review_requests" type="checkbox" {{if .Rule.BlockOnOfficialReviewRequests}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.block_on_official_review_requests"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.block_on_official_review_requests_desc"}}</p>
|
2023-04-29 06:44:52 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<div class="ui checkbox">
|
|
|
|
<input name="block_on_outdated_branch" type="checkbox" {{if .Rule.BlockOnOutdatedBranch}}checked{{end}}>
|
2023-09-25 04:56:50 -04:00
|
|
|
<label>{{ctx.Locale.Tr "repo.settings.block_outdated_branch"}}</label>
|
|
|
|
<p class="help">{{ctx.Locale.Tr "repo.settings.block_outdated_branch_desc"}}</p>
|
2021-09-11 10:21:17 -04:00
|
|
|
</div>
|
2017-09-14 04:16:22 -04:00
|
|
|
</div>
|
2023-06-29 08:24:22 -04:00
|
|
|
<div class="divider"></div>
|
2017-09-14 04:16:22 -04:00
|
|
|
|
|
|
|
<div class="field">
|
2023-09-25 04:56:50 -04:00
|
|
|
<button class="ui primary button">{{ctx.Locale.Tr "repo.settings.protected_branch.save_rule"}}</button>
|
2017-09-14 04:16:22 -04:00
|
|
|
</div>
|
2023-01-16 03:00:22 -05:00
|
|
|
</div>
|
|
|
|
</form>
|
2017-09-14 04:16:22 -04:00
|
|
|
</div>
|
2023-04-23 06:21:21 -04:00
|
|
|
{{template "repo/settings/layout_footer" .}}
|