<
From version < 4.4 >
edited by Administrator
on 2018/04/20 09:51
To version < 6.1 >
edited by Alex Cotiugă
on 2018/05/15 15:37
>
Change comment: Install extension [com.xwiki.store:application-store-ui-1.9]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Admin
1 +XWiki.AlexCotiuga
Content
... ... @@ -2,9 +2,16 @@
2 2  
3 3  {{velocity output="false"}}
4 4  #macro (getPriceMatrix $skus)
5 + ## Make sure the rows are sorted by support level.
5 5   #set ($priceMatrix = {
6 6   'columns': $collectionstool.sortedSet,
7 - 'rows': $collectionstool.orderedMap
8 + 'rows': {
9 + 'bronze': {},
10 + 'silver': {},
11 + 'gold': {},
12 + 'platinum': {},
13 + 'diamond': {}
14 + }
8 8   })
9 9   #foreach ($sku in $skus)
10 10   #set ($support = "$!sku.support")
... ... @@ -20,6 +20,13 @@
20 20   #set ($discard = $priceMatrix.columns.add($users))
21 21   #end
22 22   #end
30 + #set ($emptyRows = [])
31 + #foreach ($entry in $priceMatrix.rows.entrySet())
32 + #if ($entry.value.isEmpty())
33 + #set ($discard = $emptyRows.add($entry.key))
34 + #end
35 + #end
36 + #set ($discard = $priceMatrix.rows.keySet().removeAll($emptyRows))
23 23  #end
24 24  
25 25  #macro (findSKUMatchingCurrentLicense $priceMatrix $minUserCount $currentLicenseDetails)
... ... @@ -267,8 +267,13 @@
267 267   </dl>
268 268   #benefits
269 269   <p>
270 - <input type="submit" class="button btn-success"#if (!$selectedSKU) disabled="disabled" #end
284 + #if ($selectedSKU)
285 + <input type="submit" class="button btn-success"
271 271   value="$escapetool.xml($services.localization.render('store.buyLicense.submit'))"/>
287 + #else
288 + <input type="button" id="requestLicense" class="button btn-success"
289 + value="$escapetool.xml($services.localization.render('store.requestLicense.button'))"/>
290 + #end
272 272   </p>
273 273   </form>
274 274  #end
XWiki.JavaScriptExtension[0]
Code
... ... @@ -54,4 +54,17 @@
54 54   submitButton.prop('disabled', false);
55 55   });
56 56   });
57 +
58 + // Request a license
59 + $('#requestLicense').click(function(event) {
60 + var progressNotification = new XWiki.widgets.Notification($jsontool.serialize($services.localization.render(
61 + 'store.requestLicense.button.inProgress')), 'inprogress');
62 + var url = new XWiki.Document('RequestLicense', 'Store.Code').getURL('get', 'outputSyntax=plain');
63 + $.post(url, $('form#buyLicense').serialize()).done(function(result) {
64 + progressNotification.replace(new XWiki.widgets.Notification(result.notification, result.status));
65 + }).fail(function(result) {
66 + progressNotification.replace(
67 + new XWiki.widgets.Notification(result.responseJSON.notification, result.responseJSON.status));
68 + });
69 + });
57 57  });
XWiki SAS Copyright © 2024