%PDF- %PDF-
Direktori : /home/waritko/jetty-distribution-9.4.21.v20190926/webapps/ROOT/templates/ |
Current File : //home/waritko/jetty-distribution-9.4.21.v20190926/webapps/ROOT/templates/distribution.vm |
#macro(handleStepAction $action) ## Allow the current step to handle the action or to perform something before moving to the next step. #set ($discard = $services.distribution.renderCurrentStepToXHTML()) ## Standard step actions are in upper case (custom step actions should be in camel case). #set ($xredirect = $request.xredirect) #if ($action == $action.toUpperCase()) #set ($distributionJobStatus = $services.distribution.jobStatus) #set ($distributionQuestion = $distributionJobStatus.question) #if ($distributionQuestion) #if ($action.endsWith('_STEP')) ## Action that targets the current step. #set ($actionToState = { 'COMPLETE_STEP': 'COMPLETED', 'SKIP_STEP': $NULL, 'CANCEL_STEP': 'CANCELED'}) #set ($discard = $distributionQuestion.step.setState($actionToState.get($action))) #else ## Action that targets the wizard (skip/cancel). #if ($action == 'REPLAY') #set ($action = 'SKIP') #set ($xredirect = $xwiki.getURL('XWiki.ExtensionHistory', 'view', 'xpage=view&viewer=extensionHistory')) #end #set ($discard = $distributionQuestion.setAction($action)) #end #set ($discard = $distributionJobStatus.answered()) #end #end $response.sendRedirect($xwiki.getURL('XWiki.Distribution', 'distribution', "xredirect=$!escapetool.url($xredirect)")) #end #macro(displayStep) #template('xwikivars.vm') #template('htmlheader.vm') ## Make sure the browser won't keep the same version of the resource in cache from one version of XWiki to another #set($environmentVersion = $services.distribution.distributionExtension.id.version) $xwiki.ssfx.use('uicomponents/wizard/wizard.css', {'forceSkinAction': true, 'version': $environmentVersion}) $xwiki.ssfx.use('uicomponents/extension/distribution.css', {'forceSkinAction': true, 'version': $environmentVersion}) $xwiki.jsfx.use('uicomponents/extension/distribution.js', {'forceSkinAction': true, 'version': $environmentVersion}) <div id="distributionWizard"> <div class="xdialog-screen"></div> <div class="xdialog-box"> <div class="xdialog-header"> #set($themeDocFullName = "$!xwiki.getUserPreference('colorTheme')") #set($themeDoc = $xwiki.getDocument($themeDocFullName)) #set($logoname = $themeDoc.getObject('ColorThemes.ColorThemeClass').getProperty('logoImage').value) #if("$!{logoname}" != '') #set($logourl = $themeDoc.getAttachmentURL($logoname)) #else #set($logourl = $xwiki.getSkinFile('uicomponents/extension/logo.png')) #end <img alt="XWiki Logo" src="$logourl"/> </div> #set ($currentStep = $services.distribution.jobStatus.question.step) #set ($stepId = $currentStep.id) <div#if($stepId) id="$stepId"#end class="xdialog-content"> #if ($request.extensionId) ## The user can get here by clicking on an extension link. #handleExtensionRequest() #else #displayStepHeader($stepId) #set ($formOpenTag = '<form action="" class="xform">') #set ($stepOutput = $services.distribution.renderCurrentStepToXHTML()) #if (!$stepOutput.contains('<form') && ($stepOutput.contains('<input') || $stepOutput.contains('<select') || $stepOutput.contains('<textarea'))) ## This step has input elements without a form element so we let the step buttons submit the step data. $formOpenTag $stepOutput #else ## This step contains at least one form element or no input elements so the step controls how its data is ## submitted. $stepOutput $formOpenTag #end #displayStepFooter() </form> #end </div> </div> </div> #template('htmlfooter.vm') #end #macro(displayStepHeader $currentStepId) <div class="wizard-header"> #set ($currentStepIndex = $services.distribution.jobStatus.currentStateIndex) <h1>$services.localization.render('platform.extension.distributionWizard.stepHeading', [$currentStepIndex, $services.localization.render("platform.extension.distributionWizard.${currentStepId}StepTitle")])</h1> #set ($steps = $services.distribution.jobStatus.steps) ## Ignore the welcome step. #set ($steps = $steps.subList(1, $steps.size())) ## Ignore the report step #set($lastElement = $steps.size() - 1) #set ($steps = $steps.subList(0, $lastElement)) <ul class="steps"> #foreach ($step in $steps) <li> #set ($stepStatus = '') #set ($stepNumber = $velocityCount) #if ($step.id == $currentStepId) #set ($stepStatus = " active") #elseif($velocityCount < $currentStepIndex) #set ($stepStatus = " done") #set ($stepNumber = '✔') #end <span class="number$stepStatus">$stepNumber</span> <span class="name$stepStatus"> $services.localization.render("platform.extension.distributionWizard.${step.id}StepTitle") </span> </li> #end </ul> <div class="clearfloats"></div> </div> #end #macro(displayStepFooter) <div id="stepButtons" class="wizard-footer buttons"> #if ($request.xredirect) <input type="hidden" name="xredirect" value="$escapetool.xml($request.xredirect)" /> #end ## Normally we shouldn't generate the buttons that are not supposed to be visible but we want to simplify the ## JavaScript code and to avoid duplicating the HTML by adding the buttons dynamically. <span class="buttonwrapper#if (!$showCompleteStepButton) hidden#end"> <button type="submit" name="action" value="COMPLETE_STEP"#if ($disableStepButtons) disabled="disabled"#end> $services.localization.render('platform.extension.distributionWizard.continueLabel') </button> </span> <span class="dynamic-button-group align-right inside"> <span class="buttonwrapper#if ($showCompleteStepButton && !$canCloseWizard) hidden#end"> <button class="secondary" type="submit" name="action" value="SKIP#if(!$canCloseWizard)_STEP#end" title="$escapetool.xml($services.localization.render('platform.extension.distributionWizard.skipHint'))" #if ($disableStepButtons) disabled="disabled"#end> $services.localization.render('platform.extension.distributionWizard.skipLabel') </button> </span> #if ($canCloseWizard) <span class="buttonwrapper"> #set ($hint = $services.localization.render('platform.extension.distributionWizard.replayHint')) <button class="secondary" type="submit" name="action" value="REPLAY" title="$escapetool.xml($hint)" #if ($disableStepButtons) disabled="disabled"#end> $services.localization.render('platform.extension.distributionWizard.replayLabel') </button> </span> #end </span> <span class="buttonwrapper#if ($showCompleteStepButton && !$canCloseWizard) hidden#end"> <button class="secondary" type="submit" name="action" value="CANCEL#if(!$canCloseWizard)_STEP#end" title="$escapetool.xml($services.localization.render('platform.extension.distributionWizard.cancelHint'))" #if ($disableStepButtons) disabled="disabled"#end> $services.localization.render('platform.extension.distributionWizard.cancelLabel') </button> </span> </div> #end #set ($extensionConfig = {}) ## FIXME: refactor distribution.vm to let steps deal with all request, even extension related requests #if ($services.distribution.jobStatus.currentStep.id == 'extension.defaultui' || $services.distribution.jobStatus.currentStep.id == 'extension.flavor') ## Install main wiki default UI JARS on root #if ($xcontext.isMainWiki()) #set ($discard = $extensionConfig.put('installJAROnRoot', true)) #end #end ## Keep displaying the wizard after the distribution job is done if the request targets a specific extension (e.g. if ## you follow the link to an extension dependency). #if ($services.distribution.jobStatus.state == 'FINISHED' && "$!request.extensionId" == '') #set ($redirectURL = $request.xredirect) #if ("$!redirectURL" == '') #set ($redirectURL = $xwiki.getURL($services.model.resolveDocument('', 'default'))) #end $response.sendRedirect($redirectURL) #else #template('extension.vm') #if ("$!request.action" != '') #handleStepAction($request.action) #elseif ($isAjaxRequest) #if ($request.extensionId) #handleExtensionRequest() #else ## Let the current step handle the AJAX request. $services.distribution.renderCurrentStepToXHTML() #end #else #displayStep() #end #end