Implement upgrade request dialog

This is currently merely a placeholder for some real upgrade ui
This commit is contained in:
Johannes Zellner
2016-04-18 17:12:47 +02:00
parent 96383a1fae
commit c62ef9e156
6 changed files with 51 additions and 3 deletions

View File

@@ -13,6 +13,10 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
password: ''
};
$scope.upgradeRequest = {
busy: false
};
$scope.isActive = function (url) {
if (!$route.current) return false;
return $route.current.$$route.originalPath.indexOf(url) === 0;
@@ -37,6 +41,23 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
window.location.href = '/error.html';
};
$scope.requestUpgrade = function () {
$scope.upgradeRequest.busy = true;
var subject = 'User requested upgrade for ' + $scope.config.fqdn;
var description = 'User ' + $scope.user.email + ' requested an upgrade for ' + $scope.config.fqdn + '. Get back to him!!';
Client.feedback('upgrade_request', subject, description, function (error) {
$scope.upgradeRequest.busy = false;
if (error) return Client.notify('Error', error.message, false, 'error');
Client.notify('Success', 'We will get back to you as soon as possible for the upgrade.', true, 'success');
$('#upgradeModal').modal('hide');
});
};
$scope.showUpdateModal = function (form) {
$scope.update.error.password = null;
$scope.update.password = '';