-
Notifications
You must be signed in to change notification settings - Fork 0
/
feedback.go
70 lines (68 loc) · 1.47 KB
/
feedback.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package model
type Feedback struct {
Description TextareaField `json:"description"`
NameInput TextField `json:"name_input"`
EmailInput TextField `json:"email_input"`
}
// FuncFeedback is a helper function that binds appropriate properties to the model on instantiation
func (p Page) FuncFeedback() Feedback {
return Feedback{
Description: TextareaField{
Input: Input{
Autocomplete: "off",
DataAttributes: []DataAttribute{
{
Key: "value-missing",
Value: Localisation{
LocaleKey: "ImproveThisPageInvalid",
Plural: 1,
},
},
},
ID: "description-field",
IsRequired: true,
Label: Localisation{
LocaleKey: "ImproveThisPage",
Plural: 1,
},
Language: p.Language,
Name: "description",
},
},
NameInput: TextField{
Input: Input{
Autocomplete: "name",
ID: "name-field",
Label: Localisation{
LocaleKey: "NameOpt",
Plural: 1,
},
Name: "name",
Type: Text,
Language: p.Language,
},
},
EmailInput: TextField{
Input: Input{
Autocomplete: "email",
DataAttributes: []DataAttribute{
{
Key: "type-mismatch",
Value: Localisation{
LocaleKey: "EmailInvalid",
Plural: 1,
},
},
},
ID: "email-field",
Label: Localisation{
LocaleKey: "EmailOpt",
Plural: 1,
},
Name: "email",
Type: Email,
Language: p.Language,
},
},
}
}