Compare commits

...

2 Commits

4 changed files with 9 additions and 5 deletions

View File

@ -270,6 +270,9 @@ type ToggleField struct {
func (field *ToggleField) FillValue(r *http.Request) {
field.Selected = strings.TrimSpace(r.FormValue(field.Name))
if field.Selected != field.FirstOption.Value && field.Selected != field.SecondOption.Value {
field.Selected = field.FirstOption.Value
}
}
type FormValidator struct {

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: numerus\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2023-04-15 04:00+0200\n"
"POT-Creation-Date: 2023-04-15 20:39+0200\n"
"PO-Revision-Date: 2023-01-18 17:08+0100\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
@ -640,7 +640,6 @@ msgid "To Date"
msgstr "Fins la data"
#: pkg/invoices.go:191
#, fuzzy
msgctxt "input"
msgid "Tags Condition"
msgstr "Condició de les etiquetes"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: numerus\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2023-04-15 04:00+0200\n"
"POT-Creation-Date: 2023-04-15 20:39+0200\n"
"PO-Revision-Date: 2023-01-18 17:45+0100\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Spanish <es@tp.org.es>\n"

View File

@ -97,7 +97,9 @@
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.ToggleField*/ -}}
<fieldset class="input{{ if .Errors }} has-errors{{ end }}" is="numerus-toggle">
<legend>{{ .Label }}</legend>
<label><input type="radio" name="{{ .Name }}" value="{{ .FirstOption.Value }}" {{ if eq .Selected .FirstOption.Value}}checked{{ end }}> {{ .FirstOption.Label }}</label>
<label><input type="radio" name="{{ .Name }}" value="{{ .SecondOption.Value }}" {{ if eq .Selected .SecondOption.Value}}checked{{ end }}> {{ .SecondOption.Label }}</label>
<label><input type="radio" name="{{ .Name }}" value="{{ .FirstOption.Value }}"
{{ if eq .Selected .FirstOption.Value }}checked{{ end }}> {{ .FirstOption.Label }}</label>
<label><input type="radio" name="{{ .Name }}" value="{{ .SecondOption.Value }}"
{{ if eq .Selected .SecondOption.Value }}checked{{ end }}> {{ .SecondOption.Label }}</label>
</fieldset>
{{- end }}