|
1 | 1 | {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}}
|
2 | 2 | <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"}}</th> |
14 |
| - <th>{{ctx.Locale.Tr "settings.permission_everyone_read"}}</th> |
15 |
| - <th>{{ctx.Locale.Tr "settings.permission_everyone_write"}}</th> |
16 |
| - </tr> |
17 |
| - {{range $ua := .RepoUnitPublicAccesses}} |
18 |
| - <tr> |
19 |
| - <td>{{$ua.DisplayName}}</td> |
20 |
| - <td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paNotSet}}" {{Iif (eq $paNotSet $ua.UnitPublicAccess) "checked"}}></label></td> |
21 |
| - <td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paAnonymousRead}}" {{Iif (eq $paAnonymousRead $ua.UnitPublicAccess) "checked"}}></label></td> |
22 |
| - <td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneRead}}" {{Iif (eq $paEveryoneRead $ua.UnitPublicAccess) "checked"}}></label></td> |
23 |
| - <td class="tw-text-center"> |
24 |
| - {{if SliceUtils.Contains $ua.PublicAccessTypes $paEveryoneWrite}} |
25 |
| - <label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneWrite}}" {{Iif (eq $paEveryoneWrite $ua.UnitPublicAccess) "checked"}}></label> |
26 |
| - {{else}} |
27 |
| - - |
28 |
| - {{end}} |
29 |
| - </td> |
30 |
| - </tr> |
31 |
| - {{end}} |
32 |
| - </table> |
33 |
| - <button class="ui primary button {{if .GlobalForcePrivate}}disabled{{end}}">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> |
34 |
| - </form> |
| 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"> |
| 17 | + <thead> |
| 18 | + <tr> |
| 19 | + <th>{{ctx.Locale.Tr "units.unit"}}</th> |
| 20 | + <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_not_set"}}</th> |
| 21 | + <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_anonymous_read"}}</th> |
| 22 | + <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_everyone_read"}}</th> |
| 23 | + <th class="tw-text-center">{{ctx.Locale.Tr "settings.permission_everyone_write"}}</th> |
| 24 | + </tr> |
| 25 | + </thead> |
| 26 | + <tbody> |
| 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 | + </tbody> |
| 43 | + </table> |
| 44 | + <ul class="tw-my-3 tw-pl-5 tw-flex tw-flex-col tw-gap-3"> |
| 45 | + <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.not_set"}}</li> |
| 46 | + <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.anonymous_read"}}</li> |
| 47 | + <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.everyone_read"}}</li> |
| 48 | + <li>{{ctx.Locale.Tr "repo.settings.public_access.docs.everyone_write"}}</li> |
| 49 | + </ul> |
| 50 | + <button class="ui primary button {{if .GlobalForcePrivate}}disabled{{end}}">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> |
| 51 | + </form> |
| 52 | + </div> |
35 | 53 | </div>
|
36 | 54 | {{template "repo/settings/layout_footer" .}}
|
0 commit comments