1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00:00

Hide private repositories in packages (#19584)

This commit is contained in:
KN4CK3R
2022-05-07 18:21:15 +02:00
committed by GitHub
parent 38d72d40f1
commit 8adba93498
8 changed files with 115 additions and 20 deletions

View File

@ -30,7 +30,11 @@
</div>
<div class="desc issue-item-bottom-row df ac fw my-1">
{{$timeStr := TimeSinceUnix .Version.CreatedUnix $.i18n.Lang}}
{{$hasRepositoryAccess := false}}
{{if .Repository}}
{{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}}
{{end}}
{{if $hasRepositoryAccess}}
{{$.i18n.Tr "packages.published_by_in" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) .Repository.HTMLURL (.Repository.FullName | Escape) | Safe}}
{{else}}
{{$.i18n.Tr "packages.published_by" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}}