Pass billing through from the appstore to the cloudron config

This commit is contained in:
Johannes Zellner
2016-04-08 17:01:07 +02:00
parent 103c0bd688
commit 5da5d86bc8
3 changed files with 21 additions and 11 deletions

View File

@@ -170,10 +170,10 @@
<div class="upgrade hide">
<div class="content">
<h4>Your Cloudron trial ends soon</h4>
<p>To keep your Cloudron, just <a href="https://cloudron.io/console.html#/billing" target="_blank">setup a payment method at cloudron.io</a> or <a href="mailto: support@cloudron.io">send us a mail</a>.</p>
<p>To keep your Cloudron, just <a href="https://cloudron.io/console.html#/billing" target="_blank">setup a payment method at cloudron.io</a> or <a href="mailto: support@cloudron.io">send us an email</a>.</p>
</div>
<div class="trigger">Keep your Cloudron</div>
<div class="trigger">Want to keep your Cloudron?</div>
</div>
<!-- Footer -->

View File

@@ -128,21 +128,28 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
// wait till the view has loaded until showing a modal dialog
Client.onConfig(function (config) {
if (!config.billing) {
setTimeout(function () {
$('.upgrade')[0].classList.remove('hide');
$('.upgrade .trigger').hover(function () {
$('.upgrade .content')[0].classList.add('active');
$('.upgrade .trigger')[0].classList.add('active');
});
$('.upgrade').hover(function () {}, function () {
$('.upgrade .content')[0].classList.remove('active');
$('.upgrade .trigger')[0].classList.remove('active');
});
}, 2000);
}
// check if we are actually updating
if (config.progress.update && config.progress.update.percent !== -1) {
window.location.href = '/update.html';
}
});
$('.upgrade .trigger').hover(function () {
$('.upgrade .content')[0].classList.add('active');
$('.upgrade .trigger')[0].classList.add('active');
});
$('.upgrade').hover(function () {}, function () {
$('.upgrade .content')[0].classList.remove('active');
$('.upgrade .trigger')[0].classList.remove('active');
});
// setup all the dialog focus handling
['updateModal'].forEach(function (id) {