diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index 95c563544db5fc4c60edefb303ff199abe4fb5f6..75b4ec05db9c42dc3dddac42fbadd6aaf5527e6a 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -267,8 +267,8 @@ "LOGIN_FAILED": "Error while sign in.", "LOAD_IDENTITY_FAILED": "Could not load identity.", "LOAD_REQUIREMENTS_FAILED": "Could not load identity requirements.", - "SEND_MEMBERSHIP_IN_FAILED": "Error while registering as member.", - "SEND_MEMBERSHIP_OUT_FAILED": "Error while registering out.", + "SEND_MEMBERSHIP_IN_FAILED": "Error while sending registration as member.", + "SEND_MEMBERSHIP_OUT_FAILED": "Error while sending membership revocation.", "REFRESH_WALLET_DATA": "Could not refresh wallet.", "GET_CURRENCY_PARAMETER": "Could not get currency parameters.", "GET_CURRENCIES_FAILED": "Unable to load currencies. Please retry later.", @@ -298,14 +298,16 @@ "INFO": { "POPUP_TITLE": "Information", "CERTIFICATION_DONE": "Identity successfully signed", - "NOT_ENOUGH_CREDIT": "Not enough credit.", - "TRANSFER_SENT": "Transfer request successfully sent.", - "COPY_TO_CLIPBOARD_DONE": "Copy succeed." + "NOT_ENOUGH_CREDIT": "Not enough credit", + "TRANSFER_SENT": "Transfer request successfully sent", + "COPY_TO_CLIPBOARD_DONE": "Copy succeed", + "MEMBERSHIP_OUT_SENT": "Membership revocation sent" }, "CONFIRM": { "POPUP_TITLE": "<b>Confirmation</b>", "CERTIFY_RULES_TITLE_UID": "Certify {{uid}}", "CERTIFY_RULES": "<b>Security warning:</b><br/><br/><b class=\"assertive\">Don't certify an account</b> if you believe that: <ul><li>1.) the issuers identity might be faked.<li>2.) the issuer already has another certified account.<li>3.) the issuer purposely or carelessly violates rule 1 or 2 (he certifies faked or double accounts).</ul></small><br/>Are you sure you want to certify this identity ?", - "TRANSFER": "<b>Transfer summary:</b><br/><br/><ul><li> - From: <b>{{from}}</b></li><li> - To: <b>{{to}}</b></li><li> - Amount: <b>{{amount}} {{unit}}</b></li><li> - Comment: <i>{{comment}}</i></li></ul><br/><b>Are-you sure you want to do this transfer ?</b>" + "TRANSFER": "<b>Transfer summary:</b><br/><br/><ul><li> - From: <b>{{from}}</b></li><li> - To: <b>{{to}}</b></li><li> - Amount: <b>{{amount}} {{unit}}</b></li><li> - Comment: <i>{{comment}}</i></li></ul><br/><b>Are-you sure you want to do this transfer ?</b>", + "MEMBERSHIP_OUT": "<b>Warning</b>:<br/>You are going to terminate your membership. This operation is irreversible<br/></br/><b>Are you sure you want to continue ?</b>" } } diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index 70b459a0c18d71d158738ef5bc9174351fa31c83..8ff887e157866492380b4c2547f4fec9e3dab068 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -297,15 +297,17 @@ }, "INFO": { "POPUP_TITLE": "Information", - "CERTIFICATION_DONE": "Certification envoyée avec succès.", - "NOT_ENOUGH_CREDIT": "Crédit insuffisant.", - "TRANSFER_SENT": "Demande de virement envoyée avec succès.", - "COPY_TO_CLIPBOARD_DONE": "Copie effectuée." + "CERTIFICATION_DONE": "Certification envoyée avec succès", + "NOT_ENOUGH_CREDIT": "Crédit insuffisant", + "TRANSFER_SENT": "Demande de virement envoyée avec succès", + "COPY_TO_CLIPBOARD_DONE": "Copie effectuée", + "MEMBERSHIP_OUT_SENT": "Résiliation envoyée avec succès" }, "CONFIRM": { "POPUP_TITLE": "<b>Confirmation</b>", "CERTIFY_RULES_TITLE_UID": "Certifier {{uid}}", "CERTIFY_RULES": "<b>Avertissement de sécurité :</b><br/><br/><b class=\"assertive\">Ne pas certifier</b> un compte si vous pensez que :<ul><li>1.) il ne correspond pas à une personne physique vivante.<li>2.) son propriétaire possède un autre compte déjà certifié.<li>3.) son propriétaire viole (volontairement ou non) la règle 1 ou 2 (par exemple en certifiant des comptes factices ou en double).</ul><br/><b>Etes-vous sûr de vouloir néanmoins certifier cette identité ?</b>", - "TRANSFER": "<b>Récapitulatif du virement</b> :<br/><br/><ul><li> - De : {{from}}</li><li> - A : <b>{{to}}</b></li><li> - Montant : <b>{{amount}} {{unit}}</b></li><li> - Commentaire : <i>{{comment}}</i></li></ul><br/><b>Etes-vous sûr de vouloir effectuer ce virement ?</b>" + "TRANSFER": "<b>Récapitulatif du virement</b> :<br/><br/><ul><li> - De : {{from}}</li><li> - A : <b>{{to}}</b></li><li> - Montant : <b>{{amount}} {{unit}}</b></li><li> - Commentaire : <i>{{comment}}</i></li></ul><br/><b>Etes-vous sûr de vouloir effectuer ce virement ?</b>", + "MEMBERSHIP_OUT": "<b>Avertissement</b> :<br/>Vous allez résilier votre adhésion comme membre. Cette opération est <b>irréversible</b>.<br/></br/><b>Etes-vous sûr de vouloir continuer ?</b>" } } diff --git a/www/js/controllers/wallet-controllers.js b/www/js/controllers/wallet-controllers.js index b1796a9786cdbc999dbee6e4656f13f1bf47a52d..0e8e80010e885ea5a747ba49707d61441db0f489 100644 --- a/www/js/controllers/wallet-controllers.js +++ b/www/js/controllers/wallet-controllers.js @@ -262,15 +262,26 @@ function WalletController($scope, $q, $ionicPopup, $timeout, $state, $ionicHisto //.catch(UIUtils.onError('ERROR.SEND_MEMBERSHIP_IN_FAILED')); }; - // Send membership IN - $scope.membershipOut = function() { + // Send membership OUT + $scope.membershipOut = function(confirm) { if ($scope.actionsPopover) { $scope.actionsPopover.hide(); } - // TODO Add confirmation message + + // Ask user confirmation + if (!confirm) { + return UIUtils.alert.confirm('CONFIRM.MEMBERSHIP_OUT') + .then(function(confirm) { + if (confirm) $scope.membershipOut(true); // loop with confirmation + }); + } UIUtils.loading.show(); - Wallet.membership.out() + return Wallet.membership.out() + .then(function() { + UIUtils.loading.hide(); + UIUtils.toast.show('INFO.MEMBERSHIP_OUT_SENT'); + }) .catch(UIUtils.onError('ERROR.SEND_MEMBERSHIP_OUT_FAILED')); };