diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-09-25 21:15:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-25 13:15:51 +0000 |
commit | 597b04fe2f4f032af3c2a4db30bbdf1437a19f34 (patch) | |
tree | 3dc12fe53f4325962309b7a987d31235027669c3 /templates/package/shared | |
parent | 2774a2afc641c4561a44c870138f8006462e2744 (diff) | |
download | gitea-597b04fe2f4f032af3c2a4db30bbdf1437a19f34.tar.gz gitea-597b04fe2f4f032af3c2a4db30bbdf1437a19f34.zip |
Backport ctx locale refactoring manually (#27231) (#27259) (#27260)
Backport #27231 #27259 manually
---------
Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'templates/package/shared')
-rw-r--r-- | templates/package/shared/cargo.tmpl | 12 | ||||
-rw-r--r-- | templates/package/shared/cleanup_rules/edit.tmpl | 54 | ||||
-rw-r--r-- | templates/package/shared/cleanup_rules/list.tmpl | 20 | ||||
-rw-r--r-- | templates/package/shared/cleanup_rules/preview.tmpl | 18 | ||||
-rw-r--r-- | templates/package/shared/list.tmpl | 20 | ||||
-rw-r--r-- | templates/package/shared/versionlist.tmpl | 20 |
6 files changed, 72 insertions, 72 deletions
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..8729494412 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}}{{ctx.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..6505c8f9a5 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}}{{ctx.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..af79490f4d 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> @@ -22,15 +22,15 @@ <span class="ui label">{{svg .Package.Type.SVGName 16}} {{.Package.Type.Name}}</span> </div> <div class="flex-item-body"> - {{$timeStr := TimeSinceUnix .Version.CreatedUnix $.locale}} + {{$timeStr := TimeSinceUnix .Version.CreatedUnix ctx.Locale}} {{$hasRepositoryAccess := false}} {{if .Repository}} {{$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..71a1557ffb 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 ctx.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> |