aboutsummaryrefslogtreecommitdiffstats
path: root/templates/package/shared/list.tmpl
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-05-07 18:21:15 +0200
committerGitHub <noreply@github.com>2022-05-07 18:21:15 +0200
commit8adba93498ccdde7edcb54e10f6a3d176c3815c4 (patch)
treee48b5809a0a76ca8c2087d373d00a225b713ebb3 /templates/package/shared/list.tmpl
parent38d72d40f132df8a6e90063f3e96a80048bf299e (diff)
downloadgitea-8adba93498ccdde7edcb54e10f6a3d176c3815c4.tar.gz
gitea-8adba93498ccdde7edcb54e10f6a3d176c3815c4.zip
Hide private repositories in packages (#19584)
Diffstat (limited to 'templates/package/shared/list.tmpl')
-rw-r--r--templates/package/shared/list.tmpl4
1 files changed, 4 insertions, 0 deletions
diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl
index 0b0f71283b..9e6bf5ce9e 100644
--- a/templates/package/shared/list.tmpl
+++ b/templates/package/shared/list.tmpl
@@ -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}}