diff options
author | David Svantesson <davidsvantesson@gmail.com> | 2019-11-20 12:27:49 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-20 19:27:49 +0800 |
commit | 69a255defbf2747b066b2aeee66ba76cdd37104d (patch) | |
tree | 8cc6f166c06ff9ac334b3f5f69476fa4394ae6a2 /templates/org | |
parent | 35c3ea952a6eb558e69de55fc94d301676feb935 (diff) | |
download | gitea-69a255defbf2747b066b2aeee66ba76cdd37104d.tar.gz gitea-69a255defbf2747b066b2aeee66ba76cdd37104d.zip |
Team permission to create repository in organization (#8312)
* Add team permission setting to allow creating repo in organization.
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Add test case for creating repo when have team creation access.
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* build error: should omit comparison to bool constant
Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
* Add comment on exported functions
* Fix fixture consistency, fix existing unit tests
* Fix boolean comparison in xorm query.
* addCollaborator and changeCollaborationAccessMode separate steps
More clear to use different if-cases.
* Create and commit xorm session
* fix
* Add information of create repo permission in team sidebar
* Add migration step
* Clarify that repository creator will be administrator.
* Fix some things after merge
* Fix language text that use html
* migrations file
* Create repository permission -> Create repositories
* fix merge
* fix review comments
Diffstat (limited to 'templates/org')
-rw-r--r-- | templates/org/home.tmpl | 2 | ||||
-rw-r--r-- | templates/org/team/new.tmpl | 12 | ||||
-rw-r--r-- | templates/org/team/sidebar.tmpl | 3 |
3 files changed, 14 insertions, 3 deletions
diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 03bb525276..0aa575707a 100644 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -22,7 +22,7 @@ <div class="ui container"> <div class="ui mobile reversed stackable grid"> <div class="ui eleven wide column"> - {{if .IsOrganizationOwner}} + {{if .CanCreateOrgRepo}} <div class="text right"> <a class="ui green button" href="{{AppSubUrl}}/repo/create?org={{.Org.ID}}"><i class="octicon octicon-repo-create"></i> {{.i18n.Tr "new_repo"}}</a> </div> diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl index e50a1777d2..c38fa4d940 100644 --- a/templates/org/team/new.tmpl +++ b/templates/org/team/new.tmpl @@ -31,14 +31,22 @@ <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> + <span class="help">{{.i18n.Tr "org.teams.specific_repositories_helper" | Str2html}}</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> + <span class="help">{{.i18n.Tr "org.teams.all_repositories_helper" | Str2html}}</span> + </div> + </div> + + <div class="field"> + <div class="ui checkbox"> + <label for="can_create_org_repo">{{.i18n.Tr "org.teams.can_create_org_repo"}}</label> + <input id="can_create_org_repo" name="can_create_org_repo" type="checkbox" {{if .Team.CanCreateOrgRepo}}checked{{end}}> + <span class="help">{{.i18n.Tr "org.teams.can_create_org_repo_helper"}}</span> </div> </div> </div> diff --git a/templates/org/team/sidebar.tmpl b/templates/org/team/sidebar.tmpl index dd189df5f3..75c5ce756d 100644 --- a/templates/org/team/sidebar.tmpl +++ b/templates/org/team/sidebar.tmpl @@ -40,6 +40,9 @@ {{.i18n.Tr "org.teams.admin_permission_desc" | Str2html}} {{end}} {{end}} + {{if .Team.CanCreateOrgRepo}} + <br><br>{{.i18n.Tr "org.teams.create_repo_permission_desc" | Str2html}} + {{end}} </div> </div> {{if .IsOrganizationOwner}} |