mirror of
https://github.com/go-gitea/gitea.git
synced 2025-10-21 13:58:27 +00:00
Backport #27227 by @denyskon Throughout the Gitea codebase, you can meet some weird constructions to make `locale.Tr` work in subtemplates. Since we now have `ctx.Locale.Tr` which solves that problem, clean up various templates which pass `locale` through `dict` or use some weird constructions like `$.root.locale` Going on, it would be great to replace every case of `$.locale.Tr` and `.locale.Tr` with `ctx.Locale.Tr`, but that needs to be done with patience. Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{{template "base/alert" .}}
|
||||
<form class="ui form ignore-dirty">
|
||||
<div class="ui fluid action input">
|
||||
{{template "shared/searchinput" dict "locale" .locale "Value" .Query "AutoFocus" true}}
|
||||
{{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>
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<p><a href="{{.PackageDescriptor.PackageWebLink}}">{{.PackageDescriptor.Package.Name}}</a> / <strong>{{.locale.Tr "packages.versions"}}</strong></p>
|
||||
<form class="ui form ignore-dirty">
|
||||
<div class="ui fluid action input">
|
||||
{{template "shared/searchinput" dict "locale" .locale "Value" .Query "AutoFocus" true}}
|
||||
{{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>
|
||||
|
Reference in New Issue
Block a user