Wiki-Quellcode von WizardStep
Zuletzt geändert von admin am 2025/02/23 10:22
Verstecke letzte Bearbeiter
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | {{velocity output="false"}} |
| 2 | #set ($awmSteps = ['name', 'structure', 'entries', 'presentation']) | ||
| 3 | |||
| 4 | #macro (appWizardHeader $stepId) | ||
| 5 | <div class="wizard-header"> | ||
| 6 | #set ($stepNumber = $awmSteps.indexOf($stepId) + 1) | ||
| 7 | #set ($stepTitle = $services.localization.render("appWithinMinutes.wizardStep.${stepId}.title")) | ||
| 8 | <h2>$services.localization.render('platform.appwithinminutes.wizardStepHeading', [$stepNumber, $stepTitle])</h2> | ||
| 9 | <ul class="steps"> | ||
| 10 | #foreach ($step in $awmSteps) | ||
| 11 | #set ($index = $foreach.index + 1) | ||
| 12 | #set ($extraClassName = "#if ($stepNumber == $index) step-active#elseif ($stepNumber > $index) step-done#end") | ||
| 13 | <li> | ||
| 14 | <span class="btn btn-xs number$extraClassName"> | ||
| 15 | #if ($stepNumber > $index) | ||
| 16 | $services.icon.renderHTML('check') | ||
| 17 | #else | ||
| 18 | $index | ||
| 19 | #end | ||
| 20 | </span> | ||
| 21 | <span class="name$extraClassName"> | ||
| 22 | $services.localization.render("appWithinMinutes.wizardStep.${step}.name") | ||
| 23 | </span> | ||
| 24 | </li> | ||
| 25 | #end | ||
| 26 | </ul> | ||
| 27 | <div class="clearfloats"></div> | ||
| 28 | </div> | ||
| 29 | #end | ||
| 30 | |||
| 31 | #macro (appWizardFooter $stepId) | ||
| 32 | <div class="wizard-footer buttons"> | ||
| 33 | #set ($nextLabel = $services.localization.render('platform.appwithinminutes.wizardStepNextButtonLabel')) | ||
| 34 | #set ($nextTip = $services.localization.render('platform.appwithinminutes.wizardStepNextButtonTip')) | ||
| 35 | #if ($stepId == 'presentation') | ||
| 36 | #set ($nextLabel = $services.localization.render('platform.appwithinminutes.wizardStepFinishButtonLabel')) | ||
| 37 | #set ($nextTip = $services.localization.render('platform.appwithinminutes.wizardStepFinishButtonTip')) | ||
| 38 | #set ($templateProviderReference = "$stringtool.removeEnd($classReference, 'Class')TemplateProvider") | ||
| 39 | #set ($previousURL = $xwiki.getURL($templateProviderReference, 'edit', | ||
| 40 | 'wizard=true&sheet=AppWithinMinutes.TemplateProviderEditSheet')) | ||
| 41 | #elseif ($stepId == 'entries') | ||
| 42 | #set ($classReference = "$stringtool.removeEnd($doc.fullName, 'TemplateProvider')Class") | ||
| 43 | #set ($previousURL = $xwiki.getURL($classReference, 'edit', 'wizard=true')) | ||
| 44 | #elseif ($stepId == 'structure' && $doc.isNew()) | ||
| 45 | #set ($previousURL = $xwiki.getURL('AppWithinMinutes.CreateApplication', 'view', 'wizard=true')) | ||
| 46 | #end | ||
| 47 | #if ($previousURL) | ||
| 48 | <span class="buttonwrapper left"> | ||
| 49 | <a href="$previousURL" class="button secondary" title="$escapetool.xml($services.localization.render( | ||
| 50 | 'platform.appwithinminutes.wizardStepPreviousButtonTip'))">$escapetool.xml($services.localization.render( | ||
| 51 | 'platform.appwithinminutes.wizardStepPreviousButtonLabel'))</a> | ||
| 52 | </span> | ||
| 53 | #end | ||
| 54 | <span class="buttonwrapper"> | ||
| 55 | <input type="submit" id="wizard-next" name="xaction_save" value="$escapetool.xml($nextLabel)" | ||
| 56 | title="$escapetool.xml($nextTip)" class="button"/> | ||
| 57 | </span> | ||
| 58 | </div> | ||
| 59 | #end | ||
| 60 | {{/velocity}} | ||
| 61 | |||
| 62 | {{velocity}} | ||
| 63 | #if ($doc.fullName == 'AppWithinMinutes.WizardStep') | ||
| 64 | Code shared by all AppWithinMinutes wizard steps. | ||
| 65 | #else | ||
| 66 | ## Use the style sheet and the JavaScript code required by the velocity macros previously defined. | ||
| 67 | #set ($discard = $xwiki.ssfx.use('uicomponents/wizard/wizard.css', true)) | ||
| 68 | #set ($discard = $xwiki.jsx.use('AppWithinMinutes.WizardStep')) | ||
| 69 | #end | ||
| 70 | {{/velocity}} |