From e0c9617dc753678d14e9c00ab15c87ea938473d7 Mon Sep 17 00:00:00 2001 From: Alex Suraci Date: Mon, 17 Feb 2014 10:48:43 -0800 Subject: [PATCH 1/2] add admin checkbox for setting a repo privileged --- pkg/handler/repos.go | 2 ++ pkg/template/pages/repo_settings.html | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/handler/repos.go b/pkg/handler/repos.go index de232b8e5..36b15ed47 100644 --- a/pkg/handler/repos.go +++ b/pkg/handler/repos.go @@ -229,6 +229,8 @@ func RepoUpdate(w http.ResponseWriter, r *http.Request, u *User, repo *Repo) err repo.Disabled = len(r.FormValue("Disabled")) == 0 repo.DisabledPullRequest = len(r.FormValue("DisabledPullRequest")) == 0 + repo.Privileged = u.Admin && len(r.FormValue("Privileged")) > 0 + // value of "" indicates the currently authenticated user // should be set as the administrator. if len(r.FormValue("Owner")) == 0 { diff --git a/pkg/template/pages/repo_settings.html b/pkg/template/pages/repo_settings.html index 7d54bbd34..8d92fe698 100644 --- a/pkg/template/pages/repo_settings.html +++ b/pkg/template/pages/repo_settings.html @@ -43,6 +43,15 @@ Enable Pull Hooks + {{ if .User.Admin }} +
Admin-only settings.
+
+ +
+ {{ end }}
Choose the account owner.