Changes for page Download Version

Last modified by Simon Urli on 2023/10/10

From version 1.1 >
edited by Ecaterina Moraru (Valica)
on 2016/05/10
To version < 2.1 >
edited by Ecaterina Moraru (Valica)
on 2016/05/24
>
Change comment: Imported from XAR

Summary

Details

Page properties
Content
... ... @@ -1,18 +1,36 @@
1 1  {{velocity}}
2 2  $xwiki.ssx.use("Download.WebHome")
3 3  ## Parameters:
4 -## - downloadLink: link used to download the selected project version from the mirror site
4 +## - downloadURL: URL to the download
5 5  ## - projectVersion: specifies the project version
6 +## - email: passed in the request when submitting the form
6 6  ##
7 -#set ($downloadLink = $request.get('downloadLink'))
8 -#set ($projectVersion = $request.get('projectVersion'))
8 +#set ($downloadURL = $request.downloadURL)
9 +#set ($projectVersion = $request.projectVersion)
10 +#set ($userEmail = $request.userEmail)
11 +## If email is in the request then send the user's email by mail and redirect to the download
12 +#if ("$!userEmail" != '')
13 + ## Send the mail asynchronously
14 + #set ($message = $services.mailsender.createMessage("[email protected]", "New user registration"))
15 + #set ($discard = $message.addPart("text/plain", "$userEmail"))
16 + #set ($discard = $services.mailsender.sendAsynchronously([$message], 'database'))
17 + ## Perform the redirect
18 + #if ("$!downloadURL" != '')
19 + #set ($discard = $response.sendRedirect($downloadURL))
20 + #else
21 + ## Redirect to the Download home
22 + $set ($discard = $response.sendRedirect($xwiki.getURL('Download.WebHome')))
23 + #end
24 +#else
9 9  {{html}}
10 10  <div class="row">
11 11   <div class="col-xs-12">
12 - #if ($downloadLink && $projectVersion)
28 + #if ("$!downloadURL" != '' && "$!projectVersion" != '')
13 13   <div class="download-container border-green subscribe-area">
14 14   <h3 class="subscribe">Join the Community!</h3>
15 15   <form action="" class="xform">
32 + <input type="hidden" name="downloadURL" value="$downloadURL"/>
33 + <input type="hidden" name="projectVersion" value="$projectVersion"/>
16 16   <dl>
17 17   <dt>
18 18   <label for="user_email" class="hidden">Email</label>
... ... @@ -19,12 +19,12 @@
19 19   <span class="xHint">Enter your email address to receive news and updates about XWiki (new releases, security alerts, offers from <a href="#benefitsFromCompanies">top sponsoring companies</a>, tips and tricks, etc.)</span>
20 20   </dt>
21 21   <dd>
22 - <input type="email" placeholder="Email" autocomplete="off" name="user[email]" id="user_email" tabindex="1" autofocus/>
40 + <input type="email" placeholder="Email" autocomplete="off" name="userEmail" id="userEmail" tabindex="1" autofocus/>
23 23   </dd>
24 24   </dl>
25 25   <div class="buttons">
26 - <input type="submit" value="Download" class="btn btn-success" tabindex="2" disabled >
27 - <a class="btn btn-link btn-xs" href="$escapetool.xml($downloadLink)" tabindex="3" >Skip this form</a>
44 + <input type="submit" value="Download" class="btn btn-success" tabindex="2">
45 + <a class="btn btn-link btn-xs" href="$escapetool.xml($downloadURL)" tabindex="3" >Skip this form</a>
28 28   </span>
29 29   </div>
30 30   </form>
... ... @@ -33,6 +33,7 @@
33 33   </div>
34 34  </div>
35 35  {{/html}}
54 +#end
36 36  {{/velocity}}
37 37  
38 38  {{html clean='false'}}

Get Connected