Wiki source code of WizardStep
Last modified by Andrey Che on 2018/12/10 14:08
Hide last authors
| |
1.1 | 1 | {{velocity output="false"}} |
| 2 | #set ($awmSteps = ['name', 'structure', 'entries', 'presentation']) | ||
| 3 | #macro(appWizardHeader $stepId) | ||
| 4 | {{html wiki="true"}} | ||
| 5 | (% class="wizard-header" %) | ||
| 6 | ((( | ||
| 7 | #set($stepNumber = $awmSteps.indexOf($stepId) + 1) | ||
| 8 | #set($stepTitle = $services.localization.render("appWithinMinutes.wizardStep.${stepId}.title")) | ||
| 9 | = $services.localization.render('platform.appwithinminutes.wizardStepHeading', [$stepNumber, $stepTitle]) = | ||
| 10 | |||
| 11 | (% class="steps" %) | ||
| 12 | #foreach($step in $awmSteps) | ||
| 13 | #set($index = $foreach.index + 1) | ||
| 14 | #set($extraClassName = "#if($stepNumber == $index) active#elseif($stepNumber > $index) done#end") | ||
| 15 | * (% class="number$extraClassName" %)#if($stepNumber > $index)&${escapetool.h}10004;#else$index#end(%%) (% class="name$extraClassName" %)$services.localization.render("appWithinMinutes.wizardStep.${step}.name") | ||
| 16 | #end | ||
| 17 | |||
| 18 | <div class="clearfloats"></div> | ||
| 19 | ))) | ||
| 20 | {{/html}} | ||
| 21 | #end | ||
| 22 | |||
| 23 | #macro(appWizardFooter $stepId) | ||
| 24 | {{html wiki="true"}} | ||
| 25 | (% class="wizard-footer buttons" %) | ||
| 26 | ((( | ||
| 27 | #set($nextLabel = $services.localization.render('platform.appwithinminutes.wizardStepNextButtonLabel')) | ||
| 28 | #set($nextTip = $services.localization.render('platform.appwithinminutes.wizardStepNextButtonTip')) | ||
| 29 | #if($stepId == 'presentation')## | ||
| 30 | #set($nextLabel = $services.localization.render('platform.appwithinminutes.wizardStepFinishButtonLabel')) | ||
| 31 | #set($nextTip = $services.localization.render('platform.appwithinminutes.wizardStepFinishButtonTip')) | ||
| 32 | #set($templateProviderReference = "$stringtool.removeEnd($className, 'Class')TemplateProvider") | ||
| 33 | #set($previousURL = $xwiki.getURL($templateProviderReference, 'edit', | ||
| 34 | 'wizard=true&sheet=AppWithinMinutes.TemplateProviderEditSheet')) | ||
| 35 | #elseif($stepId == 'entries') | ||
| 36 | #set($classReference = "$stringtool.removeEnd($doc.fullName, 'TemplateProvider')Class") | ||
| 37 | #set($previousURL = $xwiki.getURL($classReference, 'edit', 'wizard=true')) | ||
| 38 | #elseif($stepId == 'structure' && $doc.isNew())## | ||
| 39 | #set($previousURL = $xwiki.getURL('AppWithinMinutes.CreateApplication')) | ||
| 40 | #end | ||
| 41 | #if($previousURL)## | ||
| 42 | <span class="buttonwrapper left"><a href="$previousURL" title="$escapetool.xml($services.localization.render('platform.appwithinminutes.wizardStepPreviousButtonTip'))" class="button secondary">$escapetool.xml($services.localization.render('platform.appwithinminutes.wizardStepPreviousButtonLabel'))</a></span>## | ||
| 43 | #end | ||
| 44 | <span class="buttonwrapper"><input type="submit" id="wizard-next" name="xaction_save" value="$escapetool.xml($nextLabel)" title="$escapetool.xml($nextTip)" class="button"/></span> | ||
| 45 | ))) | ||
| 46 | {{/html}} | ||
| 47 | #end | ||
| 48 | {{/velocity}} | ||
| 49 | |||
| 50 | {{velocity}} | ||
| 51 | #if($doc.fullName == 'AppWithinMinutes.WizardStep') | ||
| 52 | Code shared by all AppWithinMinutes wizard steps. | ||
| 53 | #else | ||
| 54 | ## Use the style sheet and the JavaScript code required by the velocity macros previously defined. | ||
| 55 | #set($discard = $xwiki.ssfx.use('uicomponents/wizard/wizard.css', true)) | ||
| 56 | #set($discard = $xwiki.jsx.use('AppWithinMinutes.WizardStep')) | ||
| 57 | #end | ||
| 58 | {{/velocity}} |