From e68b9d00a6e05b3a941f63ffb696f91e554ac5ec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.3. Signed-off-by: Daniel Baumann --- templates/package/shared/cargo.tmpl | 27 ++++++++ templates/package/shared/cleanup_rules/edit.tmpl | 73 ++++++++++++++++++++++ templates/package/shared/cleanup_rules/list.tmpl | 56 +++++++++++++++++ .../package/shared/cleanup_rules/preview.tmpl | 34 ++++++++++ templates/package/shared/list.tmpl | 57 +++++++++++++++++ templates/package/shared/versionlist.tmpl | 37 +++++++++++ 6 files changed, 284 insertions(+) create mode 100644 templates/package/shared/cargo.tmpl create mode 100644 templates/package/shared/cleanup_rules/edit.tmpl create mode 100644 templates/package/shared/cleanup_rules/list.tmpl create mode 100644 templates/package/shared/cleanup_rules/preview.tmpl create mode 100644 templates/package/shared/list.tmpl create mode 100644 templates/package/shared/versionlist.tmpl (limited to 'templates/package/shared') diff --git a/templates/package/shared/cargo.tmpl b/templates/package/shared/cargo.tmpl new file mode 100644 index 0000000..5b0f639 --- /dev/null +++ b/templates/package/shared/cargo.tmpl @@ -0,0 +1,27 @@ +

+ {{ctx.Locale.Tr "packages.owner.settings.cargo.title"}} +

+
+
+ {{if .CargoIndexExists}} +
+ +
+
+ {{.CsrfTokenHtml}} + +
+ {{else}} +
+ +
+
+ {{.CsrfTokenHtml}} + +
+ {{end}} +
+ +
+
+
diff --git a/templates/package/shared/cleanup_rules/edit.tmpl b/templates/package/shared/cleanup_rules/edit.tmpl new file mode 100644 index 0000000..138a907 --- /dev/null +++ b/templates/package/shared/cleanup_rules/edit.tmpl @@ -0,0 +1,73 @@ +

{{if .IsEditRule}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.edit"}}{{else}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.add"}}{{end}}

+
+
+ {{.CsrfTokenHtml}} + +
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+

{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.title"}}

+
+ + +
+
+ + +

{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern.container"}}

+
+
+

{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.title"}}

+
+ + +
+
+ + +
+
+ {{if .IsEditRule}} + + + {{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}} + {{else}} + + {{end}} +
+
+
diff --git a/templates/package/shared/cleanup_rules/list.tmpl b/templates/package/shared/cleanup_rules/list.tmpl new file mode 100644 index 0000000..ba1683b --- /dev/null +++ b/templates/package/shared/cleanup_rules/list.tmpl @@ -0,0 +1,56 @@ +

+ {{ctx.Locale.Tr "packages.owner.settings.cleanuprules.title"}} + +

+
+
+ {{range .CleanupRules}} +
+
+ {{svg .Type.SVGName 32}} +
+
+ +
+

{{if .Enabled}}{{ctx.Locale.Tr "enabled"}}{{else}}{{ctx.Locale.Tr "disabled"}}{{end}}

+
+ {{if .KeepCount}} +
+

{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:

{{if eq .KeepCount 1}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}{{else}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" .KeepCount}}{{end}} +
+ {{end}} + {{if .KeepPattern}} +
+

{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:

{{StringUtils.EllipsisString .KeepPattern 100}} +
+ {{end}} + {{if .RemoveDays}} +
+

{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:

{{ctx.Locale.Tr "tool.days" .RemoveDays}} +
+ {{end}} + {{if .RemovePattern}} +
+

{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:

{{StringUtils.EllipsisString .RemovePattern 100}} +
+ {{end}} +
+ +
+ {{else}} +
{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.none"}}
+ {{end}} +
+
diff --git a/templates/package/shared/cleanup_rules/preview.tmpl b/templates/package/shared/cleanup_rules/preview.tmpl new file mode 100644 index 0000000..0d9c4b0 --- /dev/null +++ b/templates/package/shared/cleanup_rules/preview.tmpl @@ -0,0 +1,34 @@ +

{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}}

+
+

{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview.overview" (len .VersionsToRemove)}}

+
+
+ + + + + + + + + + + + + {{range .VersionsToRemove}} + + + + + + + + + {{else}} + + + + {{end}} + +
{{ctx.Locale.Tr "admin.packages.type"}}{{ctx.Locale.Tr "admin.packages.name"}}{{ctx.Locale.Tr "admin.packages.version"}}{{ctx.Locale.Tr "admin.packages.creator"}}{{ctx.Locale.Tr "admin.packages.size"}}{{ctx.Locale.Tr "admin.packages.published"}}
{{.Package.Type.Name}}{{.Package.Name}}{{.Version.Version}}{{.Creator.Name}}{{ctx.Locale.TrSize .CalculateBlobSize}}{{DateTime "short" .Version.CreatedUnix}}
{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview.none"}}
+
diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl new file mode 100644 index 0000000..36f8bc1 --- /dev/null +++ b/templates/package/shared/list.tmpl @@ -0,0 +1,57 @@ +{{template "base/alert" .}} +{{if .HasPackages}} +
+
+ {{template "shared/search/input" dict "Value" .Query "Placeholder" (ctx.Locale.Tr "search.package_kind")}} + + {{template "shared/search/button"}} +
+
+{{end}} +
+ {{range .PackageDescriptors}} +
+
+
+
+ {{.Package.Name}} + {{svg .Package.Type.SVGName 16}} {{.Package.Type.Name}} +
+
+ {{$timeStr := TimeSinceUnix .Version.CreatedUnix ctx.Locale}} + {{$hasRepositoryAccess := false}} + {{if .Repository}} + {{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}} + {{end}} + {{if $hasRepositoryAccess}} + {{ctx.Locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink .Creator.GetDisplayName .Repository.Link .Repository.FullName}} + {{else}} + {{ctx.Locale.Tr "packages.published_by" $timeStr .Creator.HomeLink .Creator.GetDisplayName}} + {{end}} +
+
+
+
+ {{else}} + {{if not .HasPackages}} +
+ {{svg "octicon-package" 48}} +

{{ctx.Locale.Tr "packages.empty"}}

+ {{if and .Repository .CanWritePackages}} + {{$packagesUrl := URLJoin .Owner.HomeLink "-" "packages"}} +

{{ctx.Locale.Tr "packages.empty.repo" $packagesUrl}}

+ {{end}} +

{{ctx.Locale.Tr "packages.empty.documentation" "https://forgejo.org/docs/latest/user/packages/"}}

+
+ {{else}} +

{{ctx.Locale.Tr "packages.filter.no_result"}}

+ {{end}} + {{end}} + {{template "base/paginate" .}} +
diff --git a/templates/package/shared/versionlist.tmpl b/templates/package/shared/versionlist.tmpl new file mode 100644 index 0000000..e5c568e --- /dev/null +++ b/templates/package/shared/versionlist.tmpl @@ -0,0 +1,37 @@ +

{{.PackageDescriptor.Package.Name}} / {{ctx.Locale.Tr "packages.versions"}}

+
+
+ {{template "shared/search/input" dict "Value" .Query "Placeholder" (ctx.Locale.Tr "search.package_kind")}} + + {{if eq .PackageDescriptor.Package.Type "container"}} + + {{end}} + {{template "shared/search/button"}} +
+
+
+ {{range .PackageDescriptors}} +
+
+
+ {{.Version.LowerVersion}} +
+ {{ctx.Locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix ctx.Locale) .Creator.HomeLink .Creator.GetDisplayName}} +
+
+
+
+ {{else}} +

{{ctx.Locale.Tr "packages.filter.no_result"}}

+ {{end}} + {{template "base/paginate" .}} +
-- cgit v1.2.3