Skip to content

Commit 40e3539

Browse files
vparomskiyashvayka
authored andcommitted
enable trendz trial with confirmation dialog
1 parent c9d9383 commit 40e3539

File tree

3 files changed

+61
-18
lines changed

3 files changed

+61
-18
lines changed

_layouts/pricing.html

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
}
7070
}
7171

72-
function getLicense(event, isPerpetual, productId, planId, productName, coupon) {
72+
function getLicense(event, isPerpetual, productId, planId, productName, coupon, showConfirmDialog) {
7373
event.preventDefault();
7474
var e = $(event.target);
7575
var url = "https://license.thingsboard.io/signup?createSubscription=true&perpetual=";
@@ -84,8 +84,37 @@
8484
url += "&coupon="+coupon;
8585
}
8686

87-
reportPriceLink(url, productName + '/' + productId);
88-
window.open(url, "_blank");
87+
if(showConfirmDialog) {
88+
openTrendzConfirmDialog(url, productName + '/' + productId);
89+
} else {
90+
reportPriceLink(url, productName + '/' + productId);
91+
window.open(url, "_blank");
92+
}
93+
}
94+
95+
function openTrendzConfirmDialog(url, product) {
96+
var dialogTemplate = "<ul class='trndz_dialog_list'>\n" +
97+
"<li>You won't be charged until after your free month.</li>\n" +
98+
"<li>We'll remind you three days before your trial ends.</li>\n" +
99+
"<li>Cancel anytime.</li>\n" +
100+
"</ul>";
101+
102+
swal({
103+
title: "Set up your Trendz License",
104+
html: true,
105+
text: dialogTemplate,
106+
allowOutsideClick: true,
107+
cancelButtonText: "Cancel",
108+
showCancelButton: true,
109+
confirmButtonText: "Proceed to License Portal",
110+
confirmButtonColor: '#506dad',
111+
customClass: 'trndz-swal-license'
112+
}, function(isConfirm) {
113+
if (isConfirm) {
114+
reportPriceLink(url, product);
115+
window.open(url, "_blank");
116+
}
117+
});
89118
}
90119

91120
function reportPriceLink(link, product) {

pricing/index.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ description: ThingsBoard Products Pricing
121121
false,
122122
'20be6f50-a18e-11e9-8e16-03828ff5271c',
123123
'7ef31a80-a18e-11e9-8e16-03828ff5271c',
124-
'Maker')">
124+
'Maker', null, false)">
125125
Get your license
126126
</a>
127127
<div class="pricing-square-item" data-faq-id="community-support">
@@ -150,7 +150,7 @@ description: ThingsBoard Products Pricing
150150
false,
151151
'20be6f50-a18e-11e9-8e16-03828ff5271c',
152152
'0e236dc0-a196-11e9-8e16-03828ff5271c',
153-
'Prototype')">
153+
'Prototype', null, false)">
154154
Get your license
155155
</a>
156156
<div class="pricing-square-item" data-faq-id="community-support">
@@ -179,7 +179,7 @@ description: ThingsBoard Products Pricing
179179
false,
180180
'20be6f50-a18e-11e9-8e16-03828ff5271c',
181181
'8ac6d190-a197-11e9-8e16-03828ff5271c',
182-
'Startup')">
182+
'Startup', null, false)">
183183
Get your license
184184
</a>
185185
<div class="pricing-square-item" data-faq-id="subscription-support">
@@ -208,7 +208,7 @@ description: ThingsBoard Products Pricing
208208
false,
209209
'20be6f50-a18e-11e9-8e16-03828ff5271c',
210210
'd82185c0-a197-11e9-8e16-03828ff5271c',
211-
'Business')">
211+
'Business', null, false)">
212212
Get your license
213213
</a>
214214
<div class="pricing-square-item" data-faq-id="subscription-support">
@@ -237,7 +237,7 @@ description: ThingsBoard Products Pricing
237237
false,
238238
'20be6f50-a18e-11e9-8e16-03828ff5271c',
239239
'34530df0-a198-11e9-8e16-03828ff5271c',
240-
'Enterprise')">
240+
'Enterprise', null, false)">
241241
Get your license
242242
</a>
243243
<div class="pricing-square-item" data-faq-id="subscription-support">
@@ -275,7 +275,7 @@ description: ThingsBoard Products Pricing
275275
true,
276276
'90b6c9b0-a198-11e9-8e16-03828ff5271c',
277277
'4c711b60-a199-11e9-8e16-03828ff5271c',
278-
'Perpetual')">
278+
'Perpetual', null, false)">
279279
Get your license
280280
</a>
281281
<div class="pricing-square-item" data-faq-id="subscription-support">
@@ -340,7 +340,7 @@ description: ThingsBoard Products Pricing
340340
<h2>Prototype</h2>
341341
<h4 class="pricing-square-price mb-0">
342342
175
343-
<span>USD / Month</span>
343+
<span>USD&nbsp;/&nbsp;Month</span>
344344
</h4>
345345
<div style="color: rgba(var(--sk_foreground_high,29,28,29),.5); font-size: 15px; font-weight: 400;">Up to 200 Devices and Assets</div>
346346
<div class="pricing-square-item" >
@@ -354,8 +354,8 @@ description: ThingsBoard Products Pricing
354354
false,
355355
'31307df0-11f6-11ea-951e-b77b877a367b',
356356
'2985f1a0-7afd-11ea-951e-b77b877a367b',
357-
'Trendz Analytics Prototype', '')">
358-
Get your license
357+
'Trendz Analytics Prototype', 'KFYU8D47ZB', true)">
358+
try 30 days for free
359359
</a>
360360
<div>
361361
<a href="/products/trendz/"><span class="a-full-green">Learn More</span><br></a>
@@ -370,7 +370,7 @@ description: ThingsBoard Products Pricing
370370
<h2>Startup</h2>
371371
<h4 class="pricing-square-price mb-0">
372372
200
373-
<span>USD / Month</span>
373+
<span>USD&nbsp;/&nbsp;Month</span>
374374
</h4>
375375
<div style="color: rgba(var(--sk_foreground_high,29,28,29),.5); font-size: 15px; font-weight: 400;">Up to 500 Devices and Assets</div>
376376
<div class="pricing-square-item" >
@@ -384,8 +384,8 @@ description: ThingsBoard Products Pricing
384384
false,
385385
'31307df0-11f6-11ea-951e-b77b877a367b',
386386
'018b7520-7afe-11ea-951e-b77b877a367b',
387-
'Trendz Analytics StartUp', '')">
388-
Get your license
387+
'Trendz Analytics StartUp', 'KFYU8D47ZB', true)">
388+
try 30 days for free
389389
</a>
390390
<div>
391391
<a href="/products/trendz/"><span class="a-full-green">Learn More</span><br></a>
@@ -400,7 +400,7 @@ description: ThingsBoard Products Pricing
400400
<h2>Business</h2>
401401
<h4 class="pricing-square-price mb-0">
402402
350
403-
<span>USD / Month</span>
403+
<span>USD&nbsp;/&nbsp;Month</span>
404404
</h4>
405405
<div style="color: rgba(var(--sk_foreground_high,29,28,29),.5); font-size: 15px; font-weight: 400;">Up to 1000 Devices and Assets</div>
406406
<div class="pricing-square-item" >
@@ -414,8 +414,8 @@ description: ThingsBoard Products Pricing
414414
false,
415415
'31307df0-11f6-11ea-951e-b77b877a367b',
416416
'6e3bb4f0-7afe-11ea-951e-b77b877a367b',
417-
'Trendz Analytics Business', '')">
418-
Get your license
417+
'Trendz Analytics Business', 'KFYU8D47ZB', true)">
418+
try 30 days for free
419419
</a>
420420
<div>
421421
<a href="/products/trendz/"><span class="a-full-green">Learn More</span><br></a>

pricing/pricing.sass

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,3 +413,17 @@ html#pricing
413413
transition: left .3s ease-in-out
414414
box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.24)
415415

416+
.trndz-swal-license
417+
.trndz_dialog_list
418+
display: flex
419+
flex-direction: column
420+
align-items: center
421+
422+
li
423+
margin-bottom: 20px
424+
max-width: 200px
425+
text-align: center
426+
427+
.sa-button-container
428+
display: flex
429+
justify-content: space-between

0 commit comments

Comments
 (0)