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
}
func (field *InputField) String() string {
return field.Val
}
type SelectOption struct {
Value string
Label string

View File

@ -1,5 +1,5 @@
{{ define "title" -}}
{{printf (pgettext "Edit Product “%s”" "title") .Name.Val }}
{{printf (pgettext "Edit Product “%s”" "title") .Name }}
{{- end }}
{{ define "content" }}
@ -8,11 +8,11 @@
<p>
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
<a href="{{ companyURI "/products"}}">{{( pgettext "Products" "title" )}}</a> /
<a>{{ .Name.Val }}</a>
<a>{{ .Name }}</a>
</p>
</nav>
<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">
{{ csrfToken }}
{{ putMethod }}