mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-22 14:08:01 +02:00
Allow to set organization visibility (public, internal, private) (#1763)
This commit is contained in:

committed by
Lauris BH

parent
ae3a913122
commit
64ce159a6e
@ -148,6 +148,9 @@
|
||||
<dt>{{.i18n.Tr "admin.config.default_allow_only_contributors_to_track_time"}}</dt>
|
||||
<dd><i class="fa fa{{if .Service.DefaultAllowOnlyContributorsToTrackTime}}-check{{end}}-square-o"></i></dd>
|
||||
{{end}}
|
||||
<dt>{{.i18n.Tr "admin.config.default_visibility_organization"}}</dt>
|
||||
<dd>{{.Service.DefaultOrgVisibility}}</dd>
|
||||
|
||||
<dt>{{.i18n.Tr "admin.config.no_reply_address"}}</dt>
|
||||
<dd>{{if .Service.NoReplyAddress}}{{.Service.NoReplyAddress}}{{else}}-{{end}}</dd>
|
||||
<dt>{{.i18n.Tr "admin.config.default_enable_dependencies"}}</dt>
|
||||
|
@ -29,7 +29,12 @@
|
||||
{{range .Users}}
|
||||
<tr>
|
||||
<td>{{.ID}}</td>
|
||||
<td><a href="{{.HomeLink}}">{{.Name}}</a></td>
|
||||
<td>
|
||||
<a href="{{.HomeLink}}">{{.Name}}</a>
|
||||
{{if .Visibility.IsPrivate}}
|
||||
<span class="text gold"><i class="octicon octicon-lock"></i></span>
|
||||
{{end}}
|
||||
</td>
|
||||
<td>{{.NumTeams}}</td>
|
||||
<td>{{.NumMembers}}</td>
|
||||
<td>{{.NumRepos}}</td>
|
||||
|
@ -30,7 +30,12 @@
|
||||
{{range .Repos}}
|
||||
<tr>
|
||||
<td>{{.ID}}</td>
|
||||
<td><a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a></td>
|
||||
<td>
|
||||
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
|
||||
{{if .Owner.Visibility.IsPrivate}}
|
||||
<span class="text gold"><i class="octicon octicon-lock"></i></span>
|
||||
{{end}}
|
||||
</td>
|
||||
<td><a href="{{AppSubUrl}}/{{.Owner.Name}}/{{.Name}}">{{.Name}}</a></td>
|
||||
<td><i class="fa fa{{if .IsPrivate}}-check{{end}}-square-o"></i></td>
|
||||
<td>{{.NumWatches}}</td>
|
||||
|
@ -9,7 +9,12 @@
|
||||
<div class="item">
|
||||
<img class="ui avatar image" src="{{.RelAvatarLink}}">
|
||||
<div class="content">
|
||||
<span class="header"><a href="{{.HomeLink}}">{{.Name}}</a> {{.FullName}}</span>
|
||||
<span class="header">
|
||||
<a href="{{.HomeLink}}">{{.Name}}</a> {{.FullName}}
|
||||
{{if .Visibility.IsPrivate}}
|
||||
<span class="text gold"><i class="octicon octicon-lock"></i></span>
|
||||
{{end}}
|
||||
</span>
|
||||
<div class="description">
|
||||
{{if .Location}}
|
||||
<i class="octicon octicon-location"></i> {{.Location}}
|
||||
|
@ -12,8 +12,11 @@
|
||||
<span><i class="octicon octicon-repo-forked"></i></span>
|
||||
{{else if .IsMirror}}
|
||||
<span><i class="octicon octicon-repo-clone"></i></span>
|
||||
{{else if .Owner}}
|
||||
{{if .Owner.Visibility.IsPrivate}}
|
||||
<span class="text gold"><i class="octicon octicon-lock"></i></span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
<div class="ui right metas">
|
||||
<span class="text grey"><i class="octicon octicon-star"></i> {{.NumStars}}</span>
|
||||
<span class="text grey"><i class="octicon octicon-git-branch"></i> {{.NumForks}}</span>
|
||||
|
@ -15,6 +15,28 @@
|
||||
<span class="help">{{.i18n.Tr "org.org_name_helper"}}</span>
|
||||
</div>
|
||||
|
||||
<div class="inline required field {{if .Err_OrgVisibility}}error{{end}}">
|
||||
<label for="visibility">{{.i18n.Tr "org.settings.visibility"}}</label>
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox">
|
||||
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="0" {{if .DefaultOrgVisibilityMode.IsPublic}}checked{{end}}/>
|
||||
<label>{{.i18n.Tr "org.settings.visibility.public"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox">
|
||||
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="1" {{if .DefaultOrgVisibilityMode.IsLimited}}checked{{end}}/>
|
||||
<label>{{.i18n.Tr "org.settings.visibility.limited"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox">
|
||||
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="2" {{if .DefaultOrgVisibilityMode.IsPrivate}}checked{{end}}/>
|
||||
<label>{{.i18n.Tr "org.settings.visibility.private"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inline field">
|
||||
<label></label>
|
||||
<button class="ui green button">
|
||||
|
@ -33,6 +33,29 @@
|
||||
<input id="location" name="location" value="{{.Org.Location}}">
|
||||
</div>
|
||||
|
||||
<div class="ui divider"></div>
|
||||
<div class="field" id="visibility_box">
|
||||
<label for="visibility">{{.i18n.Tr "org.settings.visibility"}}</label>
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox">
|
||||
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="0" {{if eq .CurrentVisibility 0}}checked{{end}}/>
|
||||
<label>{{.i18n.Tr "org.settings.visibility.public"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox">
|
||||
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="1" {{if eq .CurrentVisibility 1}}checked{{end}}/>
|
||||
<label>{{.i18n.Tr "org.settings.visibility.limited"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui radio checkbox">
|
||||
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="2" {{if eq .CurrentVisibility 2}}checked{{end}}/>
|
||||
<label>{{.i18n.Tr "org.settings.visibility.private"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if .SignedUser.IsAdmin}}
|
||||
<div class="ui divider"></div>
|
||||
|
||||
|
@ -61,10 +61,12 @@
|
||||
</a>
|
||||
</li>
|
||||
*/}}
|
||||
{{if .Orgs}}
|
||||
{{if and .Orgs .HasOrgsVisible}}
|
||||
<li>
|
||||
{{range .Orgs}}
|
||||
<a href="{{.HomeLink}}"><img class="ui mini image poping up" src="{{.RelAvatarLink}}" data-content="{{.Name}}" data-position="top center" data-variation="tiny inverted"></a>
|
||||
{{if (or .Visibility.IsPublic (and ($.SignedUser) (or .Visibility.IsLimited (and (.IsUserPartOfOrg $.SignedUserID) .Visibility.IsPrivate) ($.IsAdmin))))}}
|
||||
<a href="{{.HomeLink}}"><img class="ui mini image poping up" src="{{.RelAvatarLink}}" data-content="{{.Name}}" data-position="top center" data-variation="tiny inverted"></a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
|
Reference in New Issue
Block a user