diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-05-07 18:21:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-07 18:21:15 +0200 |
commit | 8adba93498ccdde7edcb54e10f6a3d176c3815c4 (patch) | |
tree | e48b5809a0a76ca8c2087d373d00a225b713ebb3 /templates/package/shared/list.tmpl | |
parent | 38d72d40f132df8a6e90063f3e96a80048bf299e (diff) | |
download | gitea-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.tmpl | 4 |
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}} |