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

Repository level enable package or disable (#19323)

This commit is contained in:
Lunny Xiao
2022-05-08 23:51:50 +08:00
committed by GitHub
parent 6a969681cd
commit d4834071da
14 changed files with 65 additions and 4 deletions

View File

@ -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">

View File

@ -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}}