diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-04-19 18:55:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-19 12:55:35 -0400 |
commit | 18727df73a00e7d05d3e1a68d6dae521cca7ff49 (patch) | |
tree | de06d623e932c8aef1720ac3399d3a7bc658e802 /templates | |
parent | b74322dfce8d15e9204900913bb815a7b0ba073f (diff) | |
download | gitea-18727df73a00e7d05d3e1a68d6dae521cca7ff49.tar.gz gitea-18727df73a00e7d05d3e1a68d6dae521cca7ff49.zip |
Add Helm Chart registry (#19406)
Diffstat (limited to 'templates')
-rw-r--r-- | templates/admin/packages/list.tmpl | 1 | ||||
-rw-r--r-- | templates/package/content/helm.tmpl | 57 | ||||
-rw-r--r-- | templates/package/content/npm.tmpl | 2 | ||||
-rw-r--r-- | templates/package/metadata/helm.tmpl | 4 | ||||
-rw-r--r-- | templates/package/shared/list.tmpl | 1 | ||||
-rw-r--r-- | templates/package/view.tmpl | 10 | ||||
-rw-r--r-- | templates/swagger/v1_json.tmpl | 2 |
7 files changed, 72 insertions, 5 deletions
diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl index 114a108feb..373a97407b 100644 --- a/templates/admin/packages/list.tmpl +++ b/templates/admin/packages/list.tmpl @@ -17,6 +17,7 @@ <option value="conan" {{if eq .PackageType "conan"}}selected="selected"{{end}}>Conan</option> <option value="container" {{if eq .PackageType "container"}}selected="selected"{{end}}>Container</option> <option value="generic" {{if eq .PackageType "generic"}}selected="selected"{{end}}>Generic</option> + <option value="helm" {{if eq .PackageType "helm"}}selected="selected"{{end}}>Helm</option> <option value="maven" {{if eq .PackageType "maven"}}selected="selected"{{end}}>Maven</option> <option value="npm" {{if eq .PackageType "npm"}}selected="selected"{{end}}>npm</option> <option value="nuget" {{if eq .PackageType "nuget"}}selected="selected"{{end}}>NuGet</option> diff --git a/templates/package/content/helm.tmpl b/templates/package/content/helm.tmpl new file mode 100644 index 0000000000..a85f7c4850 --- /dev/null +++ b/templates/package/content/helm.tmpl @@ -0,0 +1,57 @@ +{{if eq .PackageDescriptor.Package.Type "helm"}} + <h4 class="ui top attached header">{{.i18n.Tr "packages.installation"}}</h4> + <div class="ui attached segment"> + <div class="ui form"> + <div class="field"> + <label>{{svg "octicon-terminal"}} {{.i18n.Tr "packages.helm.registry"}}</label> + <div class="markup"><pre class="code-block"><code>helm repo add gitea {{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/helm +helm repo update</code></pre></div> + </div> + <div class="field"> + <label>{{svg "octicon-terminal"}} {{.i18n.Tr "packages.helm.install"}}</label> + <div class="markup"><pre class="code-block"><code>helm install {{.PackageDescriptor.Package.Name}} gitea/{{.PackageDescriptor.Package.Name}}</code></pre></div> + </div> + <div class="field"> + <label>{{.i18n.Tr "packages.helm.documentation" | Safe}}</label> + </div> + </div> + </div> + + {{if .PackageDescriptor.Metadata.Description}} + <h4 class="ui top attached header">{{.i18n.Tr "packages.about"}}</h4> + <div class="ui attached segment"> + {{.PackageDescriptor.Metadata.Description}} + </div> + {{end}} + + {{if .PackageDescriptor.Metadata.Dependencies}} + <h4 class="ui top attached header">{{.i18n.Tr "packages.dependencies"}}</h4> + <div class="ui attached segment"> + <table class="ui single line very basic table"> + <thead> + <tr> + <th class="ten wide">{{.i18n.Tr "packages.dependency.id"}}</th> + <th class="six wide">{{.i18n.Tr "packages.dependency.version"}}</th> + </tr> + </thead> + <tbody> + {{range .PackageDescriptor.Metadata.Dependencies}} + <tr> + <td>{{.Name}}</td> + <td>{{.Version}}</td> + </tr> + {{end}} + </tbody> + </table> + </div> + {{end}} + + {{if .PackageDescriptor.Metadata.Keywords}} + <h4 class="ui top attached header">{{.i18n.Tr "packages.keywords"}}</h4> + <div class="ui attached segment"> + {{range .PackageDescriptor.Metadata.Keywords}} + {{.}} + {{end}} + </div> + {{end}} +{{end}} diff --git a/templates/package/content/npm.tmpl b/templates/package/content/npm.tmpl index 16347d1b6e..bc714e5c97 100644 --- a/templates/package/content/npm.tmpl +++ b/templates/package/content/npm.tmpl @@ -45,7 +45,7 @@ </div> {{end}} - {{if or .PackageDescriptor.Metadata.Keywords}} + {{if .PackageDescriptor.Metadata.Keywords}} <h4 class="ui top attached header">{{.i18n.Tr "packages.keywords"}}</h4> <div class="ui attached segment"> {{range .PackageDescriptor.Metadata.Keywords}} diff --git a/templates/package/metadata/helm.tmpl b/templates/package/metadata/helm.tmpl new file mode 100644 index 0000000000..7c97c6358e --- /dev/null +++ b/templates/package/metadata/helm.tmpl @@ -0,0 +1,4 @@ +{{if eq .PackageDescriptor.Package.Type "helm"}} + {{range .PackageDescriptor.Metadata.Maintainers}}<div class="item" title="{{$.i18n.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.Name}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Home}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.Home}}" target="_blank" rel="noopener noreferrer me">{{.i18n.Tr "packages.details.project_site"}}</a></div>{{end}} +{{end}} diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl index 9216e6b9de..0b0f71283b 100644 --- a/templates/package/shared/list.tmpl +++ b/templates/package/shared/list.tmpl @@ -10,6 +10,7 @@ <option value="conan" {{if eq .PackageType "conan"}}selected="selected"{{end}}>Conan</option> <option value="container" {{if eq .PackageType "container"}}selected="selected"{{end}}>Container</option> <option value="generic" {{if eq .PackageType "generic"}}selected="selected"{{end}}>Generic</option> + <option value="helm" {{if eq .PackageType "helm"}}selected="selected"{{end}}>Helm</option> <option value="maven" {{if eq .PackageType "maven"}}selected="selected"{{end}}>Maven</option> <option value="npm" {{if eq .PackageType "npm"}}selected="selected"{{end}}>npm</option> <option value="nuget" {{if eq .PackageType "nuget"}}selected="selected"{{end}}>NuGet</option> diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl index 1b1c5d50c6..bb96da3410 100644 --- a/templates/package/view.tmpl +++ b/templates/package/view.tmpl @@ -23,9 +23,10 @@ {{template "package/content/conan" .}} {{template "package/content/container" .}} {{template "package/content/generic" .}} - {{template "package/content/nuget" .}} - {{template "package/content/npm" .}} + {{template "package/content/helm" .}} {{template "package/content/maven" .}} + {{template "package/content/npm" .}} + {{template "package/content/nuget" .}} {{template "package/content/pypi" .}} {{template "package/content/rubygems" .}} </div> @@ -43,9 +44,10 @@ {{template "package/metadata/conan" .}} {{template "package/metadata/container" .}} {{template "package/metadata/generic" .}} - {{template "package/metadata/nuget" .}} - {{template "package/metadata/npm" .}} + {{template "package/metadata/helm" .}} {{template "package/metadata/maven" .}} + {{template "package/metadata/npm" .}} + {{template "package/metadata/nuget" .}} {{template "package/metadata/pypi" .}} {{template "package/metadata/rubygems" .}} </div> diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 4bf3874bae..e35ba98909 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -1904,7 +1904,9 @@ "enum": [ "composer", "conan", + "container", "generic", + "helm", "maven", "npm", "nuget", |