Move package settings to package instead of being tied to version (#37026)
Unties settings page from package version and adds button to delete the package version Settings page now allows for deletion of entire package and it's versions as opposed to a single version Adds an API endpoint to delete the entire package with all versions from registry fixes: https://github.com/go-gitea/gitea/issues/36904 Co-Authored-By: gemini-3-flash --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
@@ -89,7 +89,7 @@
|
||||
</div>
|
||||
|
||||
<form class="ui small modal form-fetch-action" method="post" id="admin-package-delete-modal">
|
||||
<div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "packages.settings.delete"}}</div>
|
||||
<div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "packages.settings.delete.version"}}</div>
|
||||
<div class="content">
|
||||
{{ctx.Locale.Tr "packages.settings.delete.notice" (HTMLFormat `<span class="%s"></span>` "package-name") (HTMLFormat `<span class="%s"></span>` "package-version")}}
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{{template "user/overview/header" .}}
|
||||
{{end}}
|
||||
{{template "base/alert" .}}
|
||||
<p><a href="{{.PackageDescriptor.VersionWebLink}}">{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</a> / <strong>{{ctx.Locale.Tr "repo.settings"}}</strong></p>
|
||||
<p><a href="{{.PackageDescriptor.PackageWebLink}}">{{.PackageDescriptor.Package.Name}}</a> / <strong>{{ctx.Locale.Tr "repo.settings"}}</strong></p>
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "packages.settings.link"}}
|
||||
</h4>
|
||||
@@ -45,10 +45,20 @@
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="ui warning message tw-break-anywhere">
|
||||
{{ctx.Locale.Tr "packages.settings.delete.notice" .PackageDescriptor.Package.Name .PackageDescriptor.Version.Version}}
|
||||
{{ctx.Locale.Tr "packages.settings.delete.notice.package" .PackageDescriptor.Package.Name}}
|
||||
</div>
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<div class="field">
|
||||
<label>
|
||||
{{ctx.Locale.Tr "packages.settings.delete.confirm"}}
|
||||
<span class="tw-text-red">{{.PackageDescriptor.Package.Name}}</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="required field">
|
||||
<label>{{ctx.Locale.Tr "packages.name"}}</label>
|
||||
<input name="package_name" required maxlength="100">
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -99,7 +99,24 @@
|
||||
<div class="item">{{svg "octicon-issue-opened"}} <a href="{{.PackageDescriptor.Repository.Link}}/issues">{{ctx.Locale.Tr "repo.issues"}}</a></div>
|
||||
{{end}}
|
||||
{{if .CanWritePackages}}
|
||||
<div class="item">{{svg "octicon-tools"}} <a href="{{$packageVersionLink}}/settings">{{ctx.Locale.Tr "repo.settings"}}</a></div>
|
||||
<div class="item">{{svg "octicon-tools"}} <a href="{{.PackageDescriptor.PackageSettingsLink}}">{{ctx.Locale.Tr "repo.settings"}}</a></div>
|
||||
<div class="item">
|
||||
{{svg "octicon-trash"}}
|
||||
<a class="show-modal" href data-modal="#delete-package-version-modal">{{ctx.Locale.Tr "packages.settings.delete.version"}}</a>
|
||||
<div class="ui tiny modal" id="delete-package-version-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "packages.settings.delete.version"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="ui warning message tw-break-anywhere">
|
||||
{{ctx.Locale.Tr "packages.settings.delete.notice" .PackageDescriptor.Package.Name .PackageDescriptor.Version.Version}}
|
||||
</div>
|
||||
<form class="ui form" action="{{$packageVersionLink}}" method="post">
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
Generated
+40
-2
@@ -3912,6 +3912,44 @@
|
||||
"$ref": "#/responses/notFound"
|
||||
}
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"tags": [
|
||||
"package"
|
||||
],
|
||||
"summary": "Delete a package",
|
||||
"operationId": "deletePackage",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "owner of the package",
|
||||
"name": "owner",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "type of the package",
|
||||
"name": "type",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"description": "name of the package",
|
||||
"name": "name",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"204": {
|
||||
"$ref": "#/responses/empty"
|
||||
},
|
||||
"404": {
|
||||
"$ref": "#/responses/notFound"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/packages/{owner}/{type}/{name}/-/latest": {
|
||||
@@ -4097,8 +4135,8 @@
|
||||
"tags": [
|
||||
"package"
|
||||
],
|
||||
"summary": "Delete a package",
|
||||
"operationId": "deletePackage",
|
||||
"summary": "Delete a package version",
|
||||
"operationId": "deletePackageVersion",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
|
||||
Reference in New Issue
Block a user