-
Notifications
You must be signed in to change notification settings - Fork 1
/
wizard-templates.html
177 lines (167 loc) · 5.6 KB
/
wizard-templates.html
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<template name="maWizardOk">
<button class="btn btn-default" data-ma-wizard-ok>
{{#if label}}
{{label}}
{{else}}
Ok
{{/if}}
</button>
</template>
<template name="maWizardSave">
<button class="btn btn-default" data-ma-wizard-save>
{{#if label}}
{{label}}
{{else}}
Save
{{/if}}
</button>
</template>
<template name="maWizardDiscard">
<button class="btn btn-default" data-ma-wizard-discard>
{{#if label}}
{{label}}
{{else}}
Discard changes
{{/if}}
</button>
</template>
<template name="maWizardCreate">
<button class="btn btn-default" data-ma-wizard-create>
{{#if label}}
{{label}}
{{else}}
Create
{{/if}}
</button>
</template>
<template name="maWizardDelete">
<button class="btn btn-danger" data-ma-wizard-delete>
{{#if label}}
{{label}}
{{else}}
Delete
{{/if}}
</button>
</template>
<template name="maWizardBack">
<button class="btn btn-default" data-ma-wizard-back>
{{#if label}}
{{label}}
{{else}}
Back
{{/if}}
</button>
</template>
<template name="maWizardTextInput">
{{#if maWizardIsFieldActive field}}
<div class="form-group {{maWizardFieldValidity field}}">
<label class="control-label">
{{#if label}}
{{label}}
{{else}}
{{maWizardGetFieldLabel field}}
{{/if}}
</label>
{{#if placeholder}}
<input type="text" class="form-control " data-ma-wizard-control placeholder={{placeholder}} value={{maWizardGetFieldValue field}} data-schemafield={{field}} autofocus maxlength={{maWizardMaxLength field}}>
{{else}}
<input type="text" class="form-control " data-ma-wizard-control placeholder="{{maWizardGetFieldLabel field}}..." value={{maWizardGetFieldValue field}} data-schemafield={{field}} autofocus maxlength={{maWizardMaxLength field}}>
{{/if}}
<span class="help-block">{{maWizardErrMsg field}}</span>
</div>
{{/if}}
</template>
<template name="maWizardTextarea">
{{#if maWizardIsFieldActive field}}
<div class="form-group {{maWizardFieldValidity field}}">
<label class="control-label">
{{#if label}}
{{label}}
{{else}}
{{maWizardGetFieldLabel field}}
{{/if}}
</label>
{{#if placeholder}}
<textarea class="form-control " data-ma-wizard-control placeholder={{placeholder}} value="{{maWizardGetFieldValue field}}" data-schemafield={{field}} maxlength={{maWizardMaxLength field}}></textarea>
{{else}}
<textarea class="form-control " data-ma-wizard-control placeholder="{{maWizardGetFieldLabel field}}..." value="{{maWizardGetFieldValue field}}" data-schemafield={{field}} maxlength={{maWizardMaxLength field}}></textarea>
{{/if}}
<span class="help-block">{{maWizardErrMsg field}}</span>
</div>
{{/if}}
</template>
<template name="maWizardSelect">
{{#if maWizardIsFieldActive field}}
<div class="form-group field-type {{maWizardFieldValidity field}}">
<label class="control-label">
{{#if label}}
{{label}}
{{else}}
{{maWizardGetFieldLabel field}}
{{/if}}
</label>
<select required autocomplete="off" class="form-control simple-select" data-ma-wizard-control data-schemafield={{field}}>
{{#if placeholder}}
<option {{maWizardOptionIsSelected field}} selected value="" data-placeholder="{{placeholder}}"></option>
{{else}}
<option {{maWizardOptionIsSelected field}} selected value="" data-placeholder="Select {{maWizardGetFieldLabel field}}"></option>
{{/if}}
{{#if values}}
{{#each values}}
<option value="{{value}}" {{maWizardOptionIsSelected ../field}}>{{label}}</option>
{{/each}}
{{else}}
{{#each maWizardAllowedValuesFromSchema field}}
<option value="{{value}}" {{maWizardOptionIsSelected ../field}}>{{label}}</option>
{{/each}}
{{/if}}
{{#if addRoute}}
<option value="route:{{addRoute}}">Add...</option>
{{/if}}
</select>
<span class="help-block">{{maWizardErrMsg field}}</span>
</div>
{{/if}}
</template>
<template name="maWizardMultiselect">
{{#if maWizardIsFieldActive field}}
<div class="form-group {{maWizardFieldValidity field}}">
<label class="control-label">
{{#if label}}
{{label}}
{{else}}
{{maWizardGetFieldLabel field}}
{{/if}}
</label>
<select class="multiselect form-control" data-ma-wizard-control multiple="multiple" data-schemafield={{field}}>
{{#if allowedValues}}
{{#each allowedValues}}
<option {{maWizardOptionIsSelected ../field}} value="{{value}}">{{label}}</option>
{{/each}}
{{else}}
{{#each maWizardAllowedValuesFromSchema field}}
<option {{maWizardOptionIsSelected ../field}} value="{{value}}">{{label}}</option>
{{/each}}
{{/if}}
{{#if addRoute}}
<option value="route:{{addRoute}}">Add...</option>
{{/if}}
</select>
</div>
<span class="help-block">{{maWizardErrMsg field}}</span>
{{/if}}
</template>
<template name="maWizardCheckbox">
{{#if maWizardIsFieldActive field}}
<div class="checkbox">
<label>
<input class="form-checkbox " data-ma-wizard-control type="checkbox" {{isChecked this.field}} data-schemafield={{field}}>
{{#if label}}
{{label}}
{{else}}
{{maWizardGetFieldLabel field}}
{{/if}}
</label>
</div>
{{/if}}
</template>