Skip to content

Commit cdec7a6

Browse files
committed
Pattern and template spacing
Signed-off-by: jolheiser <[email protected]>
1 parent 8de2a6b commit cdec7a6

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

modules/webhook/webhook.go

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ type Form struct {
4646
Type string `yaml:"type"`
4747
Required bool `yaml:"required"`
4848
Default string `yaml:"default"`
49+
Pattern string `yaml:"pattern"`
4950
}
5051

5152
// InputType returns the HTML input type of a Form.Type

templates/repo/settings/webhook/custom.tmpl

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@
1010
{{range .CustomHook.Form}}
1111
<div class="field {{if .Required}}required{{end}} {{if ne (index $ (printf "Err_%s" .ID)) nil}}error{{end}}">
1212
<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+
>
1423
</div>
1524
{{end}}
1625
<div class="field {{if .Err_Secret}}error{{end}}">

0 commit comments

Comments
 (0)