0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-06-08 05:03:37 +02:00

Placeholder default for SearchInput

This commit is contained in:
Philip Peterson 2025-05-27 21:14:39 -07:00
parent a9d2b28ce5
commit 0e0429ba69
2 changed files with 7 additions and 2 deletions

View File

@ -15,7 +15,7 @@ func SearchCombo(locale translation.Locale, value, placeholder string) g.Node {
disabled := false disabled := false
return gh.Div( return gh.Div(
gh.Class("ui small fluid action input"), gh.Class("ui small fluid action input"),
SearchInput(value, placeholder, disabled), SearchInput(locale, value, placeholder, disabled),
// TODO SearchModeDropdown // TODO SearchModeDropdown
SearchButton(disabled, ""), SearchButton(disabled, ""),
) )

View File

@ -4,13 +4,18 @@
package components package components
import ( import (
"code.gitea.io/gitea/modules/translation"
g "maragu.dev/gomponents" g "maragu.dev/gomponents"
gh "maragu.dev/gomponents/html" gh "maragu.dev/gomponents/html"
) )
func SearchInput(value, placeholder string, disabled bool) g.Node { func SearchInput(locale translation.Locale, value, placeholder string, disabled bool) g.Node {
// Corresponds to templates/shared/search/input.tmpl // Corresponds to templates/shared/search/input.tmpl
if placeholder == "" {
placeholder = string(locale.Tr("search.search"))
}
return gh.Input( return gh.Input(
gh.Type("search"), gh.Type("search"),
gh.Name("q"), gh.Name("q"),