forked from letsblockit/letsblockit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathview-filter-param.hbs
81 lines (81 loc) · 3.89 KB
/
view-filter-param.hbs
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
71
72
73
74
75
76
77
78
79
80
81
{{#with OnlyIf}}<cond-visible only-if="{{this}}">{{/with}}
{{#if (eq type "checkbox")}}
<div class="mb-3 form-check form-switch">
<input type="checkbox" role="switch" class="form-check-input" id="{{name}}" name="{{name}}"
{{#equal true (lookup @root.data.params name)}}checked{{/equal}}>
<label class="form-check-label" for="{{name}}">
{{description}}{{>view-filter-param-link this}}
{{>view-filter-pill-new name}}
</label>
</div>
{{else if (eq type "string")}}
<div class="mb-3">
<label class="form-label" for="{{name}}">
{{description}}{{>view-filter-param-link this}}:
{{>view-filter-pill-new name}}
</label>
<input class="form-control" id="{{name}}" name="{{name}}" spellcheck="false"
value="{{lookup @root.data.params name}}">
</div>
{{else if (eq type "multiline")}}
<div class="mb-3">
<label class="form-label" for="{{name}}">
{{description}}{{>view-filter-param-link this}}:
{{>view-filter-pill-new name}}
</label>
<textarea class="form-control" id="{{name}}" name="{{name}}" spellcheck="false" rows="10">
{{~lookup @root.data.params name}}</textarea>
</div>
{{else if (eq type "list")}}
<fieldset class="row mb-3">
<legend class="col-form-label col-sm-auto pt-0">
{{description}}{{>view-filter-param-link this}}:
{{>view-filter-pill-new name}}
</legend>
<div class="col-lg-9">
{{#each (lookup_list @root.data.params name)}}
<div class="input-group mb-1">
<input type="text" class="form-control" name="{{name}}" spellcheck="false" value="{{this}}">
<button class="btn btn-outline-success" type="button"
aria-label="Add a row below"
title="Add a row below" onclick="addFilterParamRow(this);">
{{>icon name="plus" stroke=2.5}}
</button>
<button class="btn btn-outline-primary" type="button"
aria-label="Delete this row"
title="Delete this row" onclick="deleteFilterParamRow(this);">
{{>icon name="trash"}}
</button>
</div>
{{/each}}
<div class="input-group mb-1">
<input type="text" class="form-control" name="{{name}}" spellcheck="false">
<button class="btn btn-outline-success" type="button"
aria-label="Add a row below"
title="Add a row below" onclick="addFilterParamRow(this);">
{{>icon name="plus" stroke=2.5}}
</button>
<button class="btn btn-outline-primary" type="button"
aria-label="Delete this row"
title="Delete this row" onclick="deleteFilterParamRow(this);">
{{>icon name="trash"}}
</button>
</div>
{{#each presets}}
<div class="mb-1 form-check">
<input type="checkbox" class="form-check-input"
id="{{preset_name .. .}}" name="{{preset_name .. .}}"
{{#equal true (lookup @root.data.params (preset_name .. .))}}checked{{/equal}}>
<label class="form-check-label" for="{{preset_name .. .}}">
{{description}}
{{#with source}}
<span class="small ms-1">(<a href="{{source}}">source</a>)</span>
{{/with}}
{{>view-filter-pill-new (preset_name .. .)}}
</label>
</div>
{{/each}}
</div>
</fieldset>
{{/if}}
{{#with OnlyIf}}</cond-visible>{{/with}}