aboutsummaryrefslogtreecommitdiffstats
path: root/templates/org
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2019-11-06 10:37:14 +0100
committerLauris BH <lauris@nix.lv>2019-11-06 11:37:14 +0200
commit72aa5a20ecf8aa3f7c110fd51c37994d950e0ba8 (patch)
tree3ac89c3c7b28572737b20dfe8cbeed259184d91b /templates/org
parent0109229928d8603ebedc2364943538f788635370 (diff)
downloadgitea-72aa5a20ecf8aa3f7c110fd51c37994d950e0ba8.tar.gz
gitea-72aa5a20ecf8aa3f7c110fd51c37994d950e0ba8.zip
Add team option to grant rights for all organization repositories (#8688)
* Add field IsAllRepositories to team * Add AllRepositories to team UI * Manage team with access to all repositories * Add field IsAllRepositories to team API * put backticks around table/column names * rename IsAllRepositories to IncludesAllRepositories * do not reload slice if already loaded * add repo to teams with access to all repositories when changing repo owner * improve tests for teams with access to all repositories * Merge branch 'master' * Change code for adding all repositories Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * fmt after merge * Change code in API EditTeam similar to EditTeamPost web interface Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Clarify that all repositories will be added Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * All repositories option under Permissions headline * New setting group 'Repository access' * Move check IncludeAllRepositories to removeRepository. * Revert "Move check IncludeAllRepositories to removeRepository." and add comment instead. This reverts commit 753b7d205be260b8be465b5291a02975a81f3093. * Clarify help text what options do.
Diffstat (limited to 'templates/org')
-rw-r--r--templates/org/team/new.tmpl18
-rw-r--r--templates/org/team/repositories.tmpl2
-rw-r--r--templates/org/team/sidebar.tmpl18
3 files changed, 34 insertions, 4 deletions
diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl
index fb79c9b7fb..e50a1777d2 100644
--- a/templates/org/team/new.tmpl
+++ b/templates/org/team/new.tmpl
@@ -25,6 +25,24 @@
</div>
{{if not (eq .Team.LowerName "owners")}}
<div class="grouped field">
+ <label>{{.i18n.Tr "org.team_access_desc"}}</label>
+ <br>
+ <div class="field">
+ <div class="ui radio checkbox">
+ <input type="radio" name="repo_access" value="specific" {{if not .Team.IncludesAllRepositories}}checked{{end}}>
+ <label>{{.i18n.Tr "org.teams.specific_repositories"}}</label>
+ <span class="help">{{.i18n.Tr "org.teams.specific_repositories_helper"}}</span>
+ </div>
+ </div>
+ <div class="field">
+ <div class="ui radio checkbox">
+ <input type="radio" name="repo_access" value="all" {{if .Team.IncludesAllRepositories}}checked{{end}}>
+ <label>{{.i18n.Tr "org.teams.all_repositories"}}</label>
+ <span class="help">{{.i18n.Tr "org.teams.all_repositories_helper"}}</span>
+ </div>
+ </div>
+ </div>
+ <div class="grouped field">
<label>{{.i18n.Tr "org.team_permission_desc"}}</label>
<br>
<div class="field">
diff --git a/templates/org/team/repositories.tmpl b/templates/org/team/repositories.tmpl
index eeb86564fd..1b2a411c2b 100644
--- a/templates/org/team/repositories.tmpl
+++ b/templates/org/team/repositories.tmpl
@@ -7,7 +7,7 @@
{{template "org/team/sidebar" .}}
<div class="ui ten wide column">
{{template "org/team/navbar" .}}
- {{$canAddRemove := and $.IsOrganizationOwner (not (eq $.Team.LowerName "owners"))}}
+ {{$canAddRemove := and $.IsOrganizationOwner (not $.Team.IncludesAllRepositories)}}
{{if $canAddRemove}}
<div class="ui attached segment">
<form class="ui form" id="add-repo-form" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/add" method="post">
diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl
index 846613e32e..dd189df5f3 100644
--- a/templates/org/team/sidebar.tmpl
+++ b/templates/org/team/sidebar.tmpl
@@ -22,11 +22,23 @@
{{if eq .Team.LowerName "owners"}}
{{.i18n.Tr "org.teams.owners_permission_desc" | Str2html}}
{{else if (eq .Team.Authorize 1)}}
- {{.i18n.Tr "org.teams.read_permission_desc" | Str2html}}
+ {{if .Team.IncludesAllRepositories}}
+ {{.i18n.Tr "org.teams.all_repositories_read_permission_desc" | Str2html}}
+ {{else}}
+ {{.i18n.Tr "org.teams.read_permission_desc" | Str2html}}
+ {{end}}
{{else if (eq .Team.Authorize 2)}}
- {{.i18n.Tr "org.teams.write_permission_desc" | Str2html}}
+ {{if .Team.IncludesAllRepositories}}
+ {{.i18n.Tr "org.teams.all_repositories_write_permission_desc" | Str2html}}
+ {{else}}
+ {{.i18n.Tr "org.teams.write_permission_desc" | Str2html}}
+ {{end}}
{{else if (eq .Team.Authorize 3)}}
- {{.i18n.Tr "org.teams.admin_permission_desc" | Str2html}}
+ {{if .Team.IncludesAllRepositories}}
+ {{.i18n.Tr "org.teams.all_repositories_admin_permission_desc" | Str2html}}
+ {{else}}
+ {{.i18n.Tr "org.teams.admin_permission_desc" | Str2html}}
+ {{end}}
{{end}}
</div>
</div>