Skip to content

Commit c21ee7b

Browse files
committed
* move error alert after submit
* hide submit on workflow not found
1 parent d6fd451 commit c21ee7b

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

templates/repo/actions/workflow_dispatch.tmpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
<div id="runWorkflowDispatchModalInputs">
5353
{{template "repo/actions/workflow_dispatch_inputs" .}}
5454
</div>
55-
56-
<button class="ui tiny primary button" type="submit">Submit</button>
5755
</form>
5856
</div>
5957
</div>

templates/repo/actions/workflow_dispatch_inputs.tmpl

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
1+
{{if not .WorkflowDispatchConfig}}
2+
<div class="ui red info message tw-flex tw-justify-between tw-items-center">
3+
<span class="ui text middle">{{ctx.Locale.Tr "actions.workflow.not_found" $.CurWorkflow}}</span>
4+
</div>
5+
{{else}}
6+
{{range $item := .WorkflowDispatchConfig.Inputs}}
7+
<div class="ui field {{if .Required}}required{{end}}">
8+
{{if eq .Type "choice"}}
9+
<label>{{Iif .Description .Description .Name}}:</label>
10+
<select class="ui selection type dropdown" name="{{.Name}}">
11+
{{range .Options}}
12+
<option value="{{.}}" {{if eq $item.Default .}}selected{{end}} >{{.}}</option>
13+
{{end}}
14+
</select>
15+
{{else if eq .Type "boolean"}}
16+
<div class="ui inline checkbox">
17+
<label>{{Iif .Description .Description .Name}}</label>
18+
<input type="checkbox" name="{{.Name}}" {{if eq .Default "true"}}checked{{end}}>
19+
</div>
20+
{{else if eq .Type "number"}}
21+
<label>{{Iif .Description .Description .Name}}:</label>
22+
<input name="{{.Name}}" value="{{.Default}}" {{if .Required}}required{{end}}>
23+
{{else}}
24+
<label>{{Iif .Description .Description .Name}}:</label>
25+
<input name="{{.Name}}" value="{{.Default}}" {{if .Required}}required{{end}}>
26+
{{end}}
27+
</div>
28+
{{end}}
29+
<button class="ui tiny primary button" type="submit">Submit</button>
30+
{{end}}
131
{{range .workflows}}
232
{{if and .ErrMsg (eq .Entry.Name $.CurWorkflow)}}
333
<span data-tooltip-content="{{.ErrMsg}}">
434
{{svg "octicon-alert" 16 "text red"}}
535
</span>
636
{{end}}
737
{{end}}
8-
{{range $item := .WorkflowDispatchConfig.Inputs}}
9-
<div class="ui field {{if .Required}}required{{end}}">
10-
{{if eq .Type "choice"}}
11-
<label>{{Iif .Description .Description .Name}}:</label>
12-
<select class="ui selection type dropdown" name="{{.Name}}">
13-
{{range .Options}}
14-
<option value="{{.}}" {{if eq $item.Default .}}selected{{end}} >{{.}}</option>
15-
{{end}}
16-
</select>
17-
{{else if eq .Type "boolean"}}
18-
<div class="ui inline checkbox">
19-
<label>{{Iif .Description .Description .Name}}</label>
20-
<input type="checkbox" name="{{.Name}}" {{if eq .Default "true"}}checked{{end}}>
21-
</div>
22-
{{else if eq .Type "number"}}
23-
<label>{{Iif .Description .Description .Name}}:</label>
24-
<input name="{{.Name}}" value="{{.Default}}" {{if .Required}}required{{end}}>
25-
{{else}}
26-
<label>{{Iif .Description .Description .Name}}:</label>
27-
<input name="{{.Name}}" value="{{.Default}}" {{if .Required}}required{{end}}>
28-
{{end}}
29-
</div>
30-
{{end}}

0 commit comments

Comments
 (0)