From 64ce159a6eacc81962d07a8f5ef7f69c17365363 Mon Sep 17 00:00:00 2001 From: Rémy Boulanouar Date: Mon, 18 Feb 2019 17:00:27 +0100 Subject: Allow to set organization visibility (public, internal, private) (#1763) --- templates/admin/config.tmpl | 3 +++ templates/admin/org/list.tmpl | 7 ++++++- templates/admin/repo/list.tmpl | 7 ++++++- templates/explore/organizations.tmpl | 7 ++++++- templates/explore/repo_list.tmpl | 5 ++++- templates/org/create.tmpl | 22 ++++++++++++++++++++++ templates/org/settings/options.tmpl | 23 +++++++++++++++++++++++ templates/user/profile.tmpl | 6 ++++-- 8 files changed, 74 insertions(+), 6 deletions(-) (limited to 'templates') diff --git a/templates/admin/config.tmpl b/templates/admin/config.tmpl index 2d660117d5..becaca61e5 100644 --- a/templates/admin/config.tmpl +++ b/templates/admin/config.tmpl @@ -148,6 +148,9 @@
{{.i18n.Tr "admin.config.default_allow_only_contributors_to_track_time"}}
{{end}} +
{{.i18n.Tr "admin.config.default_visibility_organization"}}
+
{{.Service.DefaultOrgVisibility}}
+
{{.i18n.Tr "admin.config.no_reply_address"}}
{{if .Service.NoReplyAddress}}{{.Service.NoReplyAddress}}{{else}}-{{end}}
{{.i18n.Tr "admin.config.default_enable_dependencies"}}
diff --git a/templates/admin/org/list.tmpl b/templates/admin/org/list.tmpl index 141628c5b3..e9dbc7f877 100644 --- a/templates/admin/org/list.tmpl +++ b/templates/admin/org/list.tmpl @@ -29,7 +29,12 @@ {{range .Users}} {{.ID}} - {{.Name}} + + {{.Name}} + {{if .Visibility.IsPrivate}} + + {{end}} + {{.NumTeams}} {{.NumMembers}} {{.NumRepos}} diff --git a/templates/admin/repo/list.tmpl b/templates/admin/repo/list.tmpl index 5d78e8c84e..423de6a3d8 100644 --- a/templates/admin/repo/list.tmpl +++ b/templates/admin/repo/list.tmpl @@ -30,7 +30,12 @@ {{range .Repos}} {{.ID}} - {{.Owner.Name}} + + {{.Owner.Name}} + {{if .Owner.Visibility.IsPrivate}} + + {{end}} + {{.Name}} {{.NumWatches}} diff --git a/templates/explore/organizations.tmpl b/templates/explore/organizations.tmpl index b977da4e4d..4e2bfc9fd9 100644 --- a/templates/explore/organizations.tmpl +++ b/templates/explore/organizations.tmpl @@ -9,7 +9,12 @@
- {{.Name}} {{.FullName}} + + {{.Name}} {{.FullName}} + {{if .Visibility.IsPrivate}} + + {{end}} +
{{if .Location}} {{.Location}} diff --git a/templates/explore/repo_list.tmpl b/templates/explore/repo_list.tmpl index 660299157b..94ce293389 100644 --- a/templates/explore/repo_list.tmpl +++ b/templates/explore/repo_list.tmpl @@ -12,8 +12,11 @@ {{else if .IsMirror}} + {{else if .Owner}} + {{if .Owner.Visibility.IsPrivate}} + + {{end}} {{end}} -
{{.NumStars}} {{.NumForks}} diff --git a/templates/org/create.tmpl b/templates/org/create.tmpl index 765ef240e5..acf914c9d4 100644 --- a/templates/org/create.tmpl +++ b/templates/org/create.tmpl @@ -15,6 +15,28 @@ {{.i18n.Tr "org.org_name_helper"}}
+
+ +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ {{if .SignedUser.IsAdmin}}
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 5e6fbf4bb8..b3a500e9f6 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -61,10 +61,12 @@ */}} - {{if .Orgs}} + {{if and .Orgs .HasOrgsVisible}}
  • {{range .Orgs}} - + {{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.IsUserPartOfOrg $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}} + + {{end}} {{end}}
  • {{end}} -- cgit v1.2.3