Skip to content

Commit 8a1770a

Browse files
committed
improve
1 parent 0ec626e commit 8a1770a

File tree

2 files changed

+42
-33
lines changed

2 files changed

+42
-33
lines changed

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,6 +2141,7 @@ settings = Settings
21412141
settings.desc = Settings is where you can manage the settings for the repository
21422142
settings.options = Repository
21432143
settings.public_access = Public Access
2144+
settings.public_access_desc = Set the access permission for the units in the private/unlisted repository
21442145
settings.collaboration = Collaborators
21452146
settings.collaboration.admin = Administrator
21462147
settings.collaboration.write = Write
Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
11
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}}
22
<div class="repo-setting-content">
3-
{{$paNotSet := "not-set"}}
4-
{{$paAnonymousRead := "anonymous-read"}}
5-
{{$paEveryoneRead := "everyone-read"}}
6-
{{$paEveryoneWrite := "everyone-write"}}
7-
<form class="ui form" method="post">
8-
{{.CsrfTokenHtml}}
9-
<table class="ui table unstackable tw-my-2">
10-
<tr>
11-
<th></th>
12-
<th>{{ctx.Locale.Tr "settings.permission_not_set"}}</th>
13-
<th>{{ctx.Locale.Tr "settings.permission_anonymous_read"}}
14-
<span class="tw-align-middle" data-tooltip-content="{{ctx.Locale.Tr "settings.permission_anonymous_read_helper"}}">{{svg "octicon-question" 16 "tw-ml-1"}}</span></th>
15-
<th>{{ctx.Locale.Tr "settings.permission_everyone_read"}}
16-
<span class="tw-align-middle" data-tooltip-content="{{ctx.Locale.Tr "settings.permission_everyone_read_helper"}}">{{svg "octicon-question" 16 "tw-ml-1"}}</span></th>
17-
<th>{{ctx.Locale.Tr "settings.permission_everyone_write"}}
18-
<span class="tw-align-middle" data-tooltip-content="{{ctx.Locale.Tr "settings.permission_everyone_write_helper"}}">{{svg "octicon-question" 16 "tw-ml-1"}}</span></th>
19-
</tr>
20-
{{range $ua := .RepoUnitPublicAccesses}}
3+
<h4 class="ui top attached header">
4+
{{ctx.Locale.Tr "repo.settings.public_access"}}
5+
</h4>
6+
<div class="ui attached segment">
7+
<p>
8+
{{ctx.Locale.Tr "repo.settings.public_access_desc"}}
9+
</p>
10+
{{$paNotSet := "not-set"}}
11+
{{$paAnonymousRead := "anonymous-read"}}
12+
{{$paEveryoneRead := "everyone-read"}}
13+
{{$paEveryoneWrite := "everyone-write"}}
14+
<form class="ui form" method="post">
15+
{{.CsrfTokenHtml}}
16+
<table class="ui table unstackable tw-my-2">
2117
<tr>
22-
<td>{{$ua.DisplayName}}</td>
23-
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paNotSet}}" {{Iif (eq $paNotSet $ua.UnitPublicAccess) "checked"}}></label></td>
24-
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paAnonymousRead}}" {{Iif (eq $paAnonymousRead $ua.UnitPublicAccess) "checked"}}></label></td>
25-
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneRead}}" {{Iif (eq $paEveryoneRead $ua.UnitPublicAccess) "checked"}}></label></td>
26-
<td class="tw-text-center">
27-
{{if SliceUtils.Contains $ua.PublicAccessTypes $paEveryoneWrite}}
28-
<label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneWrite}}" {{Iif (eq $paEveryoneWrite $ua.UnitPublicAccess) "checked"}}></label>
29-
{{else}}
30-
-
31-
{{end}}
32-
</td>
18+
<th></th>
19+
<th>{{ctx.Locale.Tr "settings.permission_not_set"}}</th>
20+
<th>{{ctx.Locale.Tr "settings.permission_anonymous_read"}}
21+
<span class="tw-align-middle" data-tooltip-content="{{ctx.Locale.Tr "settings.permission_anonymous_read_helper"}}">{{svg "octicon-question" 16 "tw-ml-1"}}</span></th>
22+
<th>{{ctx.Locale.Tr "settings.permission_everyone_read"}}
23+
<span class="tw-align-middle" data-tooltip-content="{{ctx.Locale.Tr "settings.permission_everyone_read_helper"}}">{{svg "octicon-question" 16 "tw-ml-1"}}</span></th>
24+
<th>{{ctx.Locale.Tr "settings.permission_everyone_write"}}
25+
<span class="tw-align-middle" data-tooltip-content="{{ctx.Locale.Tr "settings.permission_everyone_write_helper"}}">{{svg "octicon-question" 16 "tw-ml-1"}}</span></th>
3326
</tr>
34-
{{end}}
35-
</table>
36-
<button class="ui primary button {{if .GlobalForcePrivate}}disabled{{end}}">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
37-
</form>
27+
{{range $ua := .RepoUnitPublicAccesses}}
28+
<tr>
29+
<td>{{$ua.DisplayName}}</td>
30+
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paNotSet}}" {{Iif (eq $paNotSet $ua.UnitPublicAccess) "checked"}}></label></td>
31+
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paAnonymousRead}}" {{Iif (eq $paAnonymousRead $ua.UnitPublicAccess) "checked"}}></label></td>
32+
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneRead}}" {{Iif (eq $paEveryoneRead $ua.UnitPublicAccess) "checked"}}></label></td>
33+
<td class="tw-text-center">
34+
{{if SliceUtils.Contains $ua.PublicAccessTypes $paEveryoneWrite}}
35+
<label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneWrite}}" {{Iif (eq $paEveryoneWrite $ua.UnitPublicAccess) "checked"}}></label>
36+
{{else}}
37+
-
38+
{{end}}
39+
</td>
40+
</tr>
41+
{{end}}
42+
</table>
43+
<button class="ui primary button {{if .GlobalForcePrivate}}disabled{{end}}">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button>
44+
</form>
45+
</div>
3846
</div>
3947
{{template "repo/settings/layout_footer" .}}

0 commit comments

Comments
 (0)