diff options
author | delvh <dev.lh@web.de> | 2023-09-25 10:56:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-25 08:56:50 +0000 |
commit | 7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e (patch) | |
tree | cfcc4836ba1bb71518742f2aaf980f1f34248468 /templates/package | |
parent | e6d8b146207de0f5d88b7c08dc75b1f2f078cbbe (diff) | |
download | gitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.tar.gz gitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.zip |
Always use `ctx.Locale.Tr` inside templates (#27231)
Diffstat (limited to 'templates/package')
51 files changed, 317 insertions, 317 deletions
diff --git a/templates/package/content/alpine.tmpl b/templates/package/content/alpine.tmpl index fa34f82140..a1003cd6ff 100644 --- a/templates/package/content/alpine.tmpl +++ b/templates/package/content/alpine.tmpl @@ -1,42 +1,42 @@ {{if eq .PackageDescriptor.Package.Type "alpine"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.alpine.registry" | Safe}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.alpine.registry" | Safe}}</label> <div class="markup"><pre class="code-block"><code><gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/alpine"></gitea-origin-url>/$branch/$repository</code></pre></div> - <p>{{.locale.Tr "packages.alpine.registry.info" | Safe}}</p> + <p>{{ctx.Locale.Tr "packages.alpine.registry.info" | Safe}}</p> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.alpine.registry.key" | Safe}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.alpine.registry.key" | Safe}}</label> <div class="markup"><pre class="code-block"><code>curl -JO <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/alpine/key"></gitea-origin-url></code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.alpine.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.alpine.install"}}</label> <div class="markup"> <pre class="code-block"><code>sudo apk add {{$.PackageDescriptor.Package.Name}}={{$.PackageDescriptor.Version.Version}}</code></pre> </div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Alpine" "https://docs.gitea.com/usage/packages/alpine/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Alpine" "https://docs.gitea.com/usage/packages/alpine/" | Safe}}</label> </div> </div> </div> - <h4 class="ui top attached header">{{.locale.Tr "packages.alpine.repository"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.alpine.repository"}}</h4> <div class="ui attached segment"> <table class="ui single line very basic table"> <tbody> <tr> - <td class="collapsing"><h5>{{.locale.Tr "packages.alpine.repository.branches"}}</h5></td> + <td class="collapsing"><h5>{{ctx.Locale.Tr "packages.alpine.repository.branches"}}</h5></td> <td>{{StringUtils.Join .Branches ", "}}</td> </tr> <tr> - <td class="collapsing"><h5>{{.locale.Tr "packages.alpine.repository.repositories"}}</h5></td> + <td class="collapsing"><h5>{{ctx.Locale.Tr "packages.alpine.repository.repositories"}}</h5></td> <td>{{StringUtils.Join .Repositories ", "}}</td> </tr> <tr> - <td class="collapsing"><h5>{{.locale.Tr "packages.alpine.repository.architectures"}}</h5></td> + <td class="collapsing"><h5>{{ctx.Locale.Tr "packages.alpine.repository.architectures"}}</h5></td> <td>{{StringUtils.Join .Architectures ", "}}</td> </tr> </tbody> @@ -44,7 +44,7 @@ </div> {{if .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{.PackageDescriptor.Metadata.Description}} </div> diff --git a/templates/package/content/cargo.tmpl b/templates/package/content/cargo.tmpl index 67e003c9d1..da9fc4ab39 100644 --- a/templates/package/content/cargo.tmpl +++ b/templates/package/content/cargo.tmpl @@ -1,9 +1,9 @@ {{if eq .PackageDescriptor.Package.Type "cargo"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.cargo.registry" | Safe}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.cargo.registry" | Safe}}</label> <div class="markup"><pre class="code-block"><code>[registry] default = "gitea" @@ -15,29 +15,29 @@ index = "<gitea-origin-url data-url="sparse+{{AppSubUrl}}/api/packages/{{.Packag git-fetch-with-cli = true</code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.cargo.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.cargo.install"}}</label> <div class="markup"><pre class="code-block"><code>cargo add {{.PackageDescriptor.Package.Name}}@{{.PackageDescriptor.Version.Version}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Cargo" "https://docs.gitea.com/usage/packages/cargo/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Cargo" "https://docs.gitea.com/usage/packages/cargo/" | Safe}}</label> </div> </div> </div> {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Readme}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> {{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}} {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}}</div>{{end}} {{end}} {{if .PackageDescriptor.Metadata.Dependencies}} - <h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4> <div class="ui attached segment"> <table class="ui single line very basic table"> <thead> <tr> - <th class="ten wide">{{.locale.Tr "packages.dependency.id"}}</th> - <th class="six wide">{{.locale.Tr "packages.dependency.version"}}</th> + <th class="ten wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th> + <th class="six wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th> </tr> </thead> <tbody> @@ -53,7 +53,7 @@ git-fetch-with-cli = true</code></pre></div> {{end}} {{if .PackageDescriptor.Metadata.Keywords}} - <h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4> <div class="ui attached segment"> {{range .PackageDescriptor.Metadata.Keywords}} {{.}} diff --git a/templates/package/content/chef.tmpl b/templates/package/content/chef.tmpl index 2596f8d493..0588c6e4b3 100644 --- a/templates/package/content/chef.tmpl +++ b/templates/package/content/chef.tmpl @@ -1,23 +1,23 @@ {{if eq .PackageDescriptor.Package.Type "chef"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.chef.registry" | Safe}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.chef.registry" | Safe}}</label> <div class="markup"><pre class="code-block"><code>knife[:supermarket_site] = '<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/chef"></gitea-origin-url>'</code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.chef.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.chef.install"}}</label> <div class="markup"><pre class="code-block"><code>knife supermarket install {{.PackageDescriptor.Package.Name}} {{.PackageDescriptor.Version.Version}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Chef" "https://docs.gitea.com/usage/packages/chef/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Chef" "https://docs.gitea.com/usage/packages/chef/" | Safe}}</label> </div> </div> </div> {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.LongDescription}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Description}}<p>{{.PackageDescriptor.Metadata.Description}}</p>{{end}} {{if .PackageDescriptor.Metadata.LongDescription}}{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.LongDescription}}{{end}} @@ -25,13 +25,13 @@ {{end}} {{if .PackageDescriptor.Metadata.Dependencies}} - <h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4> <div class="ui attached segment"> <table class="ui single line very basic table"> <thead> <tr> - <th class="eleven wide">{{.locale.Tr "packages.dependency.id"}}</th> - <th class="five wide">{{.locale.Tr "packages.dependency.version"}}</th> + <th class="eleven wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th> + <th class="five wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th> </tr> </thead> <tbody> diff --git a/templates/package/content/composer.tmpl b/templates/package/content/composer.tmpl index 80997c583f..862f1c6925 100644 --- a/templates/package/content/composer.tmpl +++ b/templates/package/content/composer.tmpl @@ -1,9 +1,9 @@ {{if eq .PackageDescriptor.Package.Type "composer"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.composer.registry" | Safe}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.composer.registry" | Safe}}</label> <div class="markup"><pre class="code-block"><code>{ "repositories": [{ "type": "composer", @@ -13,34 +13,34 @@ }</code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.composer.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.composer.install"}}</label> <div class="markup"><pre class="code-block"><code>composer require {{.PackageDescriptor.Package.Name}}:{{.PackageDescriptor.Version.Version}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Composer" "https://docs.gitea.com/usage/packages/composer/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Composer" "https://docs.gitea.com/usage/packages/composer/" | Safe}}</label> </div> </div> </div> {{if .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{.PackageDescriptor.Metadata.Description}} </div> {{end}} {{if or .PackageDescriptor.Metadata.Require .PackageDescriptor.Metadata.RequireDev}} - <h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4> <div class="ui attached segment"> <div class="ui list"> - {{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Require "title" (.locale.Tr "packages.composer.dependencies")}} - {{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.RequireDev "title" (.locale.Tr "packages.composer.dependencies.development")}} + {{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Require "title" (ctx.Locale.Tr "packages.composer.dependencies")}} + {{template "package/content/composer_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.RequireDev "title" (ctx.Locale.Tr "packages.composer.dependencies.development")}} </div> </div> {{end}} {{if or .PackageDescriptor.Metadata.Keywords}} - <h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4> <div class="ui attached segment"> {{range .PackageDescriptor.Metadata.Keywords}} {{.}} diff --git a/templates/package/content/composer_dependencies.tmpl b/templates/package/content/composer_dependencies.tmpl index b55c1b5b88..dba45750b7 100644 --- a/templates/package/content/composer_dependencies.tmpl +++ b/templates/package/content/composer_dependencies.tmpl @@ -3,8 +3,8 @@ <table class="ui single line very basic table"> <thead> <tr> - <th class="eleven wide">{{.root.locale.Tr "packages.dependency.id"}}</th> - <th class="five wide">{{.root.locale.Tr "packages.dependency.version"}}</th> + <th class="eleven wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th> + <th class="five wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th> </tr> </thead> <tbody> diff --git a/templates/package/content/conan.tmpl b/templates/package/content/conan.tmpl index c8904216af..55b84d12b1 100644 --- a/templates/package/content/conan.tmpl +++ b/templates/package/content/conan.tmpl @@ -1,30 +1,30 @@ {{if eq .PackageDescriptor.Package.Type "conan"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.conan.registry"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.conan.registry"}}</label> <div class="markup"><pre class="code-block"><code>conan remote add gitea <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conan"></gitea-origin-url></code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.conan.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.conan.install"}}</label> <div class="markup"><pre class="code-block"><code>conan install --remote=gitea {{.PackageDescriptor.Package.Name}}/{{.PackageDescriptor.Version.Version}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Conan" "https://docs.gitea.com/usage/packages/conan/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Conan" "https://docs.gitea.com/usage/packages/conan/" | Safe}}</label> </div> </div> </div> {{if .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{end}} </div> {{end}} {{if or .PackageDescriptor.Metadata.Keywords}} - <h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4> <div class="ui attached segment"> {{range .PackageDescriptor.Metadata.Keywords}} {{.}} diff --git a/templates/package/content/conda.tmpl b/templates/package/content/conda.tmpl index 23d640944b..0fd0c3db3f 100644 --- a/templates/package/content/conda.tmpl +++ b/templates/package/content/conda.tmpl @@ -1,9 +1,9 @@ {{if eq .PackageDescriptor.Package.Type "conda"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.conda.registry" | Safe}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.conda.registry" | Safe}}</label> <div class="markup"><pre class="code-block"><code>channel_alias: <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></gitea-origin-url> channels:   - <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></gitea-origin-url> @@ -11,18 +11,18 @@ default_channels:   - <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/conda"></gitea-origin-url></code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.conda.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.conda.install"}}</label> {{$channel := .PackageDescriptor.PackageProperties.GetByName "conda.channel"}} <div class="markup"><pre class="code-block"><code>conda install{{if $channel}} -c {{$channel}}{{end}} {{.PackageDescriptor.PackageProperties.GetByName "conda.name"}}={{.PackageDescriptor.Version.Version}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Conda" "https://docs.gitea.com/usage/packages/conda/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Conda" "https://docs.gitea.com/usage/packages/conda/" | Safe}}</label> </div> </div> </div> {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Summary}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{else}}{{.PackageDescriptor.Metadata.Summary}}{{end}} </div> diff --git a/templates/package/content/container.tmpl b/templates/package/content/container.tmpl index cba5d9e7c1..f5ee902c94 100644 --- a/templates/package/content/container.tmpl +++ b/templates/package/content/container.tmpl @@ -1,9 +1,9 @@ {{if eq .PackageDescriptor.Package.Type "container"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.container.pull"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.container.pull"}}</label> {{if eq .PackageDescriptor.Metadata.Type "helm"}} <div class="markup"><pre class="code-block"><code>helm pull oci://{{.RegistryHost}}/{{.PackageDescriptor.Owner.LowerName}}/{{.PackageDescriptor.Package.LowerName}} --version {{.PackageDescriptor.Version.LowerVersion}}</code></pre></div> {{else}} @@ -15,23 +15,23 @@ {{end}} </div> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.container.digest"}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.container.digest"}}</label> <div class="markup"><pre class="code-block"><code>{{range .PackageDescriptor.Files}}{{if eq .File.LowerName "manifest.json"}}{{.Properties.GetByName "container.digest"}}{{end}}{{end}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Container" "https://docs.gitea.com/usage/packages/container/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Container" "https://docs.gitea.com/usage/packages/container/" | Safe}}</label> </div> </div> </div> {{if .PackageDescriptor.Metadata.Manifests}} - <h4 class="ui top attached header">{{.locale.Tr "packages.container.multi_arch"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.multi_arch"}}</h4> <div class="ui attached segment"> <table class="ui very basic compact table"> <thead> <tr> - <th>{{.locale.Tr "packages.container.digest"}}</th> - <th>{{.locale.Tr "packages.container.multi_arch"}}</th> - <th>{{.locale.Tr "admin.packages.size"}}</th> + <th>{{ctx.Locale.Tr "packages.container.digest"}}</th> + <th>{{ctx.Locale.Tr "packages.container.multi_arch"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.size"}}</th> </tr> </thead> <tbody> @@ -47,13 +47,13 @@ </div> {{end}} {{if .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{.PackageDescriptor.Metadata.Description}} </div> {{end}} {{if .PackageDescriptor.Metadata.ImageLayers}} - <h4 class="ui top attached header">{{.locale.Tr "packages.container.layers"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.layers"}}</h4> <div class="ui attached segment gt-word-break"> <table class="ui very basic compact table"> <tbody> @@ -67,13 +67,13 @@ </div> {{end}} {{if .PackageDescriptor.Metadata.Labels}} - <h4 class="ui top attached header">{{.locale.Tr "packages.container.labels"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.container.labels"}}</h4> <div class="ui attached segment"> <table class="ui very basic compact table"> <thead> <tr> - <th>{{.locale.Tr "packages.container.labels.key"}}</th> - <th>{{.locale.Tr "packages.container.labels.value"}}</th> + <th>{{ctx.Locale.Tr "packages.container.labels.key"}}</th> + <th>{{ctx.Locale.Tr "packages.container.labels.value"}}</th> </tr> </thead> <tbody> diff --git a/templates/package/content/cran.tmpl b/templates/package/content/cran.tmpl index 1f3200130c..f9a3f70107 100644 --- a/templates/package/content/cran.tmpl +++ b/templates/package/content/cran.tmpl @@ -1,30 +1,30 @@ {{if eq .PackageDescriptor.Package.Type "cran"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.cran.registry" | Safe}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.cran.registry" | Safe}}</label> <div class="markup"><pre class="code-block"><code>options("repos" = c(getOption("repos"), c(gitea="<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/cran"></gitea-origin-url>")))</code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.cran.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.cran.install"}}</label> <div class="markup"><pre class="code-block"><code>install.packages("{{.PackageDescriptor.Package.Name}}")</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "CRAN" "https://docs.gitea.com/usage/packages/cran/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "CRAN" "https://docs.gitea.com/usage/packages/cran/" | Safe}}</label> </div> </div> </div> {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Title}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Title}}{{else}}{{end}} </div> {{end}} {{if or .PackageDescriptor.Metadata.Imports .PackageDescriptor.Metadata.Depends .PackageDescriptor.Metadata.LinkingTo .PackageDescriptor.Metadata.Suggests}} - <h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4> <div class="ui attached segment"> <table class="ui single line very basic table"> <tbody> diff --git a/templates/package/content/debian.tmpl b/templates/package/content/debian.tmpl index b222767035..242ee1fba4 100644 --- a/templates/package/content/debian.tmpl +++ b/templates/package/content/debian.tmpl @@ -1,40 +1,40 @@ {{if eq .PackageDescriptor.Package.Type "debian"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.debian.registry"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.debian.registry"}}</label> <div class="markup"><pre class="code-block"><code>sudo curl <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/debian/repository.key"></gitea-origin-url> -o /etc/apt/trusted.gpg.d/gitea-{{$.PackageDescriptor.Owner.Name}}.asc echo "deb <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/debian"></gitea-origin-url> $distribution $component" | sudo tee -a /etc/apt/sources.list.d/gitea.list sudo apt update</code></pre></div> - <p>{{.locale.Tr "packages.debian.registry.info" | Safe}}</p> + <p>{{ctx.Locale.Tr "packages.debian.registry.info" | Safe}}</p> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.debian.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.debian.install"}}</label> <div class="markup"> <pre class="code-block"><code>sudo apt install {{$.PackageDescriptor.Package.Name}}={{$.PackageDescriptor.Version.Version}}</code></pre> </div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Debian" "https://docs.gitea.com/usage/packages/debian/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Debian" "https://docs.gitea.com/usage/packages/debian/" | Safe}}</label> </div> </div> </div> - <h4 class="ui top attached header">{{.locale.Tr "packages.debian.repository"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.debian.repository"}}</h4> <div class="ui attached segment"> <table class="ui single line very basic table"> <tbody> <tr> - <td class="collapsing"><h5>{{.locale.Tr "packages.debian.repository.distributions"}}</h5></td> + <td class="collapsing"><h5>{{ctx.Locale.Tr "packages.debian.repository.distributions"}}</h5></td> <td>{{StringUtils.Join .Distributions ", "}}</td> </tr> <tr> - <td class="collapsing"><h5>{{.locale.Tr "packages.debian.repository.components"}}</h5></td> + <td class="collapsing"><h5>{{ctx.Locale.Tr "packages.debian.repository.components"}}</h5></td> <td>{{StringUtils.Join .Components ", "}}</td> </tr> <tr> - <td class="collapsing"><h5>{{.locale.Tr "packages.debian.repository.architectures"}}</h5></td> + <td class="collapsing"><h5>{{ctx.Locale.Tr "packages.debian.repository.architectures"}}</h5></td> <td>{{StringUtils.Join .Architectures ", "}}</td> </tr> </tbody> @@ -42,14 +42,14 @@ sudo apt update</code></pre></div> </div> {{if .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{.PackageDescriptor.Metadata.Description}} </div> {{end}} {{if .PackageDescriptor.Metadata.Dependencies}} - <h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4> <div class="ui attached segment"> <table class="ui single line very basic table"> <tbody> diff --git a/templates/package/content/generic.tmpl b/templates/package/content/generic.tmpl index 01012a5f0a..ba4df0a57d 100644 --- a/templates/package/content/generic.tmpl +++ b/templates/package/content/generic.tmpl @@ -1,9 +1,9 @@ {{if eq .PackageDescriptor.Package.Type "generic"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.generic.download"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.generic.download"}}</label> <div class="markup"><pre class="code-block"><code> {{- range .PackageDescriptor.Files -}} curl <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/generic/{{$.PackageDescriptor.Package.Name}}/{{$.PackageDescriptor.Version.Version}}/{{.File.Name}}"></gitea-origin-url> @@ -11,7 +11,7 @@ curl <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescripto </code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Generic" "https://docs.gitea.com/usage/packages/generic" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Generic" "https://docs.gitea.com/usage/packages/generic" | Safe}}</label> </div> </div> </div> diff --git a/templates/package/content/go.tmpl b/templates/package/content/go.tmpl index db25cc2b92..f98fc69fb6 100644 --- a/templates/package/content/go.tmpl +++ b/templates/package/content/go.tmpl @@ -1,13 +1,13 @@ {{if eq .PackageDescriptor.Package.Type "go"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.go.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.go.install"}}</label> <div class="markup"><pre class="code-block"><code>GOPROXY=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/go"></gitea-origin-url> go install {{$.PackageDescriptor.Package.Name}}@{{$.PackageDescriptor.Version.Version}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Go" "https://docs.gitea.com/usage/packages/go" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Go" "https://docs.gitea.com/usage/packages/go" | Safe}}</label> </div> </div> </div> diff --git a/templates/package/content/helm.tmpl b/templates/package/content/helm.tmpl index 44d01b6013..68e53133f1 100644 --- a/templates/package/content/helm.tmpl +++ b/templates/package/content/helm.tmpl @@ -1,37 +1,37 @@ {{if eq .PackageDescriptor.Package.Type "helm"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.helm.registry"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.helm.registry"}}</label> <div class="markup"><pre class="code-block"><code>helm repo add {{AppDomain}} <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/helm"></gitea-origin-url> helm repo update</code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.helm.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.helm.install"}}</label> <div class="markup"><pre class="code-block"><code>helm install {{.PackageDescriptor.Package.Name}} {{AppDomain}}/{{.PackageDescriptor.Package.Name}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Helm" "https://docs.gitea.com/usage/packages/helm/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Helm" "https://docs.gitea.com/usage/packages/helm/" | Safe}}</label> </div> </div> </div> {{if .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{.PackageDescriptor.Metadata.Description}} </div> {{end}} {{if .PackageDescriptor.Metadata.Dependencies}} - <h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4> <div class="ui attached segment"> <table class="ui single line very basic table"> <thead> <tr> - <th class="ten wide">{{.locale.Tr "packages.dependency.id"}}</th> - <th class="six wide">{{.locale.Tr "packages.dependency.version"}}</th> + <th class="ten wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th> + <th class="six wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th> </tr> </thead> <tbody> @@ -47,7 +47,7 @@ helm repo update</code></pre></div> {{end}} {{if .PackageDescriptor.Metadata.Keywords}} - <h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4> <div class="ui attached segment"> {{range .PackageDescriptor.Metadata.Keywords}} {{.}} diff --git a/templates/package/content/maven.tmpl b/templates/package/content/maven.tmpl index f5da72d711..b2cd567e16 100644 --- a/templates/package/content/maven.tmpl +++ b/templates/package/content/maven.tmpl @@ -1,9 +1,9 @@ {{if eq .PackageDescriptor.Package.Type "maven"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.maven.registry" | Safe}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.maven.registry" | Safe}}</label> <div class="markup"><pre class="code-block"><code><repositories> <repository> <id>gitea</id> @@ -24,7 +24,7 @@ </distributionManagement></code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.maven.install" | Safe}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.maven.install" | Safe}}</label> <div class="markup"><pre class="code-block"><code><dependency> <groupId>{{.PackageDescriptor.Metadata.GroupID}}</groupId> <artifactId>{{.PackageDescriptor.Metadata.ArtifactID}}</artifactId> @@ -32,28 +32,28 @@ </dependency></code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.maven.install2"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.maven.install2"}}</label> <div class="markup"><pre class="code-block"><code>mvn install</code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.maven.download"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.maven.download"}}</label> <div class="markup"><pre class="code-block"><code>mvn dependency:get -DremoteRepositories=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/maven"></gitea-origin-url> -Dartifact={{.PackageDescriptor.Metadata.GroupID}}:{{.PackageDescriptor.Metadata.ArtifactID}}:{{.PackageDescriptor.Version.Version}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Maven" "https://docs.gitea.com/usage/packages/maven/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Maven" "https://docs.gitea.com/usage/packages/maven/" | Safe}}</label> </div> </div> </div> {{if .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{.PackageDescriptor.Metadata.Description}} </div> {{end}} {{if .PackageDescriptor.Metadata.Dependencies}} - <h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4> <div class="ui attached segment"> <div class="ui list"> {{range .PackageDescriptor.Metadata.Dependencies}} diff --git a/templates/package/content/npm.tmpl b/templates/package/content/npm.tmpl index c648d96162..882e999bed 100644 --- a/templates/package/content/npm.tmpl +++ b/templates/package/content/npm.tmpl @@ -1,27 +1,27 @@ {{if eq .PackageDescriptor.Package.Type "npm"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.npm.registry" | Safe}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.npm.registry" | Safe}}</label> <div class="markup"><pre class="code-block"><code>{{if .PackageDescriptor.Metadata.Scope}}{{.PackageDescriptor.Metadata.Scope}}:{{end}}registry=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/npm/"></gitea-origin-url></code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.npm.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.npm.install"}}</label> <div class="markup"><pre class="code-block"><code>npm install {{.PackageDescriptor.Package.Name}}@{{.PackageDescriptor.Version.Version}}</code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.npm.install2"}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.npm.install2"}}</label> <div class="markup"><pre class="code-block"><code>"{{.PackageDescriptor.Package.Name}}": "{{.PackageDescriptor.Version.Version}}"</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "npm" "https://docs.gitea.com/usage/packages/npm/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "npm" "https://docs.gitea.com/usage/packages/npm/" | Safe}}</label> </div> </div> </div> {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Readme}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Readme}} <div class="markup markdown"> @@ -34,19 +34,19 @@ {{end}} {{if or .PackageDescriptor.Metadata.Dependencies .PackageDescriptor.Metadata.DevelopmentDependencies .PackageDescriptor.Metadata.PeerDependencies .PackageDescriptor.Metadata.OptionalDependencies}} - <h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4> <div class="ui attached segment"> <div class="ui list"> - {{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Dependencies "title" (.locale.Tr "packages.npm.dependencies")}} - {{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.DevelopmentDependencies "title" (.locale.Tr "packages.npm.dependencies.development")}} - {{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.PeerDependencies "title" (.locale.Tr "packages.npm.dependencies.peer")}} - {{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.OptionalDependencies "title" (.locale.Tr "packages.npm.dependencies.optional")}} + {{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.Dependencies "title" (ctx.Locale.Tr "packages.npm.dependencies")}} + {{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.DevelopmentDependencies "title" (ctx.Locale.Tr "packages.npm.dependencies.development")}} + {{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.PeerDependencies "title" (ctx.Locale.Tr "packages.npm.dependencies.peer")}} + {{template "package/content/npm_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.OptionalDependencies "title" (ctx.Locale.Tr "packages.npm.dependencies.optional")}} </div> </div> {{end}} {{if .PackageDescriptor.Metadata.Keywords}} - <h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4> <div class="ui attached segment"> {{range .PackageDescriptor.Metadata.Keywords}} {{.}} diff --git a/templates/package/content/npm_dependencies.tmpl b/templates/package/content/npm_dependencies.tmpl index b55c1b5b88..dba45750b7 100644 --- a/templates/package/content/npm_dependencies.tmpl +++ b/templates/package/content/npm_dependencies.tmpl @@ -3,8 +3,8 @@ <table class="ui single line very basic table"> <thead> <tr> - <th class="eleven wide">{{.root.locale.Tr "packages.dependency.id"}}</th> - <th class="five wide">{{.root.locale.Tr "packages.dependency.version"}}</th> + <th class="eleven wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th> + <th class="five wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th> </tr> </thead> <tbody> diff --git a/templates/package/content/nuget.tmpl b/templates/package/content/nuget.tmpl index 2b3a74316c..04dac89843 100644 --- a/templates/package/content/nuget.tmpl +++ b/templates/package/content/nuget.tmpl @@ -1,23 +1,23 @@ {{if eq .PackageDescriptor.Package.Type "nuget"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.nuget.registry"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.nuget.registry"}}</label> <div class="markup"><pre class="code-block"><code>dotnet nuget add source --name {{.PackageDescriptor.Owner.Name}} --username your_username --password your_token <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/nuget/index.json"></gitea-origin-url></code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.nuget.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.nuget.install"}}</label> <div class="markup"><pre class="code-block"><code>dotnet add package --source {{.PackageDescriptor.Owner.Name}} --version {{.PackageDescriptor.Version.Version}} {{.PackageDescriptor.Package.Name}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "NuGet" "https://docs.gitea.com/usage/packages/nuget/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "NuGet" "https://docs.gitea.com/usage/packages/nuget/" | Safe}}</label> </div> </div> </div> {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.ReleaseNotes}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{end}} {{if .PackageDescriptor.Metadata.ReleaseNotes}}{{Str2html .PackageDescriptor.Metadata.ReleaseNotes}}{{end}} @@ -25,14 +25,14 @@ {{end}} {{if .PackageDescriptor.Metadata.Dependencies}} - <h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4> <div class="ui attached segment"> <table class="ui single line very basic table"> <thead> <tr> - <th class="ten wide">{{.locale.Tr "packages.dependency.id"}}</th> - <th class="three wide">{{.locale.Tr "packages.dependency.version"}}</th> - <th class="three wide">{{.locale.Tr "packages.nuget.dependency.framework"}}</th> + <th class="ten wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th> + <th class="three wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th> + <th class="three wide">{{ctx.Locale.Tr "packages.nuget.dependency.framework"}}</th> </tr> </thead> <tbody> diff --git a/templates/package/content/pub.tmpl b/templates/package/content/pub.tmpl index 075d52cf49..8657d55dbf 100644 --- a/templates/package/content/pub.tmpl +++ b/templates/package/content/pub.tmpl @@ -1,18 +1,18 @@ {{if eq .PackageDescriptor.Package.Type "pub"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.pub.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.pub.install"}}</label> <div class="markup"><pre class="code-block"><code>dart pub add {{.PackageDescriptor.Package.Name}}:{{.PackageDescriptor.Version.Version}} --hosted-url=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/pub/"></gitea-origin-url></code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Pub" "https://docs.gitea.com/usage/packages/pub/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Pub" "https://docs.gitea.com/usage/packages/pub/" | Safe}}</label> </div> </div> </div> {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.Readme}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> {{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}} {{if .PackageDescriptor.Metadata.Readme}}<div class="ui attached segment">{{RenderMarkdownToHtml $.Context .PackageDescriptor.Metadata.Readme}}</div>{{end}} {{end}} diff --git a/templates/package/content/pypi.tmpl b/templates/package/content/pypi.tmpl index 1534197219..ef9beb4280 100644 --- a/templates/package/content/pypi.tmpl +++ b/templates/package/content/pypi.tmpl @@ -1,18 +1,18 @@ {{if eq .PackageDescriptor.Package.Type "pypi"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.pypi.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.pypi.install"}}</label> <div class="markup"><pre class="code-block"><code>pip install --index-url <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/pypi/simple/"></gitea-origin-url> {{.PackageDescriptor.Package.Name}}</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "PyPI" "https://docs.gitea.com/usage/packages/pypi/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "PyPI" "https://docs.gitea.com/usage/packages/pypi/" | Safe}}</label> </div> </div> </div> {{if or .PackageDescriptor.Metadata.Description .PackageDescriptor.Metadata.LongDescription .PackageDescriptor.Metadata.Summary}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> <p>{{if .PackageDescriptor.Metadata.Summary}}{{.PackageDescriptor.Metadata.Summary}}{{end}}</p> {{if .PackageDescriptor.Metadata.LongDescription}} @@ -23,9 +23,9 @@ </div> {{end}} {{if .PackageDescriptor.Metadata.RequiresPython}} - <h4 class="ui top attached header">{{.locale.Tr "packages.requirements"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.requirements"}}</h4> <div class="ui attached segment"> - {{.locale.Tr "packages.pypi.requires"}}: {{.PackageDescriptor.Metadata.RequiresPython}} + {{ctx.Locale.Tr "packages.pypi.requires"}}: {{.PackageDescriptor.Metadata.RequiresPython}} </div> {{end}} {{end}} diff --git a/templates/package/content/rpm.tmpl b/templates/package/content/rpm.tmpl index fc7af639aa..3fd979567c 100644 --- a/templates/package/content/rpm.tmpl +++ b/templates/package/content/rpm.tmpl @@ -1,33 +1,33 @@ {{if eq .PackageDescriptor.Package.Type "rpm"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.rpm.registry"}}</label> - <div class="markup"><pre class="code-block"><code># {{.locale.Tr "packages.rpm.distro.redhat"}} + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.rpm.registry"}}</label> + <div class="markup"><pre class="code-block"><code># {{ctx.Locale.Tr "packages.rpm.distro.redhat"}} dnf config-manager --add-repo <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/rpm.repo"></gitea-origin-url> -# {{.locale.Tr "packages.rpm.distro.suse"}} +# {{ctx.Locale.Tr "packages.rpm.distro.suse"}} zypper addrepo <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/rpm.repo"></gitea-origin-url></code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.rpm.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.rpm.install"}}</label> <div class="markup"> - <pre class="code-block"><code># {{.locale.Tr "packages.rpm.distro.redhat"}} + <pre class="code-block"><code># {{ctx.Locale.Tr "packages.rpm.distro.redhat"}} dnf install {{$.PackageDescriptor.Package.Name}} -# {{.locale.Tr "packages.rpm.distro.suse"}} +# {{ctx.Locale.Tr "packages.rpm.distro.suse"}} zypper install {{$.PackageDescriptor.Package.Name}}</code></pre> </div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "RPM" "https://docs.gitea.com/usage/packages/rpm/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "RPM" "https://docs.gitea.com/usage/packages/rpm/" | Safe}}</label> </div> </div> </div> {{if or .PackageDescriptor.Metadata.Summary .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> {{if .PackageDescriptor.Metadata.Summary}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Summary}}</div>{{end}} {{if .PackageDescriptor.Metadata.Description}}<div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>{{end}} {{end}} diff --git a/templates/package/content/rubygems.tmpl b/templates/package/content/rubygems.tmpl index f94968b094..180ff60f7d 100644 --- a/templates/package/content/rubygems.tmpl +++ b/templates/package/content/rubygems.tmpl @@ -1,39 +1,39 @@ {{if eq .PackageDescriptor.Package.Type "rubygems"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.rubygems.install" | Safe}}:</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.rubygems.install" | Safe}}:</label> <div class="markup"><pre class="code-block"><code>gem install {{.PackageDescriptor.Package.Name}} --version "{{.PackageDescriptor.Version.Version}}" --source "<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/rubygems"></gitea-origin-url>"</code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.rubygems.install2"}}:</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.rubygems.install2"}}:</label> <div class="markup"><pre class="code-block"><code>source "<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/rubygems"></gitea-origin-url>" do gem "{{.PackageDescriptor.Package.Name}}", "{{.PackageDescriptor.Version.Version}}" end</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "RubyGems" "https://docs.gitea.com/usage/packages/rubygems/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "RubyGems" "https://docs.gitea.com/usage/packages/rubygems/" | Safe}}</label> </div> </div> </div> {{if .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div> {{end}} {{if or .PackageDescriptor.Metadata.RequiredRubyVersion .PackageDescriptor.Metadata.RequiredRubygemsVersion}} - <h4 class="ui top attached header">{{.locale.Tr "packages.requirements"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.requirements"}}</h4> <div class="ui attached segment"> - {{if .PackageDescriptor.Metadata.RequiredRubyVersion}}<p>{{.locale.Tr "packages.rubygems.required.ruby"}}: {{range $i, $v := .PackageDescriptor.Metadata.RequiredRubyVersion}}{{if gt $i 0}}, {{end}}{{$v.Restriction}}{{$v.Version}}{{end}}</p>{{end}} - {{if .PackageDescriptor.Metadata.RequiredRubygemsVersion}}<p>{{.locale.Tr "packages.rubygems.required.rubygems"}}: {{range $i, $v := .PackageDescriptor.Metadata.RequiredRubygemsVersion}}{{if gt $i 0}}, {{end}}{{$v.Restriction}}{{$v.Version}}{{end}}</p>{{end}} + {{if .PackageDescriptor.Metadata.RequiredRubyVersion}}<p>{{ctx.Locale.Tr "packages.rubygems.required.ruby"}}: {{range $i, $v := .PackageDescriptor.Metadata.RequiredRubyVersion}}{{if gt $i 0}}, {{end}}{{$v.Restriction}}{{$v.Version}}{{end}}</p>{{end}} + {{if .PackageDescriptor.Metadata.RequiredRubygemsVersion}}<p>{{ctx.Locale.Tr "packages.rubygems.required.rubygems"}}: {{range $i, $v := .PackageDescriptor.Metadata.RequiredRubygemsVersion}}{{if gt $i 0}}, {{end}}{{$v.Restriction}}{{$v.Version}}{{end}}</p>{{end}} </div> {{end}} {{if or .PackageDescriptor.Metadata.RuntimeDependencies .PackageDescriptor.Metadata.DevelopmentDependencies}} - <h4 class="ui top attached header">{{.locale.Tr "packages.dependencies"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.dependencies"}}</h4> <div class="ui attached segment"> <div class="ui list"> - {{template "package/content/rubygems_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.RuntimeDependencies "title" (.locale.Tr "packages.rubygems.dependencies.runtime")}} - {{template "package/content/rubygems_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.DevelopmentDependencies "title" (.locale.Tr "packages.rubygems.dependencies.development")}} + {{template "package/content/rubygems_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.RuntimeDependencies "title" (ctx.Locale.Tr "packages.rubygems.dependencies.runtime")}} + {{template "package/content/rubygems_dependencies" dict "root" $ "dependencies" .PackageDescriptor.Metadata.DevelopmentDependencies "title" (ctx.Locale.Tr "packages.rubygems.dependencies.development")}} </div> </div> {{end}} diff --git a/templates/package/content/rubygems_dependencies.tmpl b/templates/package/content/rubygems_dependencies.tmpl index 80febc84f4..2c42dcead2 100644 --- a/templates/package/content/rubygems_dependencies.tmpl +++ b/templates/package/content/rubygems_dependencies.tmpl @@ -3,8 +3,8 @@ <table class="ui single line very basic table"> <thead> <tr> - <th class="eleven wide">{{.root.locale.Tr "packages.dependency.id"}}</th> - <th class="five wide">{{.root.locale.Tr "packages.dependency.version"}}</th> + <th class="eleven wide">{{ctx.Locale.Tr "packages.dependency.id"}}</th> + <th class="five wide">{{ctx.Locale.Tr "packages.dependency.version"}}</th> </tr> </thead> <tbody> diff --git a/templates/package/content/swift.tmpl b/templates/package/content/swift.tmpl index 92559491a9..ca36033df9 100644 --- a/templates/package/content/swift.tmpl +++ b/templates/package/content/swift.tmpl @@ -1,36 +1,36 @@ {{if eq .PackageDescriptor.Package.Type "swift"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.swift.registry"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.swift.registry"}}</label> <div class="markup"><pre class="code-block"><code>swift package-registry set <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/swift"></gitea-origin-url></code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-code"}} {{.locale.Tr "packages.swift.install" | Safe}}</label> + <label>{{svg "octicon-code"}} {{ctx.Locale.Tr "packages.swift.install" | Safe}}</label> <div class="markup"><pre class="code-block"><code>dependencies: [ .package(id: "{{.PackageDescriptor.Package.Name}}", from:"{{.PackageDescriptor.Version.Version}}") ]</code></pre></div> </div> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.swift.install2"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.swift.install2"}}</label> <div class="markup"><pre class="code-block"><code>swift package resolve</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Swift" "https://docs.gitea.com/usage/packages/swift/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Swift" "https://docs.gitea.com/usage/packages/swift/" | Safe}}</label> </div> </div> </div> {{if .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment"> {{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{end}} </div> {{end}} {{if .PackageDescriptor.Metadata.Keywords}} - <h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.keywords"}}</h4> <div class="ui attached segment"> {{range .PackageDescriptor.Metadata.Keywords}} {{.}} diff --git a/templates/package/content/vagrant.tmpl b/templates/package/content/vagrant.tmpl index 8590b44b37..bbb461e4fb 100644 --- a/templates/package/content/vagrant.tmpl +++ b/templates/package/content/vagrant.tmpl @@ -1,18 +1,18 @@ {{if eq .PackageDescriptor.Package.Type "vagrant"}} - <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.installation"}}</h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.vagrant.install"}}</label> + <label>{{svg "octicon-terminal"}} {{ctx.Locale.Tr "packages.vagrant.install"}}</label> <div class="markup"><pre class="code-block"><code>vagrant box add --box-version {{.PackageDescriptor.Version.Version}} "<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/vagrant/{{.PackageDescriptor.Package.Name}}"></gitea-origin-url>"</code></pre></div> </div> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Vagrant" "https://docs.gitea.com/usage/packages/vagrant/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Vagrant" "https://docs.gitea.com/usage/packages/vagrant/" | Safe}}</label> </div> </div> </div> {{if .PackageDescriptor.Metadata.Description}} - <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "packages.about"}}</h4> <div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div> {{end}} {{end}} diff --git a/templates/package/metadata/alpine.tmpl b/templates/package/metadata/alpine.tmpl index 9011bfce10..73cbc06aac 100644 --- a/templates/package/metadata/alpine.tmpl +++ b/templates/package/metadata/alpine.tmpl @@ -1,5 +1,5 @@ {{if eq .PackageDescriptor.Package.Type "alpine"}} - {{if .PackageDescriptor.Metadata.Maintainer}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Maintainer}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Maintainer}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Maintainer}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} {{end}} diff --git a/templates/package/metadata/cargo.tmpl b/templates/package/metadata/cargo.tmpl index 79078b4008..9cc0fde730 100644 --- a/templates/package/metadata/cargo.tmpl +++ b/templates/package/metadata/cargo.tmpl @@ -1,7 +1,7 @@ {{if eq .PackageDescriptor.Package.Type "cargo"}} - {{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.cargo.details.repository_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.cargo.details.documentation_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} + {{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.cargo.details.repository_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.cargo.details.documentation_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} {{end}} diff --git a/templates/package/metadata/chef.tmpl b/templates/package/metadata/chef.tmpl index b414535f9a..fa6e068d23 100644 --- a/templates/package/metadata/chef.tmpl +++ b/templates/package/metadata/chef.tmpl @@ -1,5 +1,5 @@ {{if eq .PackageDescriptor.Package.Type "chef"}} - {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} - {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.repository_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} + {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.repository_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} {{end}} diff --git a/templates/package/metadata/composer.tmpl b/templates/package/metadata/composer.tmpl index e6f67a1dd5..fbdc33f73d 100644 --- a/templates/package/metadata/composer.tmpl +++ b/templates/package/metadata/composer.tmpl @@ -1,5 +1,5 @@ {{if eq .PackageDescriptor.Package.Type "composer"}} - {{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.Name}}</div>{{end}} - {{if .PackageDescriptor.Metadata.Homepage}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.Homepage}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{range .PackageDescriptor.Metadata.License}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}} + {{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.Name}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Homepage}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.Homepage}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{range .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}} {{end}} diff --git a/templates/package/metadata/conan.tmpl b/templates/package/metadata/conan.tmpl index 0060f91d75..55892bb919 100644 --- a/templates/package/metadata/conan.tmpl +++ b/templates/package/metadata/conan.tmpl @@ -1,6 +1,6 @@ {{if eq .PackageDescriptor.Package.Type "conan"}} - {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} - {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.conan.details.repository"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} + {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.conan.details.repository"}}</a></div>{{end}} {{end}} diff --git a/templates/package/metadata/conda.tmpl b/templates/package/metadata/conda.tmpl index 4021e6b91c..fb7c212863 100644 --- a/templates/package/metadata/conda.tmpl +++ b/templates/package/metadata/conda.tmpl @@ -1,6 +1,6 @@ {{if eq .PackageDescriptor.Package.Type "conda"}} {{if .PackageDescriptor.Metadata.License}}<div class="item">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.conda.details.repository_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.conda.details.documentation_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.conda.details.repository_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.conda.details.documentation_site"}}</a></div>{{end}} {{end}} diff --git a/templates/package/metadata/container.tmpl b/templates/package/metadata/container.tmpl index 7ff137080e..b05ef0b846 100644 --- a/templates/package/metadata/container.tmpl +++ b/templates/package/metadata/container.tmpl @@ -1,9 +1,9 @@ {{if eq .PackageDescriptor.Package.Type "container"}} - <div class="item" title="{{.locale.Tr "packages.container.details.type"}}">{{svg "octicon-package" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Type.Name}}</div> - {{if .PackageDescriptor.Metadata.Platform}}<div class="item" title="{{$.locale.Tr "packages.container.details.platform"}}">{{svg "octicon-cpu" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Platform}}</div>{{end}} - {{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}} + <div class="item" title="{{ctx.Locale.Tr "packages.container.details.type"}}">{{svg "octicon-package" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Type.Name}}</div> + {{if .PackageDescriptor.Metadata.Platform}}<div class="item" title="{{ctx.Locale.Tr "packages.container.details.platform"}}">{{svg "octicon-cpu" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Platform}}</div>{{end}} + {{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}} {{if .PackageDescriptor.Metadata.Licenses}}<div class="item">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Licenses}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.repository_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.documentation_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.repository_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.documentation_site"}}</a></div>{{end}} {{end}} diff --git a/templates/package/metadata/cran.tmpl b/templates/package/metadata/cran.tmpl index 7b113ec797..1d5a11e196 100644 --- a/templates/package/metadata/cran.tmpl +++ b/templates/package/metadata/cran.tmpl @@ -1,5 +1,5 @@ {{if eq .PackageDescriptor.Package.Type "cran"}} - {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} - {{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.}}</div>{{end}} - {{range .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.}}" target="_blank" rel="noopener noreferrer me">{{$.locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} + {{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.}}</div>{{end}} + {{range .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} {{end}} diff --git a/templates/package/metadata/debian.tmpl b/templates/package/metadata/debian.tmpl index 93b6db3bd2..3cd845c9fe 100644 --- a/templates/package/metadata/debian.tmpl +++ b/templates/package/metadata/debian.tmpl @@ -1,4 +1,4 @@ {{if eq .PackageDescriptor.Package.Type "debian"}} - {{if .PackageDescriptor.Metadata.Maintainer}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Maintainer}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.Maintainer}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Maintainer}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} {{end}} diff --git a/templates/package/metadata/helm.tmpl b/templates/package/metadata/helm.tmpl index 33e603bb32..499f77e80d 100644 --- a/templates/package/metadata/helm.tmpl +++ b/templates/package/metadata/helm.tmpl @@ -1,4 +1,4 @@ {{if eq .PackageDescriptor.Package.Type "helm"}} - {{range .PackageDescriptor.Metadata.Maintainers}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.Name}}</div>{{end}} - {{if .PackageDescriptor.Metadata.Home}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.Home}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{range .PackageDescriptor.Metadata.Maintainers}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.Name}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Home}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.Home}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} {{end}} diff --git a/templates/package/metadata/maven.tmpl b/templates/package/metadata/maven.tmpl index 78c0d32267..36f5eca840 100644 --- a/templates/package/metadata/maven.tmpl +++ b/templates/package/metadata/maven.tmpl @@ -1,5 +1,5 @@ {{if eq .PackageDescriptor.Package.Type "maven"}} {{if .PackageDescriptor.Metadata.Name}}<div class="item">{{svg "octicon-note" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Name}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{range .PackageDescriptor.Metadata.Licenses}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{range .PackageDescriptor.Metadata.Licenses}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}} {{end}} diff --git a/templates/package/metadata/npm.tmpl b/templates/package/metadata/npm.tmpl index cbebf996f4..9794d851af 100644 --- a/templates/package/metadata/npm.tmpl +++ b/templates/package/metadata/npm.tmpl @@ -1,8 +1,8 @@ {{if eq .PackageDescriptor.Package.Type "npm"}} - {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} {{range .PackageDescriptor.VersionProperties}} - {{if eq .Name "npm.tag"}}<div class="item" title="{{$.locale.Tr "packages.npm.details.tag"}}">{{svg "octicon-versions" 16 "gt-mr-3"}} {{.Value}}</div>{{end}} + {{if eq .Name "npm.tag"}}<div class="item" title="{{ctx.Locale.Tr "packages.npm.details.tag"}}">{{svg "octicon-versions" 16 "gt-mr-3"}} {{.Value}}</div>{{end}} {{end}} {{end}} diff --git a/templates/package/metadata/nuget.tmpl b/templates/package/metadata/nuget.tmpl index 3b56102203..48c8d602dd 100644 --- a/templates/package/metadata/nuget.tmpl +++ b/templates/package/metadata/nuget.tmpl @@ -1,4 +1,4 @@ {{if eq .PackageDescriptor.Package.Type "nuget"}} - {{if .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Authors}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Authors}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} {{end}} diff --git a/templates/package/metadata/pub.tmpl b/templates/package/metadata/pub.tmpl index 8147ba85cc..1e4a90e78c 100644 --- a/templates/package/metadata/pub.tmpl +++ b/templates/package/metadata/pub.tmpl @@ -1,5 +1,5 @@ {{if eq .PackageDescriptor.Package.Type "pub"}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.repository_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.documentation_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.repository_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.DocumentationURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.DocumentationURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.documentation_site"}}</a></div>{{end}} {{end}} diff --git a/templates/package/metadata/pypi.tmpl b/templates/package/metadata/pypi.tmpl index 205487d3ce..f447cb7f4f 100644 --- a/templates/package/metadata/pypi.tmpl +++ b/templates/package/metadata/pypi.tmpl @@ -1,5 +1,5 @@ {{if eq .PackageDescriptor.Package.Type "pypi"}} - {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} + {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} {{end}} diff --git a/templates/package/metadata/rpm.tmpl b/templates/package/metadata/rpm.tmpl index 1bbc2c89ae..026f129590 100644 --- a/templates/package/metadata/rpm.tmpl +++ b/templates/package/metadata/rpm.tmpl @@ -1,4 +1,4 @@ {{if eq .PackageDescriptor.Package.Type "rpm"}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.License}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.License}}</div>{{end}} {{end}} diff --git a/templates/package/metadata/rubygems.tmpl b/templates/package/metadata/rubygems.tmpl index 7e9af01eb7..62150b1a43 100644 --- a/templates/package/metadata/rubygems.tmpl +++ b/templates/package/metadata/rubygems.tmpl @@ -1,5 +1,5 @@ {{if eq .PackageDescriptor.Package.Type "rubygems"}} - {{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{$.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div> {{end}} - {{range .PackageDescriptor.Metadata.Licenses}}<div class="item" title="{{$.locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}} + {{range .PackageDescriptor.Metadata.Authors}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div> {{end}} + {{range .PackageDescriptor.Metadata.Licenses}}<div class="item" title="{{ctx.Locale.Tr "packages.details.license"}}">{{svg "octicon-law" 16 "gt-mr-3"}} {{.}}</div>{{end}} {{end}} diff --git a/templates/package/metadata/swift.tmpl b/templates/package/metadata/swift.tmpl index 8a9ab071fc..3df38e3200 100644 --- a/templates/package/metadata/swift.tmpl +++ b/templates/package/metadata/swift.tmpl @@ -1,4 +1,4 @@ {{if eq .PackageDescriptor.Package.Type "swift"}} - {{if .PackageDescriptor.Metadata.Author.String}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} - {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.Author.String}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} + {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} {{end}} diff --git a/templates/package/metadata/vagrant.tmpl b/templates/package/metadata/vagrant.tmpl index 030da9c156..62c50a0dfd 100644 --- a/templates/package/metadata/vagrant.tmpl +++ b/templates/package/metadata/vagrant.tmpl @@ -1,5 +1,5 @@ {{if eq .PackageDescriptor.Package.Type "vagrant"}} - {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} - {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}} - {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.conan.details.repository"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{ctx.Locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "gt-mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}} + {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.details.project_site"}}</a></div>{{end}} + {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{ctx.Locale.Tr "packages.conan.details.repository"}}</a></div>{{end}} {{end}} diff --git a/templates/package/settings.tmpl b/templates/package/settings.tmpl index d6c431de03..6ef62753e2 100644 --- a/templates/package/settings.tmpl +++ b/templates/package/settings.tmpl @@ -4,12 +4,12 @@ <div class="ui container"> {{template "user/overview/header" .}} {{template "base/alert" .}} - <p><a href="{{.PackageDescriptor.FullWebLink}}">{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</a> / <strong>{{.locale.Tr "repo.settings"}}</strong></p> + <p><a href="{{.PackageDescriptor.FullWebLink}}">{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</a> / <strong>{{ctx.Locale.Tr "repo.settings"}}</strong></p> <h4 class="ui top attached header"> - {{.locale.Tr "packages.settings.link"}} + {{ctx.Locale.Tr "packages.settings.link"}} </h4> <div class="ui attached segment"> - <p>{{.locale.Tr "packages.settings.link.description"}}</p> + <p>{{ctx.Locale.Tr "packages.settings.link.description"}}</p> <form class="ui form" action="{{.Link}}" method="post"> {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} @@ -22,7 +22,7 @@ {{end}} <input type="hidden" name="repo_id" value="{{$repoID}}"> {{svg "octicon-triangle-down" 14 "dropdown icon"}} - <div class="default text">{{.locale.Tr "packages.settings.link.select"}}</div> + <div class="default text">{{ctx.Locale.Tr "packages.settings.link.select"}}</div> <div class="menu"> {{range .Repos}} <div class="item" data-value="{{.ID}}">{{.Name}}</div> @@ -31,30 +31,30 @@ </div> </div> <div class="field"> - <button class="ui primary button">{{.locale.Tr "packages.settings.link.button"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "packages.settings.link.button"}}</button> </div> </form> </div> <h4 class="ui top attached error header"> - {{.locale.Tr "repo.settings.danger_zone"}} + {{ctx.Locale.Tr "repo.settings.danger_zone"}} </h4> <div class="ui attached error danger segment"> <div class="flex-list"> <div class="flex-item"> <div class="flex-item-main"> - <div class="flex-item-title">{{.locale.Tr "packages.settings.delete"}}</div> - <div class="flex-item-body">{{.locale.Tr "packages.settings.delete.description"}}</div> + <div class="flex-item-title">{{ctx.Locale.Tr "packages.settings.delete"}}</div> + <div class="flex-item-body">{{ctx.Locale.Tr "packages.settings.delete.description"}}</div> </div> <div class="flex-item-trailing"> - <button class="ui basic red show-modal button" data-modal="#delete-package-modal">{{.locale.Tr "packages.settings.delete"}}</button> + <button class="ui basic red show-modal button" data-modal="#delete-package-modal">{{ctx.Locale.Tr "packages.settings.delete"}}</button> </div> <div class="ui tiny modal" id="delete-package-modal"> <div class="header"> - {{.locale.Tr "packages.settings.delete"}} + {{ctx.Locale.Tr "packages.settings.delete"}} </div> <div class="content"> <div class="ui warning message gt-word-break"> - {{.locale.Tr "packages.settings.delete.notice" .PackageDescriptor.Package.Name .PackageDescriptor.Version.Version}} + {{ctx.Locale.Tr "packages.settings.delete.notice" .PackageDescriptor.Package.Name .PackageDescriptor.Version.Version}} </div> <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} diff --git a/templates/package/shared/cargo.tmpl b/templates/package/shared/cargo.tmpl index 9761cb2133..b452065881 100644 --- a/templates/package/shared/cargo.tmpl +++ b/templates/package/shared/cargo.tmpl @@ -1,24 +1,24 @@ <h4 class="ui top attached header"> - {{.locale.Tr "packages.owner.settings.cargo.title"}} + {{ctx.Locale.Tr "packages.owner.settings.cargo.title"}} </h4> <div class="ui attached segment"> <div class="ui form"> <div class="field"> - <label>{{$.locale.Tr "packages.owner.settings.cargo.initialize.description"}}</label> + <label>{{ctx.Locale.Tr "packages.owner.settings.cargo.initialize.description"}}</label> </div> <form class="field" action="{{.Link}}/cargo/initialize" method="post"> {{.CsrfTokenHtml}} - <button class="ui primary button">{{$.locale.Tr "packages.owner.settings.cargo.initialize"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "packages.owner.settings.cargo.initialize"}}</button> </form> <div class="field"> - <label>{{$.locale.Tr "packages.owner.settings.cargo.rebuild.description"}}</label> + <label>{{ctx.Locale.Tr "packages.owner.settings.cargo.rebuild.description"}}</label> </div> <form class="field" action="{{.Link}}/cargo/rebuild" method="post"> {{.CsrfTokenHtml}} - <button class="ui primary button">{{$.locale.Tr "packages.owner.settings.cargo.rebuild"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "packages.owner.settings.cargo.rebuild"}}</button> </form> <div class="field"> - <label>{{.locale.Tr "packages.registry.documentation" "Cargo" "https://docs.gitea.com/usage/packages/cargo/" | Safe}}</label> + <label>{{ctx.Locale.Tr "packages.registry.documentation" "Cargo" "https://docs.gitea.com/usage/packages/cargo/" | Safe}}</label> </div> </div> </div> diff --git a/templates/package/shared/cleanup_rules/edit.tmpl b/templates/package/shared/cleanup_rules/edit.tmpl index 1bfa6260a1..f1fe9d1378 100644 --- a/templates/package/shared/cleanup_rules/edit.tmpl +++ b/templates/package/shared/cleanup_rules/edit.tmpl @@ -1,16 +1,16 @@ -<h4 class="ui top attached header">{{if .IsEditRule}}{{.locale.Tr "packages.owner.settings.cleanuprules.edit"}}{{else}}{{.locale.Tr "packages.owner.settings.cleanuprules.add"}}{{end}}</h4> +<h4 class="ui top attached header">{{if .IsEditRule}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.edit"}}{{else}}{{.locale.Tr "packages.owner.settings.cleanuprules.add"}}{{end}}</h4> <div class="ui attached segment"> <form class="ui form" action="{{.Link}}" method="post"> {{.CsrfTokenHtml}} <input name="id" type="hidden" value="{{.CleanupRule.ID}}"> <div class="field"> <div class="ui checkbox"> - <label>{{.locale.Tr "enabled"}}</label> + <label>{{ctx.Locale.Tr "enabled"}}</label> <input type="checkbox" name="enabled" {{if .CleanupRule.Enabled}}checked{{end}}> </div> </div> <div class="{{if .IsEditRule}}disabled {{end}}field {{if .Err_Type}}error{{end}}"> - <label>{{.locale.Tr "packages.filter.type"}}</label> + <label>{{ctx.Locale.Tr "packages.filter.type"}}</label> <select class="ui selection dropdown" name="type"> {{range $type := .AvailableTypes}} <option{{if eq $.CleanupRule.Type $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option> @@ -19,54 +19,54 @@ </div> <div class="field"> <div class="ui checkbox"> - <label>{{.locale.Tr "packages.owner.settings.cleanuprules.pattern_full_match"}}</label> + <label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.pattern_full_match"}}</label> <input type="checkbox" name="match_full_name" {{if .CleanupRule.MatchFullName}}checked{{end}}> </div> </div> <div class="divider"></div> - <p>{{.locale.Tr "packages.owner.settings.cleanuprules.keep.title"}}</p> + <p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.title"}}</p> <div class="field {{if .Err_KeepCount}}error{{end}}"> - <label>{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</label> + <label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</label> <select class="ui selection dropdown" name="keep_count"> <option{{if eq .CleanupRule.KeepCount 0}} selected="selected"{{end}} value="0"></option> - <option{{if eq .CleanupRule.KeepCount 1}} selected="selected"{{end}} value="1">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}</option> - <option{{if eq .CleanupRule.KeepCount 5}} selected="selected"{{end}} value="5">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 5}}</option> - <option{{if eq .CleanupRule.KeepCount 10}} selected="selected"{{end}} value="10">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 10}}</option> - <option{{if eq .CleanupRule.KeepCount 25}} selected="selected"{{end}} value="25">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 25}}</option> - <option{{if eq .CleanupRule.KeepCount 50}} selected="selected"{{end}} value="50">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 50}}</option> - <option{{if eq .CleanupRule.KeepCount 100}} selected="selected"{{end}} value="100">{{.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 100}}</option> + <option{{if eq .CleanupRule.KeepCount 1}} selected="selected"{{end}} value="1">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}</option> + <option{{if eq .CleanupRule.KeepCount 5}} selected="selected"{{end}} value="5">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 5}}</option> + <option{{if eq .CleanupRule.KeepCount 10}} selected="selected"{{end}} value="10">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 10}}</option> + <option{{if eq .CleanupRule.KeepCount 25}} selected="selected"{{end}} value="25">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 25}}</option> + <option{{if eq .CleanupRule.KeepCount 50}} selected="selected"{{end}} value="50">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 50}}</option> + <option{{if eq .CleanupRule.KeepCount 100}} selected="selected"{{end}} value="100">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" 100}}</option> </select> </div> <div class="field {{if .Err_KeepPattern}}error{{end}}"> - <label>{{.locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</label> + <label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</label> <input name="keep_pattern" type="text" value="{{.CleanupRule.KeepPattern}}"> - <p>{{.locale.Tr "packages.owner.settings.cleanuprules.keep.pattern.container" | Safe}}</p> + <p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern.container" | Safe}}</p> </div> <div class="divider"></div> - <p>{{.locale.Tr "packages.owner.settings.cleanuprules.remove.title"}}</p> + <p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.title"}}</p> <div class="field {{if .Err_RemoveDays}}error{{end}}"> - <label>{{.locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</label> + <label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</label> <select class="ui selection dropdown" name="remove_days"> <option{{if eq .CleanupRule.RemoveDays 0}} selected="selected"{{end}} value="0"></option> - <option{{if eq .CleanupRule.RemoveDays 7}} selected="selected"{{end}} value="7">{{.locale.Tr "tool.days" 7}}</option> - <option{{if eq .CleanupRule.RemoveDays 14}} selected="selected"{{end}} value="14">{{.locale.Tr "tool.days" 14}}</option> - <option{{if eq .CleanupRule.RemoveDays 30}} selected="selected"{{end}} value="30">{{.locale.Tr "tool.days" 30}}</option> - <option{{if eq .CleanupRule.RemoveDays 60}} selected="selected"{{end}} value="60">{{.locale.Tr "tool.days" 60}}</option> - <option{{if eq .CleanupRule.RemoveDays 90}} selected="selected"{{end}} value="90">{{.locale.Tr "tool.days" 90}}</option> - <option{{if eq .CleanupRule.RemoveDays 180}} selected="selected"{{end}} value="180">{{.locale.Tr "tool.days" 180}}</option> + <option{{if eq .CleanupRule.RemoveDays 7}} selected="selected"{{end}} value="7">{{ctx.Locale.Tr "tool.days" 7}}</option> + <option{{if eq .CleanupRule.RemoveDays 14}} selected="selected"{{end}} value="14">{{ctx.Locale.Tr "tool.days" 14}}</option> + <option{{if eq .CleanupRule.RemoveDays 30}} selected="selected"{{end}} value="30">{{ctx.Locale.Tr "tool.days" 30}}</option> + <option{{if eq .CleanupRule.RemoveDays 60}} selected="selected"{{end}} value="60">{{ctx.Locale.Tr "tool.days" 60}}</option> + <option{{if eq .CleanupRule.RemoveDays 90}} selected="selected"{{end}} value="90">{{ctx.Locale.Tr "tool.days" 90}}</option> + <option{{if eq .CleanupRule.RemoveDays 180}} selected="selected"{{end}} value="180">{{ctx.Locale.Tr "tool.days" 180}}</option> </select> </div> <div class="field {{if .Err_RemovePattern}}error{{end}}"> - <label>{{.locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</label> + <label>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</label> <input name="remove_pattern" type="text" value="{{.CleanupRule.RemovePattern}}"> </div> <div class="field"> {{if .IsEditRule}} - <button class="ui primary button" name="action" value="save">{{.locale.Tr "save"}}</button> - <button class="ui red button" name="action" value="remove">{{.locale.Tr "remove"}}</button> - <a class="ui button" href="{{.Link}}/preview">{{.locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a> + <button class="ui primary button" name="action" value="save">{{ctx.Locale.Tr "save"}}</button> + <button class="ui red button" name="action" value="remove">{{ctx.Locale.Tr "remove"}}</button> + <a class="ui button" href="{{.Link}}/preview">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a> {{else}} - <button class="ui primary button" name="action" value="save">{{.locale.Tr "add"}}</button> + <button class="ui primary button" name="action" value="save">{{ctx.Locale.Tr "add"}}</button> {{end}} </div> </form> diff --git a/templates/package/shared/cleanup_rules/list.tmpl b/templates/package/shared/cleanup_rules/list.tmpl index e2af344817..91a613576a 100644 --- a/templates/package/shared/cleanup_rules/list.tmpl +++ b/templates/package/shared/cleanup_rules/list.tmpl @@ -1,7 +1,7 @@ <h4 class="ui top attached header"> - {{.locale.Tr "packages.owner.settings.cleanuprules.title"}} + {{ctx.Locale.Tr "packages.owner.settings.cleanuprules.title"}} <div class="ui right"> - <a class="ui primary tiny button" href="{{.Link}}/rules/add">{{.locale.Tr "packages.owner.settings.cleanuprules.add"}}</a> + <a class="ui primary tiny button" href="{{.Link}}/rules/add">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.add"}}</a> </div> </h4> <div class="ui attached segment"> @@ -16,26 +16,26 @@ <a class="item" href="{{$.Link}}/rules/{{.ID}}">{{.Type.Name}}</a> </div> <div class="flex-item-body"> - <i>{{if .Enabled}}{{$.locale.Tr "enabled"}}{{else}}{{$.locale.Tr "disabled"}}{{end}}</i> + <i>{{if .Enabled}}{{ctx.Locale.Tr "enabled"}}{{else}}{{ctx.Locale.Tr "disabled"}}{{end}}</i> </div> {{if .KeepCount}} <div class="flex-item-body"> - <i>{{$.locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</i> {{if eq .KeepCount 1}}{{$.locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}{{else}}{{$.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" .KeepCount}}{{end}} + <i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count"}}:</i> {{if eq .KeepCount 1}}{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.count.1"}}{{else}}{{$.locale.Tr "packages.owner.settings.cleanuprules.keep.count.n" .KeepCount}}{{end}} </div> {{end}} {{if .KeepPattern}} <div class="flex-item-body"> - <i>{{$.locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</i> {{StringUtils.EllipsisString .KeepPattern 100}} + <i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.keep.pattern"}}:</i> {{StringUtils.EllipsisString .KeepPattern 100}} </div> {{end}} {{if .RemoveDays}} <div class="flex-item-body"> - <i>{{$.locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</i> {{$.locale.Tr "tool.days" .RemoveDays}} + <i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.days"}}:</i> {{ctx.Locale.Tr "tool.days" .RemoveDays}} </div> {{end}} {{if .RemovePattern}} <div class="flex-item-body"> - <i>{{$.locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</i> {{StringUtils.EllipsisString .RemovePattern 100}} + <i>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.remove.pattern"}}:</i> {{StringUtils.EllipsisString .RemovePattern 100}} </div> {{end}} </div> @@ -43,14 +43,14 @@ <div class="ui dropdown tiny basic button"> {{svg "octicon-kebab-horizontal"}} <div class="menu"> - <a class="item" href="{{$.Link}}/rules/{{.ID}}">{{$.locale.Tr "edit"}}</a> - <a class="item" href="{{$.Link}}/rules/{{.ID}}/preview">{{$.locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a> + <a class="item" href="{{$.Link}}/rules/{{.ID}}">{{ctx.Locale.Tr "edit"}}</a> + <a class="item" href="{{$.Link}}/rules/{{.ID}}/preview">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}}</a> </div> </div> </div> </div> {{else}} - <div class="item">{{.locale.Tr "packages.owner.settings.cleanuprules.none"}}</div> + <div class="item">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.none"}}</div> {{end}} </div> </div> diff --git a/templates/package/shared/cleanup_rules/preview.tmpl b/templates/package/shared/cleanup_rules/preview.tmpl index 5992ea60be..7a50d5ccca 100644 --- a/templates/package/shared/cleanup_rules/preview.tmpl +++ b/templates/package/shared/cleanup_rules/preview.tmpl @@ -1,17 +1,17 @@ -<h4 class="ui top attached header">{{.locale.Tr "packages.owner.settings.cleanuprules.preview"}}</h4> +<h4 class="ui top attached header">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview"}}</h4> <div class="ui attached segment"> - <p>{{.locale.Tr "packages.owner.settings.cleanuprules.preview.overview" (len .VersionsToRemove)}}</p> + <p>{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview.overview" (len .VersionsToRemove)}}</p> </div> <div class="ui attached table segment"> <table class="ui very basic striped table unstackable"> <thead> <tr> - <th>{{.locale.Tr "admin.packages.type"}}</th> - <th>{{.locale.Tr "admin.packages.name"}}</th> - <th>{{.locale.Tr "admin.packages.version"}}</th> - <th>{{.locale.Tr "admin.packages.creator"}}</th> - <th>{{.locale.Tr "admin.packages.size"}}</th> - <th>{{.locale.Tr "admin.packages.published"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.type"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.name"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.version"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.creator"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.size"}}</th> + <th>{{ctx.Locale.Tr "admin.packages.published"}}</th> </tr> </thead> <tbody> @@ -26,7 +26,7 @@ </tr> {{else}} <tr> - <td colspan="6">{{.locale.Tr "packages.owner.settings.cleanuprules.preview.none"}}</td> + <td colspan="6">{{ctx.Locale.Tr "packages.owner.settings.cleanuprules.preview.none"}}</td> </tr> {{end}} </tbody> diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl index d30767cd7f..249ba8c53c 100644 --- a/templates/package/shared/list.tmpl +++ b/templates/package/shared/list.tmpl @@ -3,13 +3,13 @@ <div class="ui fluid action input"> {{template "shared/searchinput" dict "Value" .Query "AutoFocus" true}} <select class="ui dropdown" name="type"> - <option value="">{{.locale.Tr "packages.filter.type"}}</option> - <option value="all">{{.locale.Tr "packages.filter.type.all"}}</option> + <option value="">{{ctx.Locale.Tr "packages.filter.type"}}</option> + <option value="all">{{ctx.Locale.Tr "packages.filter.type.all"}}</option> {{range $type := .AvailableTypes}} <option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option> {{end}} </select> - <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> </div> </form> <div> @@ -28,9 +28,9 @@ {{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}} {{end}} {{if $hasRepositoryAccess}} - {{$.locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) .Repository.Link (.Repository.FullName | Escape) | Safe}} + {{ctx.Locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) .Repository.Link (.Repository.FullName | Escape) | Safe}} {{else}} - {{$.locale.Tr "packages.published_by" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}} + {{ctx.Locale.Tr "packages.published_by" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}} {{end}} </div> </div> @@ -40,15 +40,15 @@ {{if not .HasPackages}} <div class="empty center"> {{svg "octicon-package" 48}} - <h2>{{.locale.Tr "packages.empty"}}</h2> + <h2>{{ctx.Locale.Tr "packages.empty"}}</h2> {{if and .Repository .CanWritePackages}} {{$packagesUrl := URLJoin .Owner.HomeLink "-" "packages"}} - <p>{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p> + <p>{{ctx.Locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p> {{end}} - <p>{{.locale.Tr "packages.empty.documentation" "https://docs.gitea.com/usage/packages/overview/" | Safe}}</p> + <p>{{ctx.Locale.Tr "packages.empty.documentation" "https://docs.gitea.com/usage/packages/overview/" | Safe}}</p> </div> {{else}} - <p class="gt-py-4">{{.locale.Tr "packages.filter.no_result"}}</p> + <p class="gt-py-4">{{ctx.Locale.Tr "packages.filter.no_result"}}</p> {{end}} {{end}} {{template "base/paginate" .}} diff --git a/templates/package/shared/versionlist.tmpl b/templates/package/shared/versionlist.tmpl index b372d45df2..18b4916f4a 100644 --- a/templates/package/shared/versionlist.tmpl +++ b/templates/package/shared/versionlist.tmpl @@ -1,21 +1,21 @@ -<p><a href="{{.PackageDescriptor.PackageWebLink}}">{{.PackageDescriptor.Package.Name}}</a> / <strong>{{.locale.Tr "packages.versions"}}</strong></p> +<p><a href="{{.PackageDescriptor.PackageWebLink}}">{{.PackageDescriptor.Package.Name}}</a> / <strong>{{ctx.Locale.Tr "packages.versions"}}</strong></p> <form class="ui form ignore-dirty"> <div class="ui fluid action input"> {{template "shared/searchinput" dict "Value" .Query "AutoFocus" true}} <select class="ui dropdown" name="sort"> - <option value="version_asc"{{if eq .Sort "version_asc"}} selected="selected"{{end}}>{{.locale.Tr "filter.string.asc"}}</option> - <option value="version_desc"{{if eq .Sort "version_desc"}} selected="selected"{{end}}>{{.locale.Tr "filter.string.desc"}}</option> - <option value="created_asc"{{if eq .Sort "created_asc"}} selected="selected"{{end}}>{{.locale.Tr "repo.issues.filter_sort.oldest"}}</option> - <option value="created_desc"{{if or (eq .Sort "") (eq .Sort "created_desc")}} selected="selected"{{end}}>{{.locale.Tr "repo.issues.filter_sort.latest"}}</option> + <option value="version_asc"{{if eq .Sort "version_asc"}} selected="selected"{{end}}>{{ctx.Locale.Tr "filter.string.asc"}}</option> + <option value="version_desc"{{if eq .Sort "version_desc"}} selected="selected"{{end}}>{{ctx.Locale.Tr "filter.string.desc"}}</option> + <option value="created_asc"{{if eq .Sort "created_asc"}} selected="selected"{{end}}>{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</option> + <option value="created_desc"{{if or (eq .Sort "") (eq .Sort "created_desc")}} selected="selected"{{end}}>{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</option> </select> {{if eq .PackageDescriptor.Package.Type "container"}} <select class="ui dropdown" name="tagged"> {{$isTagged := or (eq .Tagged "") (eq .Tagged "tagged")}} - <option value="tagged"{{if $isTagged}} selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.tagged"}}</option> - <option value="untagged"{{if not $isTagged}} selected="selected"{{end}}>{{.locale.Tr "packages.filter.container.untagged"}}</option> + <option value="tagged"{{if $isTagged}} selected="selected"{{end}}>{{ctx.Locale.Tr "packages.filter.container.tagged"}}</option> + <option value="untagged"{{if not $isTagged}} selected="selected"{{end}}>{{ctx.Locale.Tr "packages.filter.container.untagged"}}</option> </select> {{end}} - <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "explore.search"}}</button> </div> </form> <div> @@ -25,13 +25,13 @@ <div class="flex-item-main"> <a class="flex-item-title" href="{{.FullWebLink}}">{{.Version.LowerVersion}}</a> <div class="flex-item-body"> - {{$.locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix $.locale) .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}} + {{ctx.Locale.Tr "packages.published_by" (TimeSinceUnix .Version.CreatedUnix $.locale) .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}} </div> </div> </div> </div> {{else}} - <p class="gt-py-4">{{.locale.Tr "packages.filter.no_result"}}</p> + <p class="gt-py-4">{{ctx.Locale.Tr "packages.filter.no_result"}}</p> {{end}} {{template "base/paginate" .}} </div> diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl index 2f22b4ec2a..8856dbf930 100644 --- a/templates/package/view.tmpl +++ b/templates/package/view.tmpl @@ -10,9 +10,9 @@ <div> {{$timeStr := TimeSinceUnix .PackageDescriptor.Version.CreatedUnix $.locale}} {{if .HasRepositoryAccess}} - {{.locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) .PackageDescriptor.Repository.Link (.PackageDescriptor.Repository.FullName | Escape) | Safe}} + {{ctx.Locale.Tr "packages.published_by_in" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) .PackageDescriptor.Repository.Link (.PackageDescriptor.Repository.FullName | Escape) | Safe}} {{else}} - {{.locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) | Safe}} + {{ctx.Locale.Tr "packages.published_by" $timeStr .PackageDescriptor.Creator.HomeLink (.PackageDescriptor.Creator.GetDisplayName | Escape) | Safe}} {{end}} </div> </div> @@ -41,7 +41,7 @@ {{template "package/content/vagrant" .}} </div> <div class="issue-content-right ui segment"> - <strong>{{.locale.Tr "packages.details"}}</strong> + <strong>{{ctx.Locale.Tr "packages.details"}}</strong> <div class="ui relaxed list"> <div class="item">{{svg .PackageDescriptor.Package.Type.SVGName 16 "gt-mr-3"}} {{.PackageDescriptor.Package.Type.Name}}</div> {{if .HasRepositoryAccess}} @@ -75,7 +75,7 @@ </div> {{if not (eq .PackageDescriptor.Package.Type "container")}} <div class="divider"></div> - <strong>{{.locale.Tr "packages.assets"}} ({{len .PackageDescriptor.Files}})</strong> + <strong>{{ctx.Locale.Tr "packages.assets"}} ({{len .PackageDescriptor.Files}})</strong> <div class="ui relaxed list"> {{range .PackageDescriptor.Files}} <div class="item"> @@ -86,8 +86,8 @@ </div> {{end}} <div class="divider"></div> - <strong>{{.locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong> - <a class="gt-float-right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{.locale.Tr "packages.versions.view_all"}}</a> + <strong>{{ctx.Locale.Tr "packages.versions"}} ({{.TotalVersionCount}})</strong> + <a class="gt-float-right" href="{{$.PackageDescriptor.PackageWebLink}}/versions">{{ctx.Locale.Tr "packages.versions.view_all"}}</a> <div class="ui relaxed list"> {{range .LatestVersions}} <div class="item gt-df"> @@ -100,10 +100,10 @@ <div class="divider"></div> <div class="ui relaxed list"> {{if .HasRepositoryAccess}} - <div class="item">{{svg "octicon-issue-opened" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Repository.Link}}/issues">{{.locale.Tr "repo.issues"}}</a></div> + <div class="item">{{svg "octicon-issue-opened" 16 "gt-mr-3"}} <a href="{{.PackageDescriptor.Repository.Link}}/issues">{{ctx.Locale.Tr "repo.issues"}}</a></div> {{end}} {{if .CanWritePackages}} - <div class="item">{{svg "octicon-tools" 16 "gt-mr-3"}} <a href="{{.Link}}/settings">{{.locale.Tr "repo.settings"}}</a></div> + <div class="item">{{svg "octicon-tools" 16 "gt-mr-3"}} <a href="{{.Link}}/settings">{{ctx.Locale.Tr "repo.settings"}}</a></div> {{end}} </div> {{end}} |