Merge pull request #236 from sivel/private-checkbox

Provide checkbox to override private setting on repo
This commit is contained in:
Brad Rydzewski 2014-04-03 09:05:45 -07:00
commit 5e22b8416c
2 changed files with 8 additions and 2 deletions

View file

@ -328,7 +328,7 @@ func RepoUpdate(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) err
default:
repo.Disabled = len(r.FormValue("Disabled")) == 0
repo.DisabledPullRequest = len(r.FormValue("DisabledPullRequest")) == 0
repo.Private = len(r.FormValue("Private")) > 0
repo.Privileged = u.Admin && len(r.FormValue("Privileged")) > 0
// value of "" indicates the currently authenticated user

View file

@ -31,7 +31,7 @@
<div class="col-xs-9" role="main">
<div class="alert">Manage your repository settings.</div>
<form method="POST" action="/{{.Repo.Slug}}" role="form">
<div class="checkbox">
<div class="checkbox form-group">
<label>
<input class="" type="checkbox" name="Disabled" {{ if not .Repo.Disabled }}checked="True" {{ end }}/>
Enable Build Hooks
@ -43,6 +43,12 @@
Enable Pull Hooks
</label>
</div>
<div class="checkbox form-group">
<label>
<input class="" type="checkbox" name="Private" {{ if .Repo.Private }}checked="True" {{ end }}/>
Private
</label>
</div>
{{ if .User.Admin }}
<div class="alert alert-min">Admin-only settings.</div>
<div class="checkbox form-group">