-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add descriptions for private repo public access settings and improve the UI #34057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wxiaoguang
merged 8 commits into
go-gitea:main
from
yp05327:add-descriptions-for-private-repo-public-access-settings
Mar 29, 2025
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0ec626e
add
yp05327 8a76146
improve
yp05327 170b796
add description to not set
yp05327 56e4e41
follow the suggestion
yp05327 4d48f0b
improve
yp05327 2fccb6c
fine tune
wxiaoguang 54babc7
fine tune table
wxiaoguang 31db054
Update options/locale/locale_en-US.ini
wxiaoguang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,50 @@ | ||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings")}} | ||
<div class="repo-setting-content"> | ||
{{$paNotSet := "not-set"}} | ||
{{$paAnonymousRead := "anonymous-read"}} | ||
{{$paEveryoneRead := "everyone-read"}} | ||
{{$paEveryoneWrite := "everyone-write"}} | ||
<form class="ui form" method="post"> | ||
{{.CsrfTokenHtml}} | ||
<table class="ui table unstackable tw-my-2"> | ||
<tr> | ||
<th></th> | ||
<th>{{ctx.Locale.Tr "settings.permission_not_set"}}</th> | ||
<th>{{ctx.Locale.Tr "settings.permission_anonymous_read"}}</th> | ||
<th>{{ctx.Locale.Tr "settings.permission_everyone_read"}}</th> | ||
<th>{{ctx.Locale.Tr "settings.permission_everyone_write"}}</th> | ||
</tr> | ||
{{range $ua := .RepoUnitPublicAccesses}} | ||
<h4 class="ui top attached header"> | ||
{{ctx.Locale.Tr "repo.settings.public_access"}} | ||
</h4> | ||
<div class="ui attached segment"> | ||
<p> | ||
{{ctx.Locale.Tr "repo.settings.public_access_desc"}} | ||
</p> | ||
{{$paNotSet := "not-set"}} | ||
{{$paAnonymousRead := "anonymous-read"}} | ||
{{$paEveryoneRead := "everyone-read"}} | ||
{{$paEveryoneWrite := "everyone-write"}} | ||
<form class="ui form" method="post"> | ||
{{.CsrfTokenHtml}} | ||
<table class="ui table unstackable tw-my-2"> | ||
<tr> | ||
<td>{{$ua.DisplayName}}</td> | ||
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paNotSet}}" {{Iif (eq $paNotSet $ua.UnitPublicAccess) "checked"}}></label></td> | ||
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paAnonymousRead}}" {{Iif (eq $paAnonymousRead $ua.UnitPublicAccess) "checked"}}></label></td> | ||
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneRead}}" {{Iif (eq $paEveryoneRead $ua.UnitPublicAccess) "checked"}}></label></td> | ||
<td class="tw-text-center"> | ||
{{if SliceUtils.Contains $ua.PublicAccessTypes $paEveryoneWrite}} | ||
<label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneWrite}}" {{Iif (eq $paEveryoneWrite $ua.UnitPublicAccess) "checked"}}></label> | ||
{{else}} | ||
- | ||
{{end}} | ||
</td> | ||
<th></th> | ||
<th>{{ctx.Locale.Tr "settings.permission_not_set"}}</th> | ||
<th>{{ctx.Locale.Tr "settings.permission_anonymous_read"}}</th> | ||
<th>{{ctx.Locale.Tr "settings.permission_everyone_read"}}</th> | ||
<th>{{ctx.Locale.Tr "settings.permission_everyone_write"}}</th> | ||
</tr> | ||
{{end}} | ||
</table> | ||
<button class="ui primary button {{if .GlobalForcePrivate}}disabled{{end}}">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> | ||
</form> | ||
{{range $ua := .RepoUnitPublicAccesses}} | ||
<tr> | ||
<td>{{$ua.DisplayName}}</td> | ||
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paNotSet}}" {{Iif (eq $paNotSet $ua.UnitPublicAccess) "checked"}}></label></td> | ||
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paAnonymousRead}}" {{Iif (eq $paAnonymousRead $ua.UnitPublicAccess) "checked"}}></label></td> | ||
<td class="tw-text-center"><label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneRead}}" {{Iif (eq $paEveryoneRead $ua.UnitPublicAccess) "checked"}}></label></td> | ||
<td class="tw-text-center"> | ||
{{if SliceUtils.Contains $ua.PublicAccessTypes $paEveryoneWrite}} | ||
<label><input type="radio" name="{{$ua.FormKey}}" value="{{$paEveryoneWrite}}" {{Iif (eq $paEveryoneWrite $ua.UnitPublicAccess) "checked"}}></label> | ||
{{else}} | ||
- | ||
{{end}} | ||
</td> | ||
</tr> | ||
{{end}} | ||
</table> | ||
<div class="ui tw-my-2"> | ||
{{ctx.Locale.Tr "repo.settings.public_access.docs.not_set"}}<br> | ||
{{ctx.Locale.Tr "repo.settings.public_access.docs.anonymous_read"}}<br> | ||
{{ctx.Locale.Tr "repo.settings.public_access.docs.everyone_read"}}<br> | ||
{{ctx.Locale.Tr "repo.settings.public_access.docs.everyone_write"}}<br> | ||
</div> | ||
<button class="ui primary button {{if .GlobalForcePrivate}}disabled{{end}}">{{ctx.Locale.Tr "repo.settings.update_settings"}}</button> | ||
</form> | ||
</div> | ||
</div> | ||
{{template "repo/settings/layout_footer" .}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.