Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | {if count( $wizard.steps ) > 1} | |
11 | {* wizard.style variable is passed by some Wizards to allow alternate styling for progress "bar". *} | |
12 | <div id="wizard-steps"> | |
13 | <ul class="wizard-bar{if $wizard.style.barClass}-{$wizard.style.barClass}{/if}"> | |
14 | {section name=step loop=$wizard.steps} | |
15 | {if count ( $wizard.steps ) > 5 } | |
16 | {* truncate step titles so header isn't too wide *} | |
17 | {assign var="title" value=$wizard.steps[step].title|crmFirstWord} | |
18 | {else} | |
19 | {assign var="title" value=$wizard.steps[step].title} | |
20 | {/if} | |
21 | {* Show each wizard link unless collapsed value is true. Also excluding quest app submit steps. Should create separate WizardHeader for Quest at some point.*} | |
22 | {if !$wizard.steps[step].collapsed && $wizard.steps[step].name NEQ 'Submit' && $wizard.steps[step].name NEQ 'PartnerSubmit'} | |
23 | {assign var=i value=$smarty.section.step.iteration} | |
24 | {if $wizard.currentStepNumber > $wizard.steps[step].stepNumber} | |
25 | {if $wizard.steps[step].step} | |
26 | {assign var="stepClass" value="past-step"} | |
27 | {else} {* This is a sub-step *} | |
28 | {assign var="stepClass" value="past-sub-step"} | |
29 | {/if} | |
30 | {if $wizard.style.hideStepNumbers} | |
31 | {assign var="stepPrefix" value=$wizard.style.subStepPrefixPast} | |
32 | {else} | |
33 | {assign var="stepPrefix" value=$wizard.style.stepPrefixPast|cat:$wizard.steps[step].stepNumber|cat:". "} | |
34 | {/if} | |
35 | {elseif $wizard.currentStepNumber == $wizard.steps[step].stepNumber} | |
36 | {if $wizard.steps[step].step} | |
37 | {assign var="stepClass" value="current-step"} | |
38 | {else} | |
39 | {assign var="stepClass" value="current-sub-step"} | |
40 | {/if} | |
41 | {if $wizard.style.hideStepNumbers} | |
42 | {assign var="stepPrefix" value=$wizard.style.subStepPrefixCurrent} | |
43 | {else} | |
44 | {assign var="stepPrefix" value=$wizard.style.stepPrefixCurrent|cat:$wizard.steps[step].stepNumber|cat:". "} | |
45 | {/if} | |
46 | {else} | |
47 | {if $wizard.steps[step].step} | |
48 | {assign var="stepClass" value="future-step"} | |
49 | {else} | |
50 | {assign var="stepClass" value="future-sub-step"} | |
51 | {/if} | |
52 | {if $wizard.style.hideStepNumbers} | |
53 | {assign var="stepPrefix" value=$wizard.style.subStepPrefixFuture} | |
54 | {else} | |
55 | {assign var="stepPrefix" value=$wizard.style.stepPrefixFuture|cat:$wizard.steps[step].stepNumber|cat:". "} | |
56 | {/if} | |
57 | {/if} | |
58 | {if !$wizard.steps[step].valid} | |
59 | {assign var="stepClass" value="$stepClass not-valid"} | |
60 | {/if} | |
31037a42 | 61 | {* wizard.steps[step].link value is passed for wizards/steps which allow clickable navigation *} |
6a488035 | 62 | <li class="{$stepClass}">{$stepPrefix}{if $wizard.steps[step].link}<a href="{$wizard.steps[step].link}">{/if}{$title}{if $wizard.steps[step].link}</a>{/if}</li> |
31037a42 | 63 | {/if} |
6a488035 TO |
64 | {/section} |
65 | </ul> | |
66 | </div> | |
67 | {if $wizard.style.showTitle} | |
68 | <h2>{$wizard.currentStepTitle} {ts 1=$wizard.currentStepNumber 2=$wizard.stepCount}(step %1 of %2){/ts}</h2> | |
69 | {/if} | |
70 | {/if} | |
71 |