File tree 2 files changed +11
-1
lines changed
templates/repo/settings/webhook
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ type Form struct {
46
46
Type string `yaml:"type"`
47
47
Required bool `yaml:"required"`
48
48
Default string `yaml:"default"`
49
+ Pattern string `yaml:"pattern"`
49
50
}
50
51
51
52
// InputType returns the HTML input type of a Form.Type
Original file line number Diff line number Diff line change 10
10
{{range .CustomHook.Form}}
11
11
<div class="field {{if .Required}}required{{end}} {{if ne (index $ (printf "Err_%s" .ID)) nil}}error{{end}}">
12
12
<label for="{{.ID}}">{{.Label}}</label>
13
- <input id="{{.ID}}" name="{{.ID}}" type="{{.InputType}}" value="{{if eq .InputType "checkbox"}}true{{else}}{{index $ (printf "CustomHook_%s" .ID)}}{{end}}" {{if and (eq .InputType "checkbox") (eq (printf "%v" (index $ (printf "CustomHook_%s" .ID))) "true")}}checked{{end}} {{if .Default}}placeholder="{{.Default}}" {{end}} {{if .Required}}required{{end}}>
13
+ <input
14
+ id="{{.ID}}"
15
+ name="{{.ID}}"
16
+ type="{{.InputType}}"
17
+ value="{{if eq .InputType "checkbox"}}true{{else}}{{index $ (printf "CustomHook_%s" .ID)}}{{end}}"
18
+ {{if and (eq .InputType "checkbox") (eq (printf "%v" (index $ (printf "CustomHook_%s" .ID))) "true")}}checked{{end}}
19
+ {{if .Default}}placeholder="{{.Default}}" {{end}}
20
+ {{if .Pattern}}pattern="{{.Pattern}}"{{end}}
21
+ {{if .Required}}required{{end}}
22
+ >
14
23
</div>
15
24
{{end}}
16
25
<div class="field {{if .Err_Secret}}error{{end}}">
You can’t perform that action at this time.
0 commit comments