Add the String() method to InputField

This commit is contained in:
jordi fita mas 2023-03-13 14:55:10 +01:00
parent c685fc496b
commit 1ab48d2947
2 changed files with 7 additions and 3 deletions

View File

@ -74,6 +74,10 @@ func (field *InputField) Float64() float64 {
return value return value
} }
func (field *InputField) String() string {
return field.Val
}
type SelectOption struct { type SelectOption struct {
Value string Value string
Label string Label string

View File

@ -1,5 +1,5 @@
{{ define "title" -}} {{ define "title" -}}
{{printf (pgettext "Edit Product “%s”" "title") .Name.Val }} {{printf (pgettext "Edit Product “%s”" "title") .Name }}
{{- end }} {{- end }}
{{ define "content" }} {{ define "content" }}
@ -8,11 +8,11 @@
<p> <p>
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> / <a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
<a href="{{ companyURI "/products"}}">{{( pgettext "Products" "title" )}}</a> / <a href="{{ companyURI "/products"}}">{{( pgettext "Products" "title" )}}</a> /
<a>{{ .Name.Val }}</a> <a>{{ .Name }}</a>
</p> </p>
</nav> </nav>
<section class="dialog-content"> <section class="dialog-content">
<h2>{{printf (pgettext "Edit Product “%s”" "title") .Name.Val }}</h2> <h2>{{printf (pgettext "Edit Product “%s”" "title") .Name }}</h2>
<form method="POST"> <form method="POST">
{{ csrfToken }} {{ csrfToken }}
{{ putMethod }} {{ putMethod }}