-
Notifications
You must be signed in to change notification settings - Fork 17
/
wizard.html
50 lines (47 loc) · 1.32 KB
/
wizard.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
<template name="wizard">
{{#with innerContext ..}}
<div id="{{wizard.id}}" class="wizard">
{{> Template.dynamic template=wizard.stepsTemplate}}
{{> Template.dynamic template=activeStepTemplate}}
</div>
{{/with}}
</template>
<template name="__wizard_steps">
<div class="steps">
<ol>
{{#each wizard.steps}}
<li class="{{activeStepClass id}}">
{{#if pathForStep id}}
<a href="{{pathForStep id}}">{{title}}</a>
{{else}}
{{title}}
{{/if}}
</li>
{{/each}}
</ol>
</div>
</template>
<template name="__wizard_step">
<div class="wizard-step">
{{#autoForm id=step.formId doc=step.data schema=step.schema}}
{{#each afFieldNames}}
{{> afQuickField name=this.name options=afOptionsFromSchema}}
{{/each}}
{{> wizardButtons}}
{{/autoForm}}
</div>
</template>
<template name="wizardButtons">
{{#with wizard}}
<nav class="wizard-nav">
{{#if showBackButton}}
<button type="button" class="wizard-back-button {{buttonClasses}}">{{backButton}}</button>
{{/if}}
{{#if isLastStep}}
<button type="submit" class="wizard-submit-button {{buttonClasses}}">{{confirmButton}}</button>
{{else}}
<button type="submit" class="wizard-next-button {{buttonClasses}}">{{nextButton}}</button>
{{/if}}
</nav>
{{/with}}
</template>