summaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/header.tmpl8
-rw-r--r--templates/repo/settings/options.tmpl13
2 files changed, 18 insertions, 3 deletions
diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl
index 624eb17a5e..57c665986a 100644
--- a/templates/repo/header.tmpl
+++ b/templates/repo/header.tmpl
@@ -178,9 +178,11 @@
</a>
{{end}}
- <a href="{{.RepoLink}}/packages" class="{{ if .IsPackagesPage }}active{{end}} item">
- {{svg "octicon-package"}} {{.i18n.Tr "packages.title"}}
- </a>
+ {{if .Permission.CanRead $.UnitTypePackages}}
+ <a href="{{.RepoLink}}/packages" class="{{ if .IsPackagesPage }}active{{end}} item">
+ {{svg "octicon-package"}} {{.i18n.Tr "packages.title"}}
+ </a>
+ {{end}}
{{ if and (not .UnitProjectsGlobalDisabled) (.Permission.CanRead $.UnitTypeProjects)}}
<a href="{{.RepoLink}}/projects" class="{{ if .IsProjectsPage }}active{{end}} item">
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 7695345010..77897f25cf 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -390,6 +390,19 @@
</div>
</div>
+ {{$isPackagesEnabled := .Repository.UnitEnabled $.UnitTypePackages}}
+ <div class="inline field">
+ <label>{{.i18n.Tr "repo.packages"}}</label>
+ {{if .UnitTypePackages.UnitGlobalDisabled}}
+ <div class="ui checkbox tooltip disabled" data-content="{{.i18n.Tr "repo.unit_disabled"}}">
+ {{else}}
+ <div class="ui checkbox">
+ {{end}}
+ <input class="enable-system" name="enable_packages" type="checkbox" {{if $isPackagesEnabled}}checked{{end}}>
+ <label>{{.i18n.Tr "repo.settings.packages_desc"}}</label>
+ </div>
+ </div>
+
{{if not .IsMirror}}
<div class="ui divider"></div>
{{$pullRequestEnabled := .Repository.UnitEnabled $.UnitTypePullRequests}}