mirror of https://github.com/gogits/gogs.git
Browse Source
- Able to restrict force push and deletion - Able to restrict direct pushpull/4150/head
Unknwon
8 years ago
26 changed files with 524 additions and 103 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,62 @@
|
||||
{{template "base/head" .}} |
||||
<div class="repository settings branches"> |
||||
{{template "repo/header" .}} |
||||
<div class="ui container"> |
||||
<div class="ui grid"> |
||||
{{template "repo/settings/navbar" .}} |
||||
<div class="twelve wide column content"> |
||||
{{template "base/alert" .}} |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "repo.settings.default_branch"}} |
||||
</h4> |
||||
<div class="ui attached segment default-branch"> |
||||
<p>{{.i18n.Tr "repo.settings.default_branch_desc"}}</p> |
||||
<form class="ui form" action="{{.Link}}/default_branch" method="post"> |
||||
{{.CsrfTokenHtml}} |
||||
<div class="required inline field {{if .Repository.IsBare}}disabled{{end}}"> |
||||
<div class="ui selection dropdown"> |
||||
<input type="hidden" id="branch" name="branch" value="{{.Repository.DefaultBranch}}"> |
||||
<div class="text">{{.Repository.DefaultBranch}}</div> |
||||
<i class="dropdown icon"></i> |
||||
<div class="menu"> |
||||
{{range .Branches}} |
||||
<div class="item" data-value="{{.}}">{{.}}</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
<button class="ui green button">{{$.i18n.Tr "repo.settings.update"}}</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
|
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "repo.settings.protected_branches"}} |
||||
</h4> |
||||
<div class="ui attached segment protected-branches"> |
||||
<p>{{.i18n.Tr "repo.settings.protected_branches_desc"}}</p> |
||||
<div class="ui form"> |
||||
<div class="required inline field {{if .Repository.IsBare}}disabled{{end}}"> |
||||
<div class="ui selection dropdown"> |
||||
<div class="text">{{.i18n.Tr "repo.settings.choose_a_branch"}}</div> |
||||
<i class="dropdown icon"></i> |
||||
<div class="menu"> |
||||
{{range .Branches}} |
||||
<div class="item" data-url="{{$.Link}}/{{.}}">{{.}}</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="ui protected-branches list"> |
||||
{{range .ProtectBranches}} |
||||
<div class="item"> |
||||
<a href="{{$.Link}}/{{.Name}}"><code>{{.Name}}</code></a> |
||||
</div> |
||||
{{end}} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{{template "base/footer" .}} |
@ -0,0 +1,53 @@
|
||||
{{template "base/head" .}} |
||||
<div class="repository settings branches"> |
||||
{{template "repo/header" .}} |
||||
<div class="ui container"> |
||||
<div class="ui grid"> |
||||
{{template "repo/settings/navbar" .}} |
||||
<div class="twelve wide column content"> |
||||
{{template "base/alert" .}} |
||||
<h4 class="ui top attached header"> |
||||
{{.i18n.Tr "repo.settings.branch_protection"}} |
||||
</h4> |
||||
<div class="ui attached segment branch-protection"> |
||||
<p>{{.i18n.Tr "repo.settings.branch_protection_desc" .Branch.Name | Str2html}}</p> |
||||
<form class="ui form" action="{{.Link}}" method="post"> |
||||
{{.CsrfTokenHtml}} |
||||
<div class="inline field"> |
||||
<div class="ui checkbox"> |
||||
<input class="enable-protection" name="protected" type="checkbox" data-target="#protection_box" {{if .Branch.Protected}}checked{{end}}> |
||||
<label>{{.i18n.Tr "repo.settings.protect_this_branch"}}</label> |
||||
<p class="help">{{.i18n.Tr "repo.settings.protect_this_branch_desc"}}</p> |
||||
</div> |
||||
</div> |
||||
<div id="protection_box" class="fields {{if not .Branch.Protected}}disabled{{end}}"> |
||||
<div class="field"> |
||||
<div class="ui checkbox"> |
||||
<input name="require_pull_request" type="checkbox" {{if .Branch.RequirePullRequest}}checked{{end}}> |
||||
<label>{{.i18n.Tr "repo.settings.protect_require_pull_request"}}</label> |
||||
<p class="help">{{.i18n.Tr "repo.settings.protect_require_pull_request_desc"}}</p> |
||||
</div> |
||||
</div> |
||||
{{if .IsOrgRepo}} |
||||
<div class="field"> |
||||
<div class="ui checkbox"> |
||||
<input name="whitelist_committers" type="checkbox" data-target="#whitelist_box"> |
||||
<label>{{.i18n.Tr "repo.settings.protect_whitelist_committers"}}</label> |
||||
<p class="help">{{.i18n.Tr "repo.settings.protect_whitelist_committers_desc"}}</p> |
||||
</div> |
||||
</div> |
||||
{{end}} |
||||
</div> |
||||
|
||||
<div class="ui divider"></div> |
||||
|
||||
<div class="field"> |
||||
<button class="ui green button">{{$.i18n.Tr "repo.settings.update_settings"}}</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
{{template "base/footer" .}} |
Loading…
Reference in new issue