func (t HTMLField) ToFormField(form *htmlwidgets.Form, data util.NestedMap, field *NodeField, locale string) { //G, _, _, _ := gettext.DefaultLocales.Use("", locale) data.Set(field.Id, string(t)) widget := form.AddWidget(new(htmlwidgets.TextAreaWidget), "Fields."+field.Id, field.Name[locale], "") widget.Base().Classes = []string{"html-field"} }
func (t TextField) ToFormField(form *htmlwidgets.Form, data util.NestedMap, field *NodeField, locale string) { data.Set(field.Id, string(t)) G, _, _, _ := gettext.DefaultLocales.Use("", locale) form.AddWidget(&htmlwidgets.TextWidget{ MinLength: 1, ValidationError: G("Required.")}, "Fields."+field.Id, field.Name[locale], "") }
func (t TextField) ToFormField(form *htmlwidgets.Form, data NestedMap, field *FieldConfig, locale string) { data.Set(field.Id, string(t)) G, _, _, _ := gettext.DefaultLocales.Use("", locale) widget := new(htmlwidgets.TextWidget) if field.Required { widget.MinLength = 1 widget.ValidationError = G("Required.") } form.AddWidget(widget, "Fields."+field.Id, field.Name.Get(locale), "") }
func (t DateTimeField) ToFormField(form *htmlwidgets.Form, data util.NestedMap, field *NodeField, locale string) { data.Set(field.Id, t.Time) form.AddWidget(&htmlwidgets.TimeWidget{Location: t.Location}, "Fields."+field.Id, field.Name[locale], "") }
func (t FileField) ToFormField(form *htmlwidgets.Form, data util.NestedMap, field *NodeField, locale string) { data.Set(field.Id, "") form.AddWidget(new(htmlwidgets.FileWidget), "Fields."+field.Id, field.Name[locale], "") }
func (t DateTimeField) ToFormField(form *htmlwidgets.Form, data NestedMap, field *FieldConfig, locale string) { data.Set(field.Id, t.Time) form.AddWidget(&htmlwidgets.TimeWidget{Location: t.Location}, "Fields."+field.Id, field.Name.Get(locale), "") }
func (t FileField) ToFormField(form *htmlwidgets.Form, data NestedMap, field *FieldConfig, locale string) { data.Set(field.Id, "") form.AddWidget(new(htmlwidgets.FileWidget), "Fields."+field.Id, field.Name.Get(locale), "") }