diff --git a/app/config.json b/app/config.json index d64a7a542fd0bd445832ba32b1a0573d0c73ae5a..1131b878cfae3b1f130ebe088cd6326260870f33 100644 --- a/app/config.json +++ b/app/config.json @@ -11,6 +11,12 @@ } }, + "twiced": { + "APP_CONFIG": { + "UCOIN_NODE": "twiced.fr:9330" + } + }, + "ucoin-fr": { "APP_CONFIG": { "UCOIN_NODE": "metab.ucoin.fr", @@ -27,4 +33,4 @@ } } -} \ No newline at end of file +} diff --git a/config.xml b/config.xml index 7509322d864a87eea3620a65e8de5a87273ddade..d015970d8509e10f3053b9d7f9b7a59aaa347883 100644 --- a/config.xml +++ b/config.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<widget id="com.ionicframework.cesium795009" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget id="com.ionicframework.lesou" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>Cesium</name> <description> - A webapp client for uCoin network + A webapp client for Duniter </description> - <author email="admin@ucoin.io" href="http://ucoin.io"> - cgeek + <author email="contact@le-sou.org" href="http://le-sou.org"> + le Sou </author> <content src="index.html"/> <access origin="*"/> @@ -39,4 +39,10 @@ <splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/> <splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/> </platform> + + <!-- A wildcard can be used to whitelist the entire network, + over HTTP and HTTPS. + *NOT RECOMMENDED* - see https://github.com/apache/cordova-plugin-whitelist + --> + <allow-navigation href="*" /> </widget> diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index b8fc4a23d6a55ca3ae80c9a0e2632ad714867f45..14a48034a3a920c3aea12e42840d8c8ab966f08e 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -61,6 +61,7 @@ "WOT": { "SEARCH_HELP": "Search (member or public key)", "REGISTERED_SINCE": "Registered since ", + "REGISTERED_SINCE_BLOCK": "Registered since block #", "BTN_SEND_MONEY": "Send money", "BTN_CERTIFY": "Certify", "MODAL": { @@ -79,7 +80,10 @@ "BALANCE": "Balance", "LAST_TX": "Last transactions", "BTN_SEND_MONEY": "Send money", - "BTN_REGISTER": "Register as member", + "BTN_MEMBERSHIP_IN": "Register as member", + "BTN_MEMBERSHIP_RENEW": "Renew membership", + "BTN_MEMBERSHIP_OUT": "Revoke membership", + "BTN_SEND_IDENTITY": "Publish pseudonym (without register)", "NEW": { "TITLE": "Register", "SLIDE_1_TITLE": "Select a money:", @@ -178,10 +182,13 @@ "FIELD_REQUIRED": "This field is required.", "FIELD_TOO_SHORT": "This field is too short.", "PASSWORD_NOT_CONFIRMED": "Must match previous password", - "SEND_SELF_REGISTRATION": "Error while trying to register", + "SEND_IDENTITY_FAILED": "Error while trying to register", "SEND_CERTIFICATION_FAILED": "Could not certify identity", "LOGIN_FAILED": "Error while login", - "LOAD_IDENTITY_FAILED": "Could not load identity" + "LOAD_IDENTITY_FAILED": "Could not load identity", + "SEND_MEMBERSHIP_IN_FAILED": "Error while registering as member", + "SEND_MEMBERSHIP_OUT_FAILED": "Error while registering out", + "REFRESH_WALLET_DATA": "Could not refresh wallet" }, "INFO": { "POPUP_TITLE": "Information", diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index b7912e92413f759e8c4e72faa527b6647ee3caea..f1510e1e820f151f63799e442f28447ce2cf27da 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -60,7 +60,8 @@ }, "WOT": { "SEARCH_HELP": "Recherche (pseudo ou clé publique)", - "REGISTERED_SINCE": "Inscrit depuis ", + "REGISTERED_SINCE": "Inscrit depuis le ", + "REGISTERED_SINCE_BLOCK": "Inscrit au block #", "BTN_SEND_MONEY": "Payer", "BTN_CERTIFY": "Certifier", "MODAL": { @@ -79,7 +80,10 @@ "BALANCE": "Solde", "LAST_TX": "Dernières transactions", "BTN_SEND_MONEY": "Payer", - "BTN_REGISTER": "S'inscrire comme membre", + "BTN_MEMBERSHIP_IN": "Devenir membre", + "BTN_MEMBERSHIP_RENEW": "Renouveller son adhésion comme membre", + "BTN_MEMBERSHIP_OUT": "Arrêter son adhésion", + "BTN_SEND_IDENTITY": "Publier le pseudonym (sans devenir membre)", "NEW": { "TITLE": "Inscription", "SLIDE_1_TITLE": "Choix de la monnaie :", @@ -178,10 +182,12 @@ "FIELD_REQUIRED": "Champ obligatoire.", "FIELD_TOO_SHORT": "Valeur trop courte.", "PASSWORD_NOT_CONFIRMED": "Ne correspond pas au mot de passe", - "SEND_SELF_REGISTRATION": "Erreur pendant l'inscription.", + "SEND_IDENTITY_FAILED": "Erreur pendant l'inscription.", "SEND_CERTIFICATION_FAILED": "Erreur lors de la certification de l'identité", "LOGIN_FAILED": "Erreur lors de l'authentification", - "LOAD_IDENTITY_FAILED": "Erreur de chargement de l'identité" + "LOAD_IDENTITY_FAILED": "Erreur de chargement de l'identité", + "SEND_MEMBERSHIP_IN_FAILED": "Echec de la tentative d'entrée dans la communauté", + "REFRESH_WALLET_DATA": "Echec du rafraichissement du portefeuille" }, "INFO": { "POPUP_TITLE": "Information", diff --git a/www/img/ionic.png b/www/img/ionic.png new file mode 100644 index 0000000000000000000000000000000000000000..21c7f375997e6443b05e5fd50815271da1e2c3ec Binary files /dev/null and b/www/img/ionic.png differ diff --git a/www/js/controllers/wallet-controllers.js b/www/js/controllers/wallet-controllers.js index fb755b8ab95bc2f005deca60fc9eecf5b85b3558..34ed9f118012b3c179aec071fb37e3e0b3b3f041 100644 --- a/www/js/controllers/wallet-controllers.js +++ b/www/js/controllers/wallet-controllers.js @@ -76,9 +76,20 @@ function WalletController($scope, $state, $q, $ionicPopup, UIUtils, Wallet, BMA, // Update view $scope.updateWalletView = function(wallet) { $scope.walletData = wallet; - $scope.hasCredit = ($scope.walletData.balance != "undefined" && $scope.walletData.balance > 0); - $scope.isMember = ($scope.walletData.requirements != "undefined" && $scope.walletData.requirements != null - && $scope.walletData.requirements.uid != "undefined" && $scope.walletData.requirements.uid != null); + $scope.hasCredit = (!!$scope.walletData.balance && $scope.walletData.balance > 0); + if (!$scope.walletData.requirements || !$scope.walletData.requirements.uid) { + $scope.needSelf = true; + $scope.needMembership = true; + $scope.needRenew = false; + } + else { + $scope.needSelf = false; + $scope.needMembership = ($scope.walletData.requirements.membershipExpiresIn == 0 + && $scope.walletData.requirements.membershipPendingExpiresIn <= 0 ); + $scope.needRenew = !$scope.needMembership && ($scope.walletData.requirements.membershipExpiresIn < 129600 + && $scope.walletData.requirements.membershipPendingExpiresIn <= 0 ); + } + $scope.isMember = !$scope.needSelf && !$scope.needMembership; }; // Has credit @@ -95,7 +106,7 @@ function WalletController($scope, $state, $q, $ionicPopup, UIUtils, Wallet, BMA, $scope.registerForm = registerForm; }; - // Self cert + // Send self identity $scope.self= function() { $translate(['ACCOUNT.NEW.TITLE', 'ACCOUNT.POPUP_REGISTER.TITLE', 'ACCOUNT.POPUP_REGISTER.HELP', 'COMMON.BTN_ADD_ACCOUNT', 'COMMON.BTN_CANCEL']) @@ -130,12 +141,13 @@ function WalletController($scope, $state, $q, $ionicPopup, UIUtils, Wallet, BMA, UIUtils.loading.hide(); return; } - var doSendSelf = function() { + + var doSelf = function() { Wallet.self(uid) .then(function() { UIUtils.loading.hide(); }) - .catch(UIUtils.onError('ERROR.SEND_SELF_REGISTRATION')); + .catch(UIUtils.onError('ERROR.SEND_IDENTITY_FAILED')); }; // Check uid is not used by another member UIUtils.loading.show(); @@ -152,19 +164,50 @@ function WalletController($scope, $state, $q, $ionicPopup, UIUtils, Wallet, BMA, UIUtils.loading.hide(); UIUtils.alert.info('ACCOUNT.NEW.MSG_UID_ALREADY_USED') .then(function(){ - $scope.self(); + $scope.self(); // loop }); } else { - doSendSelf(); + doSelf(); } }) .catch(function() { - doSendSelf(); + doSelf(); }); }); }); }; + + // Send membership IN + $scope.membershipIn= function() { + UIUtils.loading.show(); + Wallet.membership(true) + .then(function() { + + UIUtils.loading.hide(); + }) + .catch(UIUtils.onError('ERROR.SEND_MEMBERSHIP_IN_FAILED')); + }; + + // Send membership IN + $scope.membershipOut = function() { + UIUtils.loading.show(); + Wallet.membership(false) + .then(function() { + UIUtils.loading.hide(); + }) + .catch(UIUtils.onError('ERROR.SEND_MEMBERSHIP_OUT_FAILED')); + }; + + // Updating wallet data + $scope.doUpdate = function() { + UIUtils.loading.show(); + Wallet.refreshData() + .then(function() { + UIUtils.loading.hide(); + }) + .catch(UIUtils.onError('ERROR.REFRESH_WALLET_DATA')); + }; } function TransferController($scope, $ionicModal, $state, $ionicHistory, BMA, Wallet, UIUtils) { @@ -182,7 +225,7 @@ function TransferController($scope, $ionicModal, $state, $ionicHistory, BMA, Wal WotLookupController.call(this, $scope, BMA, $state); $scope.$on('$ionicView.enter', function(e, $state) { - if ($state.stateParams != null + if ($state.stateParams != null && $state.stateParams.pubkey != null && $state.stateParams.pubkey != "undefined") { $scope.destPub = $state.stateParams.pubkey; @@ -191,7 +234,7 @@ function TransferController($scope, $ionicModal, $state, $ionicHistory, BMA, Wal $scope.dest = $state.stateParams.uid; } else { - $scope.dest = $scope.destPub; + $scope.dest = $scope.destPub; } } @@ -240,10 +283,10 @@ function TransferController($scope, $ionicModal, $state, $ionicHistory, BMA, Wal UIUtils.loading.show(); var amount = $scope.formData.amount; - if ($scope.walletData.useRelative - && amount != "undefined" + if ($scope.walletData.useRelative + && amount != "undefined" && amount != null) { - amount = $scope.walletData.currentUD + amount = $scope.walletData.currentUD * amount.replace(new RegExp('[.,]'), '.'); } diff --git a/www/js/controllers/wot-controllers.js b/www/js/controllers/wot-controllers.js index e24291f1800d9f45ea4c653cb646ccc98546dd41..f880d9883608c55be2d11b5a6997050d46b5c7d9 100644 --- a/www/js/controllers/wot-controllers.js +++ b/www/js/controllers/wot-controllers.js @@ -30,10 +30,12 @@ function WotLookupController($scope, BMA, $state) { $scope.search.looking = false; $scope.search.results = res.results.reduce(function(idties, res) { return idties.concat(res.uids.reduce(function(uids, idty) { + var blocUid = idty.meta.timestamp.split('-', 2); return uids.concat({ uid: idty.uid, pub: res.pubkey, - sigDate: idty.meta.timestamp + number: blocUid[0], + hash: blocUid[1] }) }, [])); }, []); @@ -68,16 +70,25 @@ function IdentityController($scope, $state, BMA, Wallet, UIUtils, $q) { .then(function(res){ $scope.identity = res.results.reduce(function(idties, res) { return idties.concat(res.uids.reduce(function(uids, idty) { + var blocUid = idty.meta.timestamp.split('-', 2); return uids.concat({ uid: idty.uid, pub: res.pubkey, - sigDate: idty.meta.timestamp, + number: blocUid[0], + hash: blocUid[1], + revoked: idty.revoked, + revokedSig: idty.revocation_sig, sig: idty.self }) }, [])); }, [])[0]; $scope.hasSelf = ($scope.identity.uid && $scope.identity.sigDate && $scope.identity.sig); - UIUtils.loading.hide(); + BMA.blockchain.block({block: $scope.identity.number}) + .then(function(block) { + $scope.identity.sigDate = block.time; + UIUtils.loading.hide(); + }) + .catch(UIUtils.onError('ERROR.LOAD_IDENTITY_FAILED')); }) .catch(UIUtils.onError('ERROR.LOAD_IDENTITY_FAILED')); }; @@ -107,4 +118,4 @@ function IdentityController($scope, $state, BMA, Wallet, UIUtils, $q) { uid: $scope.identity.uid }); }; -} \ No newline at end of file +} diff --git a/www/js/services/bma-services.js b/www/js/services/bma-services.js index 097f4a33300a08eafa8aa71a87c338ea468f32c2..c67f9a980e8d584364c19e12616a6274568788c4 100644 --- a/www/js/services/bma-services.js +++ b/www/js/services/bma-services.js @@ -12,7 +12,7 @@ angular.module('cesium.bma.services', ['ngResource', function processError(reject, data, uri) { if (data != null && data.message != "undefined" && data.message != null) { - reject(data.ucode + ": " + data.message); + reject(data); } else { if (uri != "undefined" && uri != null) { diff --git a/www/js/services/market-services.js b/www/js/services/market-services.js index 53fc215cc134bdaaa87fd753b14e55838b87e573..937c194f3687ba914cba97fd99d54b447c713dbc 100644 --- a/www/js/services/market-services.js +++ b/www/js/services/market-services.js @@ -12,7 +12,7 @@ angular.module('cesium.market.services', ['ngResource', 'cesium.services', 'cesi function processError(reject, data) { if (data != null && data.message != "undefined" && data.message != null) { - reject(data.ucode + ": " + data.message); + reject(data); } else { reject('Unknown error from ucoin node'); diff --git a/www/js/services/registry-services.js b/www/js/services/registry-services.js index 245201b2ec62774023ca8317f2019c3713a08f59..01a00fd5228fb7b7954ac4c5cc837aa701821f89 100644 --- a/www/js/services/registry-services.js +++ b/www/js/services/registry-services.js @@ -8,7 +8,7 @@ angular.module('cesium.registry.services', ['ngResource', 'cesium.services']) function processError(reject, data) { if (data != null && data.message != "undefined" && data.message != null) { - reject(data.ucode + ": " + data.message); + reject(data); } else { reject('Unknown error from ucoin node'); diff --git a/www/js/services/utils-services.js b/www/js/services/utils-services.js index 0e6cbf2452b654e59cb2abf70c5daa59a43259a5..fb1cb157c07a25d9036238ee616a6f619e0748b9 100644 --- a/www/js/services/utils-services.js +++ b/www/js/services/utils-services.js @@ -57,7 +57,12 @@ angular.module('cesium.utils.services', ['ngResource']) return function(err) { console.error('>>>>>>>' , err); hideLoading(); - alertError(msg + ': ' + err); + if (!!err && !!err.message) { + alertError(msg + ': ' + err.message); + } + else { + alertError(msg); + } } } diff --git a/www/js/services/wallet-services.js b/www/js/services/wallet-services.js index f41b47c8e8d301533c471606ed0387c97bee5208..691bc9ea722f11072cf9d2ee6991ee55a3bc499f 100644 --- a/www/js/services/wallet-services.js +++ b/www/js/services/wallet-services.js @@ -10,8 +10,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' USE_RELATIVE_DEFAULT = true, - createData = function() { - return { + data = { pubkey: null, keypair: { signSk: null, @@ -23,13 +22,12 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' currency: null, currentUD: null, history: {}, - requirements: null, - loaded: false - }; + requirements: {}, + loaded: false, + blockUid: null, + sigQty: null }, - data = createData(), - resetData = function() { data.pubkey= null; data.keypair ={ @@ -42,8 +40,10 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' data.currency= null; data.currentUD= null; data.history= {}; - data.requirements= null; + data.requirements= {}; data.loaded= false; + data.blockUid= null; + data.sigQty = null; }, reduceTx = function(txArray) { @@ -114,6 +114,37 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' && arg1.amount == arg2.amount; }, + loadRequirements = function() { + return $q(function(resolve, reject) { + // Get requirements + BMA.wot.requirements({pubkey: data.pubkey}) + .then(function(res){ + if (!res.identities && res.identities.length != 1) { + data.requirements = null; + resolve(); + return; + } + var idty = res.identities[0]; + data.requirements = idty; + data.uid = idty.uid; + data.blockUid = idty.meta.timestamp; + // TODO + //data.requirements.needCertifications = (idty.certifications.length < data.sigQty); + resolve(); + }) + .catch(function(err) { + data.requirements = {}; + // If identity not publiched : continue + if (!!err && err.ucode == 2004) { + resolve(); + } + else { + reject(err); + } + }); + }); + }, + loadData = function(refresh) { if (data.loaded) { return refreshData(); @@ -128,6 +159,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' BMA.currency.parameters() .then(function(json){ data.currency = json.currency; + data.sigQty = json.sigQty; }), // Get the UD informations @@ -158,18 +190,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' }), // Get requirements - BMA.wot.requirements({pubkey: data.pubkey}) - .then(function(res){ - if (res.identities != "undefined" - && res.identities != null - && res.identities.length == 1) { - data.requirements = res.identities[0]; - data.uid = res.identities[0].uid; - } - }) - .catch(function(err) { - data.requirements = null; - }), + loadRequirements(), // Get transactions BMA.tx.history.all({pubkey: data.pubkey}) @@ -221,21 +242,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' }), // Get requirements - BMA.wot.requirements({pubkey: data.pubkey}) - .then(function(res){ - if (res.identities != "undefined" - && res.identities != null - && res.identities.length == 1) { - data.requirements = res.identities[0]; - data.uid = res.identities[0].uid; - } - else { - data.requirements = null; - } - }) - .catch(function(err) { - data.requirements = null; - }), + loadRequirements(), // Get sources BMA.tx.sources({pubkey: data.pubkey}) @@ -265,10 +272,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' ]) .then(function() { resolve(data); - }) - .catch(function(err) { - reject(err); - }); + }).catch(function(err){reject(err);}); }); }, @@ -331,74 +335,78 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' tx += "Comment: "+ (comments!=null?comments:"") + "\n"; - - CryptoUtils.sign(tx, data.keypair) - .then(function(signature) { - var signedTx = tx + signature + "\n"; - BMA.tx.process({transaction: signedTx}) - .then(function(result) { - data.balance -= amount; - for(var i=0;i<inputs.length;i++)inputs[i].consumed=true; - resolve(result); - }) - .catch(function(err){ - reject(err); - }); - }) - .catch(function(err){ - reject(err); - }); + .then(function(signature) { + var signedTx = tx + signature + "\n"; + BMA.tx.process({transaction: signedTx}) + .then(function(result) { + data.balance -= amount; + for(var i=0;i<inputs.length;i++)inputs[i].consumed=true; + resolve(result); + }).catch(function(err){reject(err);}); + }).catch(function(err){reject(err);}); }); }, /** - * Send self certification + * Send self identity */ self = function(uid) { return $q(function(resolve, reject) { BMA.blockchain.current() .then(function(block) { - // Create the self part to sign - var self = 'UID:' + uid + '\n' - + 'META:TS:' + (block.time+1) + '\n'; + // Create identity to sign + var identity = 'Version: 2\n' + + 'Type: Identity\n' + + 'Currency: ' + data.currency + '\n' + + 'Issuer: ' + data.pubkey + '\n' + + 'UniqueID: ' + uid + '\n' + + 'Timestamp: ' + block.number + '-' + block.hash + '\n'; + + CryptoUtils.sign(identity, data.keypair) + .then(function(signature) { + var signedIdentity = identity + signature + '\n'; + // Send signed identity + BMA.wot.add({identity: signedIdentity}) + .then(function(result) { + // Refresh membership data + loadRequirements(); + }).catch(function(err){reject(err);}); + }).catch(function(err){reject(err);}); + }).catch(function(err){reject(err);}); + }); + }, + + /** + * Send membership (in) + */ + membership = function(sideIn) { + return $q(function(resolve, reject) { - CryptoUtils.sign(self, data.keypair) + BMA.blockchain.current() + .then(function(block) { + // Create membership to sign + var membership = 'Version: 2\n' + + 'Type: Membership\n' + + 'Currency: ' + data.currency + '\n' + + 'Issuer: ' + data.pubkey + '\n' + + 'Block: ' + block.number + '-' + block.hash + '\n' + + 'Membership: ' + (!!sideIn ? "IN" : "OUT" ) + '\n' + + 'UserID: ' + data.uid + '\n' + + 'CertTS: ' + data.blockUid + '\n'; + + CryptoUtils.sign(membership, data.keypair) .then(function(signature) { - var signedSelf = self + signature + '\n'; - // Send self - BMA.wot.add({pubkey: data.pubkey, self: signedSelf, other: ''}) + var signedMembership = membership + signature + '\n'; + // Send signed membership + BMA.blockchain.membership({membership: signedMembership}) .then(function(result) { - // Check requirements - BMA.wot.requirements({pubkey: data.pubkey}) - .then(function(res){ - if (res.identities != "undefined" - && res.identities != null - && res.identities.length == 1) { - data.requirements = res.identities[0]; - data.uid = uid; - resolve(); - } - else{ - reject(); - } - }) - .catch(function(err) { - reject(); - }) - }) - .catch(function(err){ - reject(err); - }); - }) - .catch(function(err){ - reject(err); - }); - }) - .catch(function(err) { - reject(err); - }); + // Refresh membership data + loadRequirements(); + }).catch(function(err){reject(err);}); + }).catch(function(err){reject(err);}); + }).catch(function(err){reject(err);}); }); }, @@ -427,18 +435,9 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' BMA.wot.add({pubkey: pubkey, self: self, other: inlineCert}) .then(function(result) { resolve(result); - }) - .catch(function(err){ - reject(err); - }); - }) - .catch(function(err){ - reject(err); - }); - }) - .catch(function(err) { - reject(err); - }); + }).catch(function(err){reject(err);}); + }).catch(function(err){reject(err);}); + }).catch(function(err){reject(err);}); }); }, @@ -495,6 +494,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'cesium.bma.services', ' // operations transfer: transfer, self: self, + membership: membership, sign: sign, // serialization toJson: toJson, diff --git a/www/templates/account/view_wallet.html b/www/templates/account/view_wallet.html index aee7d408c448d58a2c2247cb61e465cfdeea5d92..18d70eb7b48370bf0336322204071bbd41ee19d7 100644 --- a/www/templates/account/view_wallet.html +++ b/www/templates/account/view_wallet.html @@ -1,4 +1,10 @@ -<ion-view left-buttons="leftButtons"> +<ion-view left-buttons="leftButtons" view-title=""> + <ion-nav-buttons side="secondary"> + <button class="button button-icon" ng-click="doUpdate()"> + <i class="icon ion-loop"></i> + </button> + </ion-nav-buttons> + <ion-content> <div class="scroll"> @@ -37,13 +43,34 @@ </a> </div> - <div class="item item-button-right positive" ng-if="!isMember" ng-click="self()"> - {{'ACCOUNT.BTN_REGISTER' | translate}} + <div class="item item-button-right positive" ng-if="needMembership" ng-click="membershipIn()"> + {{'ACCOUNT.BTN_MEMBERSHIP_IN' | translate}} <a class="button button-clear button-positive" > <i class="icon-right ion-chevron-right"></i> </a> </div> + <div class="item item-button-right positive" ng-if="needRenew" ng-click="membershipRenew()"> + {{'ACCOUNT.BTN_MEMBERSHIP_RENEW' | translate}} + <a class="button button-clear button-positive" > + <i class="icon-right ion-chevron-right"></i> + </a> + </div> + + <div class="item item-button-right positive" ng-if="!needSelf && !needMembership" ng-click="membershipOut()"> + {{'ACCOUNT.BTN_MEMBERSHIP_OUT' | translate}} + <a class="button button-clear button-positive" > + <i class="icon-right ion-chevron-right"></i> + </a> + </div> + + <div class="item item-button-right positive" ng-if="needSelf" ng-click="self()"> + {{'ACCOUNT.BTN_SEND_IDENTITY' | translate}} + <a class="button button-clear button-positive" > + <i class="icon-right ion-chevron-right"></i> + </a> + </div> + <div class="item"> </div> diff --git a/www/templates/wot/lookup_form.html b/www/templates/wot/lookup_form.html index 9052d936cdf45eb430c1c95efa249279416ce1a0..1e63cd3adb3c29b2bf84f8cfaf61085457a4fc46 100644 --- a/www/templates/wot/lookup_form.html +++ b/www/templates/wot/lookup_form.html @@ -13,8 +13,6 @@ <a class="item item-icon-left item-avatar" ng-repeat="found in search.results" ng-click="doSelectIdentity('{{found.pub}}', '{{found.uid}}')"> <i class="icon ion-person"></i> <h2>{{found.uid}}</h2> - - <h4 class="gray">{{'WOT.REGISTERED_SINCE'|translate}}{{found.sigDate | formatDate}}</h4> <span class="badge">{{found.pub | formatPubkey}}</span> </a> </div>