From c3996a79d746b6d0877583a9d271c905994f4de7 Mon Sep 17 00:00:00 2001 From: blavenie <benoit.lavenier@e-is.pro> Date: Wed, 8 Feb 2017 16:56:52 +0100 Subject: [PATCH] - Wot Identity > Cert : fix tab controller inheritence & path - Add a general button on main interface to certify identities Fix #59 --- www/i18n/locale-en-GB.json | 4 +- www/i18n/locale-en.json | 4 +- www/i18n/locale-fr-FR.json | 4 +- www/i18n/locale-nl-NL.json | 1 + www/js/controllers/app-controllers.js | 2 +- www/js/controllers/help-controllers.js | 2 +- www/js/controllers/wallet-controllers.js | 2 +- www/js/controllers/wot-controllers.js | 511 +++++++++--------- .../es/js/controllers/wot-controllers.js | 2 +- .../common/item_comment_content.html | 2 +- .../es/templates/market/view_record.html | 4 +- www/plugins/es/templates/message/list.html | 4 +- .../es/templates/message/view_message.html | 2 +- .../es/templates/registry/view_record.html | 2 +- .../templates/wot/view_identity_extend.html | 34 +- www/templates/blockchain/link_identity.html | 2 +- www/templates/blockchain/view_block.html | 2 +- www/templates/network/items_peers.html | 2 +- www/templates/wallet/view_wallet.html | 22 +- .../wallet/view_wallet_tx_error.html | 4 +- .../wot/items_given_certifications.html | 4 +- .../wot/items_received_certifications.html | 4 +- .../wot/tabs/tab_given_certifications.html | 2 +- .../wot/tabs/tab_received_certifications.html | 2 +- www/templates/wot/view_certifications_lg.html | 14 +- www/templates/wot/view_identity.html | 38 +- 26 files changed, 358 insertions(+), 318 deletions(-) diff --git a/www/i18n/locale-en-GB.json b/www/i18n/locale-en-GB.json index d05932e8c..c2ef006a4 100644 --- a/www/i18n/locale-en-GB.json +++ b/www/i18n/locale-en-GB.json @@ -29,6 +29,7 @@ "BTN_DELETE": "Delete", "BTN_ADD": "Add", "BTN_SEARCH": "Search", + "BTN_REFRESH": "Refresh", "BTN_CONTINUE": "Continue", "BTN_UNDERSTOOD": "I understood", "BTN_OPTIONS": "Options", @@ -306,7 +307,8 @@ "WAITING_CERTIFICATIONS": "You need {{needCertificationCount}} certification(s) to become a member", "WILL_MISSING_CERTIFICATIONS": "You will <b>lack certifications</b> soon (at least {{willNeedCertificationCount}} more are needed)", "WILL_NEED_RENEW_MEMBERSHIP": "Your membership <b>will expire {{membershipExpiresIn|formatDurationTo}}</b>. Remember to <a ng-click=\"doQuickFix('renew')\">renewing your membership</a> before then.", - "CERTIFICATION_COUNT": "Certifications<span class=\"hidden-xs\"> count</span>", + "CERTIFICATION_COUNT": "Received certifications", + "CERTIFICATION_COUNT_SHORT": "Certifications", "SIG_STOCK": "Stock of certifications to give", "BTN_RECEIVE_MONEY": "Receive", "BTN_MEMBERSHIP_IN_DOTS": "Register as member...", diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index 3d804f16b..682c852f8 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -29,6 +29,7 @@ "BTN_DELETE": "Delete", "BTN_ADD": "Add", "BTN_SEARCH": "Search", + "BTN_REFRESH": "Refresh", "BTN_CONTINUE": "Continue", "BTN_UNDERSTOOD": "I understood", "BTN_OPTIONS": "Options", @@ -306,7 +307,8 @@ "WAITING_CERTIFICATIONS": "You need {{needCertificationCount}} certification(s) to become a member", "WILL_MISSING_CERTIFICATIONS": "You will <b>lack certifications</b> soon (at least {{willNeedCertificationCount}} more are needed)", "WILL_NEED_RENEW_MEMBERSHIP": "Your membership <b>will expire {{membershipExpiresIn|formatDurationTo}}</b>. Remember to <a ng-click=\"doQuickFix('renew')\">renewing your membership</a> before then.", - "CERTIFICATION_COUNT": "Certifications<span class=\"hidden-xs\"> count</span>", + "CERTIFICATION_COUNT": "Received certifications", + "CERTIFICATION_COUNT_SHORT": "Certifications", "SIG_STOCK": "Stock of certifications to give", "BTN_RECEIVE_MONEY": "Receive", "BTN_MEMBERSHIP_IN_DOTS": "Register as member...", diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index 97a9f2421..d431fe15a 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -29,6 +29,7 @@ "BTN_DELETE": "Supprimer", "BTN_ADD": "Ajouter", "BTN_SEARCH": "Recherche", + "BTN_REFRESH": "Actualiser", "BTN_CONTINUE": "Continuer", "BTN_UNDERSTOOD": "J'ai compris", "BTN_OPTIONS": "Options", @@ -306,7 +307,8 @@ "WAITING_CERTIFICATIONS": "Vous devez obtenir {{needCertificationCount}} certification(s) pour devenir membre.", "WILL_MISSING_CERTIFICATIONS": "Vous allez bientôt <b>manquer de certification</b> (au moins {{willNeedCertificationCount}} est nécessaire)", "WILL_NEED_RENEW_MEMBERSHIP": "Votre adhésion comme membre <b>va expirer {{membershipExpiresIn|formatDurationTo}}</b>. Pensez à <a ng-click=\"doQuickFix('renew')\">renouveler votre adhésion</a> d'ici là .", - "CERTIFICATION_COUNT": "Certifications<span class=\"hidden-xs\"> reçues</span>", + "CERTIFICATION_COUNT": "Certifications reçues", + "CERTIFICATION_COUNT_SHORT": "Certifications", "SIG_STOCK": "Certifications envoyées", "BTN_RECEIVE_MONEY": "Encaisser", "BTN_MEMBERSHIP_IN_DOTS": "Devenir membre...", diff --git a/www/i18n/locale-nl-NL.json b/www/i18n/locale-nl-NL.json index d95a93e2c..9eee9dc11 100644 --- a/www/i18n/locale-nl-NL.json +++ b/www/i18n/locale-nl-NL.json @@ -245,6 +245,7 @@ "WILL_MISSING_CERTIFICATIONS": "Je heeft binnenkort <b>onvoldoende certificaties</b> (ten minste {{willNeedCertificationCount}} benodigd)", "WILL_NEED_RENEW_MEMBERSHIP": "Je lidmaatschap <b>gaat verlopen op {{membershipExpiresIn|formatDurationTo}}</b>. Vergeet niet <a ng-click=\"doQuickFix('renew')\">je lidmaatschap te vernieuwen</a> voor die tijd.", "CERTIFICATION_COUNT": "Aantal certificaties", + "CERTIFICATION_COUNT_SHORT": "Certificaties", "SIG_STOCK": "Voorraad uit te geven certificaties", "BTN_RECEIVE_MONEY": "Ontvangen", "BTN_MEMBERSHIP_IN_DOTS": "Lidmaatschap aanvragen...", diff --git a/www/js/controllers/app-controllers.js b/www/js/controllers/app-controllers.js index 59bdeabe6..7337dc915 100644 --- a/www/js/controllers/app-controllers.js +++ b/www/js/controllers/app-controllers.js @@ -115,7 +115,7 @@ function AppController($scope, $rootScope, $state, $ionicSideMenuDelegate, $q, $ .then(function(result){ // If pubkey if (result && result.pubkey) { - $state.go('app.wot_view_identity', { + $state.go('app.wot_identity', { pubkey: result.pubkey, node: result.host ? result.host: null} ); diff --git a/www/js/controllers/help-controllers.js b/www/js/controllers/help-controllers.js index 1be51cb6e..867f3f511 100644 --- a/www/js/controllers/help-controllers.js +++ b/www/js/controllers/help-controllers.js @@ -588,7 +588,7 @@ function HelpTipController($scope, $rootScope, $state, $window, $ionicSideMenuDe function() { // If on identity: click on certifications - if ($state.is('app.wot_view_identity')) { + if ($state.is('app.wot_identity')) { var element = $window.document.getElementById('helptip-wot-view-certifications'); if (!element) return true; $timeout(function() { diff --git a/www/js/controllers/wallet-controllers.js b/www/js/controllers/wallet-controllers.js index 32c1542ac..70f9427d9 100644 --- a/www/js/controllers/wallet-controllers.js +++ b/www/js/controllers/wallet-controllers.js @@ -558,7 +558,7 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state, $scope.hideActionsPopover(); var title = $rootScope.walletData.name || $rootScope.walletData.uid || $rootScope.walletData.pubkey; - var url = $state.href('app.wot_view_identity', {pubkey: $rootScope.walletData.pubkey, uid: $rootScope.walletData.name || $rootScope.walletData.uid}, {absolute: true}); + var url = $state.href('app.wot_identity', {pubkey: $rootScope.walletData.pubkey, uid: $rootScope.walletData.name || $rootScope.walletData.uid}, {absolute: true}); UIUtils.popover.share(event, { bindings: { url: url, diff --git a/www/js/controllers/wot-controllers.js b/www/js/controllers/wot-controllers.js index e05b4f0d9..3cbb24d4f 100644 --- a/www/js/controllers/wot-controllers.js +++ b/www/js/controllers/wot-controllers.js @@ -14,7 +14,7 @@ angular.module('cesium.wot.controllers', ['cesium.services']) } }) - .state('app.wot_view_identity', { + .state('app.wot_identity', { url: "/wot/:pubkey/:uid", views: { 'menuContent': { @@ -25,12 +25,12 @@ angular.module('cesium.wot.controllers', ['cesium.services']) }) .state('app.wot_cert', { - url: "/wot/cert/:pubkey/:uid", + url: "/wot/:pubkey/:uid/cert", abstract: true, views: { 'menuContent': { templateUrl: "templates/wot/view_certifications.html", - controller: 'WotCertificationsViewCtrl' + controller: 'WotCertificationsTabsCtrl' } } }) @@ -40,7 +40,7 @@ angular.module('cesium.wot.controllers', ['cesium.services']) views: { 'tab-received-cert': { templateUrl: "templates/wot/tabs/tab_received_certifications.html", - controller: 'WotReceivedCertificationsTabCtrl' + controller: 'WotCertificationsViewCtrl' } }, data: { @@ -53,7 +53,7 @@ angular.module('cesium.wot.controllers', ['cesium.services']) views: { 'tab-given-cert': { templateUrl: "templates/wot/tabs/tab_given_certifications.html", - controller: 'WotGivenCertificationsTabCtrl' + controller: 'WotCertificationsViewCtrl' } }, data: { @@ -78,7 +78,7 @@ angular.module('cesium.wot.controllers', ['cesium.services']) views: { 'menuContent': { templateUrl: "templates/wot/view_certifications.html", - controller: 'WotCertificationsViewCtrl' + controller: 'WotIdentityViewCtrl' } } }) @@ -88,7 +88,7 @@ angular.module('cesium.wot.controllers', ['cesium.services']) views: { 'tab-received-cert': { templateUrl: "templates/wot/tabs/tab_received_certifications.html", - controller: 'WotReceivedCertificationsTabCtrl' + controller: 'WotCertificationsViewCtrl' } }, data: { @@ -101,7 +101,7 @@ angular.module('cesium.wot.controllers', ['cesium.services']) views: { 'tab-given-cert': { templateUrl: "templates/wot/tabs/tab_given_certifications.html", - controller: 'WotGivenCertificationsTabCtrl' + controller: 'WotCertificationsViewCtrl' } }, data: { @@ -125,13 +125,14 @@ angular.module('cesium.wot.controllers', ['cesium.services']) .controller('WotLookupModalCtrl', WotLookupModalController) + .controller('WotIdentityAbstractCtrl', WotIdentityAbstractController) + .controller('WotIdentityViewCtrl', WotIdentityViewController) - .controller('WotCertificationsViewCtrl', WotCertificationsViewController) - .controller('WotReceivedCertificationsTabCtrl', WotReceivedCertificationsTabController) + .controller('WotCertificationsTabsCtrl', WotCertificationsTabsController) - .controller('WotGivenCertificationsTabCtrl', WotGivenCertificationsTabController) + .controller('WotCertificationsViewCtrl', WotCertificationsViewController) ; @@ -297,7 +298,7 @@ function WotLookupController($scope, $state, $timeout, $focus, $ionicPopover, } // Open identity view else { - $state.go('app.wot_view_identity', { + $state.go('app.wot_identity', { pubkey: identity.pubkey, uid: identity.uid }); @@ -405,12 +406,11 @@ function WotLookupController($scope, $state, $timeout, $focus, $ionicPopover, } -function WotLookupModalController($scope, $state, $timeout, $focus, $ionicPopover, - UIUtils, csConfig, csSettings, Device, BMA, csWallet, csWot){ +function WotLookupModalController($scope, $focus){ 'ngInject'; - WotLookupController.call(this, $scope, $state, $timeout, $focus, $ionicPopover, - UIUtils, csConfig, csSettings, Device, BMA, csWallet, csWot); + // Initialize the super class and extend it. + angular.extend(this, $controller('WotLookupCtrl', {$scope: $scope})); $scope.search.loading = false; $scope.enableFilter = false; @@ -437,210 +437,106 @@ function WotLookupModalController($scope, $state, $timeout, $focus, $ionicPopove // endRemoveIf(device) } -function WotIdentityViewController($scope, $state, $timeout, UIUtils, csWot) { - 'ngInject'; - - $scope.formData = {}; - $scope.loading = true; - - $scope.$on('$ionicView.enter', function(e, state) { - if (state.stateParams && - state.stateParams.pubkey && - state.stateParams.pubkey.trim().length > 0) { - if ($scope.loading) { // load once - $scope.load(state.stateParams.pubkey.trim(), - true /*withCache*/, - state.stateParams.uid); - } - } - else { - // Redirect to app - $state.go('app.home'); - } - }); - - $scope.load = function(pubkey, withCache, uid) { - csWot.load(pubkey, withCache, uid) - .then(function(identity){ - $scope.formData = identity; - $scope.loading = false; - $timeout(function() { - UIUtils.motion.fadeSlideInRight(); - UIUtils.ink(); - }, 10); - }) - .catch(function(err) { - $scope.loading = false; - UIUtils.onError('ERROR.LOAD_IDENTITY_FAILED')(err); - }); - }; - - $scope.showCertifications = function() { - // Warn: do not use a simple link here (a ng-click is mandatory for help tour) - $state.go(UIUtils.screen.isSmall() ? 'app.wot_cert.received' : 'app.wot_cert_lg', { - pubkey: $scope.formData.pubkey, - uid: $scope.formData.uid - }); - }; - - $scope.showSharePopover = function(event) { - var title = $scope.formData.name || $scope.formData.uid || $scope.formData.pubkey; - var url = $state.href('app.wot_view_identity', {pubkey: $scope.formData.pubkey, uid: $scope.formData.uid}, {absolute: true}); - UIUtils.popover.share(event, { - bindings: { - url: url, - titleKey: 'WOT.VIEW.POPOVER_SHARE_TITLE', - titleValues: {title: title}, - postMessage: title - } - }); - }; - - $scope.showFab('fab-transfer'); - -} - /** - * Certifications controller - * + * Abtract controller that load identity, that expose some useful methods in $scope, like 'certify()' * @param $scope + * @param $state * @param $timeout - * @param $translate - * @param csSettings - * @param csWallet * @param UIUtils + * @param csConfig * @param csWot - * @param Modals + * @param csWallet * @constructor */ -function WotCertificationsViewController($scope, $rootScope, $state, $timeout, $translate, csConfig, csSettings, csWallet, UIUtils, csWot, Modals) { +function WotIdentityAbstractController($scope, $rootScope, $state, $timeout, UIUtils, csConfig, csWot, csWallet) { 'ngInject'; - $scope.loading = true; $scope.formData = {}; - - // Values overwritten in tab controller (for small screen) - $scope.showCertifications = true; - $scope.showGivenCertifications = true; - $scope.showAvatar = true; - - $scope.$on('$ionicView.enter', function(e, state) { - if (state.stateParams && state.stateParams.pubkey && - state.stateParams.pubkey.trim().length > 0) { - - if ($scope.loading) { - $scope.load(state.stateParams.pubkey.trim(), true /*withCache*/, state.stateParams.uid); - } - else { - $scope.doMotion(); - } - } - - // Load from wallet pubkey - else if (csWallet.isLogin()){ - if ($scope.loading) { - $scope.load(csWallet.data.pubkey, true /*withCache*/, csWallet.data.uid); - } - else { - $scope.doMotion(); - } - } - - // Redirect to home - else { - $timeout(function() { - $state.go('app.home', null); - }, 10); - } - }); + $scope.loading = true; $scope.load = function(pubkey, withCache, uid) { return csWot.load(pubkey, withCache, uid) - .then(function(identity){ - $scope.formData = identity; - $scope.canCertify = $scope.formData.hasSelf && (!csWallet.isLogin() || (!csWallet.isUserPubkey(pubkey))); - $scope.canSelectAndCertify = $scope.formData.hasSelf && csWallet.isUserPubkey(pubkey); - $scope.alreadyCertified = !$scope.canCertify || !csWallet.isLogin() ? false : - (!!_.findWhere(identity.received_cert, { pubkey: csWallet.data.pubkey, valid: true }) || - !!_.findWhere(identity.received_cert_pending, { pubkey: csWallet.data.pubkey, valid: true })); - - $scope.loading = false; - - // Effects - $scope.doMotion(); - - // Show help tip - var isWallet = csWallet.isUserPubkey(pubkey); - $scope.showHelpTip(isWallet); - }); + .then(function(identity){ + $scope.formData = identity; + $scope.canCertify = $scope.formData.hasSelf && (!csWallet.isLogin() || (!csWallet.isUserPubkey(pubkey))); + $scope.canSelectAndCertify = $scope.formData.hasSelf && csWallet.isUserPubkey(pubkey); + $scope.alreadyCertified = !$scope.canCertify || !csWallet.isLogin() ? false : + (!!_.findWhere(identity.received_cert, { pubkey: csWallet.data.pubkey, valid: true }) || + !!_.findWhere(identity.received_cert_pending, { pubkey: csWallet.data.pubkey, valid: true })); + $scope.loading = false; + }) + .catch(function(err) { + $scope.loading = false; + UIUtils.onError('ERROR.LOAD_IDENTITY_FAILED')(err); + }); }; // Certify the current identity $scope.certify = function() { $scope.loadWallet() - .then(function() { - UIUtils.loading.hide(); - - if (!csConfig.initPhase && !$rootScope.walletData.isMember) { - UIUtils.alert.error($rootScope.walletData.requirements.needSelf ? - 'ERROR.NEED_MEMBER_ACCOUNT_TO_CERTIFY' : 'ERROR.NEED_MEMBER_ACCOUNT_TO_CERTIFY_HAS_SELF'); - return; - } - - // Check identity not expired - if ($scope.formData.requirements.expired) { - UIUtils.alert.error('ERROR.IDENTITY_EXPIRED'); - return; - } + .then(function() { + UIUtils.loading.hide(); - // Check not already certified - var previousCert = _.findWhere($scope.formData.received_cert, { pubkey: csWallet.data.pubkey, valid: true}); - if (previousCert) { - $translate('ERROR.IDENTITY_ALREADY_CERTIFY', previousCert) - .then(function(message) { - UIUtils.alert.error(message, 'ERROR.UNABLE_TO_CERTIFY_TITLE'); - }); - return; - } + if (!csConfig.initPhase && !$rootScope.walletData.isMember) { + UIUtils.alert.error($rootScope.walletData.requirements.needSelf ? + 'ERROR.NEED_MEMBER_ACCOUNT_TO_CERTIFY' : 'ERROR.NEED_MEMBER_ACCOUNT_TO_CERTIFY_HAS_SELF'); + return; + } - // Check not pending certification - previousCert = _.findWhere($scope.formData.received_cert_pending, { pubkey: csWallet.data.pubkey, valid: true}); - if (previousCert) { - $translate('ERROR.IDENTITY_ALREADY_CERTIFY_PENDING', previousCert) - .then(function(message) { - UIUtils.alert.error(message, 'ERROR.UNABLE_TO_CERTIFY_TITLE'); - }); - return; - } + // Check identity not expired + if ($scope.formData.requirements.expired) { + UIUtils.alert.error('ERROR.IDENTITY_EXPIRED'); + return; + } + // Check not already certified + var previousCert = _.findWhere($scope.formData.received_cert, { pubkey: csWallet.data.pubkey, valid: true}); + if (previousCert) { + $translate('ERROR.IDENTITY_ALREADY_CERTIFY', previousCert) + .then(function(message) { + UIUtils.alert.error(message, 'ERROR.UNABLE_TO_CERTIFY_TITLE'); + }); + return; + } - UIUtils.alert.confirm('CONFIRM.CERTIFY_RULES') - .then(function(confirm){ - if (!confirm) { + // Check not pending certification + previousCert = _.findWhere($scope.formData.received_cert_pending, { pubkey: csWallet.data.pubkey, valid: true}); + if (previousCert) { + $translate('ERROR.IDENTITY_ALREADY_CERTIFY_PENDING', previousCert) + .then(function(message) { + UIUtils.alert.error(message, 'ERROR.UNABLE_TO_CERTIFY_TITLE'); + }); return; } - UIUtils.loading.show(); - csWallet.certify($scope.formData.uid, - $scope.formData.pubkey, - $scope.formData.timestamp, - $scope.formData.sig, - $scope.formData.isMember, - $scope.formData.wasMember) - .then(function(cert) { - UIUtils.loading.hide(); - if (cert) { - cert.uid = csWallet.data.uid; - cert.pubkey = csWallet.data.pubkey; - cert.isMember = csWallet.data.isMember; - UIUtils.alert.info('INFO.CERTIFICATION_DONE'); - $scope.formData.received_cert_pending.unshift(cert); - $scope.motionCertifications(); - } - }) - .catch(UIUtils.onError('ERROR.SEND_CERTIFICATION_FAILED')); - }); - }) - .catch(UIUtils.onError('ERROR.LOGIN_FAILED')); + + + UIUtils.alert.confirm('CONFIRM.CERTIFY_RULES') + .then(function(confirm){ + if (!confirm) { + return; + } + UIUtils.loading.show(); + csWallet.certify($scope.formData.uid, + $scope.formData.pubkey, + $scope.formData.timestamp, + $scope.formData.sig, + $scope.formData.isMember, + $scope.formData.wasMember) + .then(function(cert) { + UIUtils.loading.hide(); + if (cert) { + cert.uid = csWallet.data.uid; + cert.pubkey = csWallet.data.pubkey; + cert.isMember = csWallet.data.isMember; + UIUtils.alert.info('INFO.CERTIFICATION_DONE'); + $scope.formData.received_cert_pending.unshift(cert); + $scope.motionCertifications(); + } + }) + .catch(UIUtils.onError('ERROR.SEND_CERTIFICATION_FAILED')); + }); + }) + .catch(UIUtils.onError('ERROR.LOGIN_FAILED')); }; // Select an identity and certify @@ -737,56 +633,157 @@ function WotCertificationsViewController($scope, $rootScope, $state, $timeout, $ }; - // Updating wallet data - $scope.doUpdate = function() { - $scope.load($scope.formData.pubkey, false /*no cache*/); + $scope.doMotion = function() { + $timeout(function() { + UIUtils.motion.fadeSlideInRight(); + UIUtils.ink(); + }, 10); }; + /* -- open screens -- */ - $scope.doMotion = function() { - $scope.motionCertifications(100); + $scope.showCertifications = function() { + // Warn: do not use a simple link here (a ng-click is mandatory for help tour) + $state.go(UIUtils.screen.isSmall() ? 'app.wot_cert.received' : 'app.wot_cert_lg', { + pubkey: $scope.formData.pubkey, + uid: $scope.formData.uid + }); + }; - if ($scope.showAvatar) { - // Effects - $timeout(function () { - UIUtils.motion.toggleOn({selector: '.col-avatar .motion'}); - }, 300); + $scope.showSharePopover = function(event) { + var title = $scope.formData.name || $scope.formData.uid || $scope.formData.pubkey; + var url = $state.href('app.wot_identity', {pubkey: $scope.formData.pubkey, uid: $scope.formData.uid}, {absolute: true}); + UIUtils.popover.share(event, { + bindings: { + url: url, + titleKey: 'WOT.VIEW.POPOVER_SHARE_TITLE', + titleValues: {title: title}, + postMessage: title + } + }); + }; + + +} + +/** + * Identity view controller - should extend WotIdentityAbstractCtrl + */ +function WotIdentityViewController($scope, $controller, $timeout, UIUtils) { + 'ngInject'; + // Initialize the super class and extend it. + angular.extend(this, $controller('WotIdentityAbstractCtrl', {$scope: $scope})); + + $scope.$on('$ionicView.enter', function(e, state) { + + if (state.stateParams && + state.stateParams.pubkey && + state.stateParams.pubkey.trim().length > 0) { + if ($scope.loading) { // load once + return $scope.load(state.stateParams.pubkey.trim(), true /*withCache*/, state.stateParams.uid) + .then(function() { + $scope.doMotion(); + }); + } } - $scope.motionGivenCertifications($scope.showCertifications ? 900 : 100); + // Load from wallet pubkey + else if (csWallet.isLogin()){ + if ($scope.loading) { + return $scope.load(csWallet.data.pubkey, true /*withCache*/, csWallet.data.uid) + .then(function() { + $scope.doMotion(); + }); + } + } + + // Redirect to home + else { + $scope.showHome(); + } + }); + + $scope.doMotion = function() { + // Effects + $timeout(function () { + UIUtils.motion.fadeSlideInRight(); + UIUtils.ink(); + }, 10); + + $scope.showFab('fab-transfer'); + } +} + +/** + * Certifications controller - should extend WotIdentityAbstractCtrl + */ +function WotCertificationsViewController($scope, $rootScope, $controller, $timeout, csSettings, csWallet, UIUtils) { + 'ngInject'; +// Initialize the super class and extend it. + angular.extend(this, $controller('WotIdentityAbstractCtrl', {$scope: $scope})); + + // Values overwritten in tab controller (for small screen) + $scope.motions = { + receivedCertifications: true, + givenCertifications: true, + avatar: true }; - // Show help tip - $scope.showHelpTip = function(isWallet) { - if (!$scope.isLogin()) return; - if (!csSettings.data.helptip.enable) return; + $scope.$on('$ionicView.enter', function(e, state) { - // Create a new scope for the tour controller - var helptipScope = $scope.createHelptipScope(); - if (!helptipScope) return; // could be undefined, if a global tour already is already started + if (state.stateParams && + state.stateParams.pubkey && + state.stateParams.pubkey.trim().length > 0) { + if ($scope.loading) { // load once + return $scope.load(state.stateParams.pubkey.trim(), true /*withCache*/, state.stateParams.uid) + .then(function() { + $scope.doMotion(); + $scope.showHelpTip(); + }); + } + } - var index = isWallet ? csSettings.data.helptip.walletCerts : csSettings.data.helptip.wotCerts; - if (index < 0) return; + // Load from wallet pubkey + else if (csWallet.isLogin()){ + if ($scope.loading) { + return $scope.load(csWallet.data.pubkey, true /*withCache*/, csWallet.data.uid) + .then(function() { + $scope.doMotion(); + $scope.showHelpTip(); + }); + } + } - var startFunc = isWallet ? - helptipScope.startWalletCertTour(index, false) : - helptipScope.startWotCertTour(index, false); + // Redirect to home + else { + $scope.showHome(); + } + }); - return startFunc.then(function(endIndex) { - helptipScope.$destroy(); - if (isWallet) { - csSettings.data.helptip.walletCerts = endIndex; - } - else { - csSettings.data.helptip.wotCerts = endIndex; - } - csSettings.store(); + // Updating data + $scope.doUpdate = function() { + return $scope.load($scope.formData.pubkey, false /*no cache*/, $scope.formData.uid) + .then(function() { + $scope.doMotion(); + $scope.showHelpTip(); }); }; - // Show received certifcations (animation need in tabs) - $scope.motionCertifications = function(timeout) { - if ($scope.showCertifications) { + $scope.doMotion = function() { + // Effects + $scope.doMotionReceivedCertifications(100); + if ($scope.motions.avatar) { + // Effects + $timeout(function () { + UIUtils.motion.toggleOn({selector: '.col-avatar .motion'}); + }, 300); + } + $scope.doMotionGivenCertifications($scope.motions.receivedCertifications ? 900 : 100); + }; + + // Effects on received certifcations + $scope.doMotionReceivedCertifications = function(timeout) { + if ($scope.motions.receivedCertifications) { // Effects $timeout(function() { UIUtils.motion.fadeSlideInRight({selector: '.list.certifications .item'}); @@ -796,6 +793,7 @@ function WotCertificationsViewController($scope, $rootScope, $state, $timeout, $ $scope.showFab('fab-certify'); } } + // If not enable, make sure to hide fab button else { if ($scope.canCertify || $rootScope.tour) { $scope.hideFab('fab-certify', 0); @@ -803,10 +801,10 @@ function WotCertificationsViewController($scope, $rootScope, $state, $timeout, $ } }; - // Show given certifcations (animation need in tabs) - $scope.motionGivenCertifications = function(timeout) { - if ($scope.showGivenCertifications) { - // Effects + // Effects on given certifcations + $scope.doMotionGivenCertifications = function(timeout) { + + if ($scope.motions.givenCertifications) { $timeout(function() { UIUtils.motion.fadeSlideInRight({selector: '.list.given-certifications .item'}); UIUtils.ink({selector: '.list.given-certifications .ink'}); @@ -815,27 +813,50 @@ function WotCertificationsViewController($scope, $rootScope, $state, $timeout, $ $scope.showFab('fab-select-certify'); } } + + // If not enable, make sure to hide fab button else { if ($scope.canSelectAndCertify || $rootScope.tour) { $scope.hideFab('fab-select-certify', 0); } } }; -} + // Show help tip + $scope.showHelpTip = function() { + if (!$scope.isLogin()) return; + if (!csSettings.data.helptip.enable) return; -function WotReceivedCertificationsTabController($scope) { + // Create a new scope for the tour controller + var helptipScope = $scope.createHelptipScope(); + if (!helptipScope) return; // could be undefined, if a global tour already is already started - $scope.showCertifications = true; - $scope.showGivenCertifications = false; - $scope.showAvatar = false; -} + var isWallet = csWallet.isUserPubkey($scope.formData.pubkey); + var index = isWallet ? csSettings.data.helptip.walletCerts : csSettings.data.helptip.wotCerts; + if (index < 0) return; -function WotGivenCertificationsTabController($scope) { + var startFunc = isWallet ? + helptipScope.startWalletCertTour(index, false) : + helptipScope.startWotCertTour(index, false); - $scope.showCertifications = false; - $scope.showGivenCertifications = true; - $scope.showAvatar = false; + return startFunc.then(function(endIndex) { + helptipScope.$destroy(); + if (isWallet) { + csSettings.data.helptip.walletCerts = endIndex; + } + else { + csSettings.data.helptip.wotCerts = endIndex; + } + csSettings.store(); + }); + }; } +function WotCertificationsTabsController($scope, $stateParams) { + + $scope.formData = { + pubkey: $stateParams.pubkey, + uid: $stateParams.uid + }; +} diff --git a/www/plugins/es/js/controllers/wot-controllers.js b/www/plugins/es/js/controllers/wot-controllers.js index badaedd38..668ae446e 100644 --- a/www/plugins/es/js/controllers/wot-controllers.js +++ b/www/plugins/es/js/controllers/wot-controllers.js @@ -5,7 +5,7 @@ angular.module('cesium.es.wot.controllers', ['cesium.es.services']) var enable = csConfig.plugins && csConfig.plugins.es; if (enable) { - PluginServiceProvider.extendState('app.wot_view_identity', { + PluginServiceProvider.extendState('app.wot_identity', { points: { 'general': { templateUrl: "plugins/es/templates/wot/view_identity_extend.html", diff --git a/www/plugins/es/templates/common/item_comment_content.html b/www/plugins/es/templates/common/item_comment_content.html index b67dd1f6d..6ddc4d612 100644 --- a/www/plugins/es/templates/common/item_comment_content.html +++ b/www/plugins/es/templates/common/item_comment_content.html @@ -9,7 +9,7 @@ <a class="pull-left" ng-class="{'positive': comment.uid, 'dark': !comment.uid}" - ui-sref="app.wot_view_identity({pubkey:comment.issuer, uid: comment.name||comment.uid})"> + ui-sref="app.wot_identity({pubkey:comment.issuer, uid: comment.name||comment.uid})"> <ng-if ng-if="comment.uid"> {{::comment.name||comment.uid}} </ng-if> diff --git a/www/plugins/es/templates/market/view_record.html b/www/plugins/es/templates/market/view_record.html index 79d1037e8..33c911687 100644 --- a/www/plugins/es/templates/market/view_record.html +++ b/www/plugins/es/templates/market/view_record.html @@ -43,7 +43,7 @@ <i class="icon ion-clock"></i> <span translate>COMMON.SUBMIT_BY</span> <a ng-class="{'positive': issuer.uid, 'gray': !issuer.uid}" - ui-sref="app.wot_view_identity({pubkey:issuer.pubkey, uid: issuer.name||issuer.uid})"> + ui-sref="app.wot_identity({pubkey:issuer.pubkey, uid: issuer.name||issuer.uid})"> <ng-if ng-if="issuer.uid"> <i class="icon ion-person"></i> {{issuer.name||issuer.uid}} @@ -81,7 +81,7 @@ <i class="icon ion-clock"></i> <span translate>COMMON.SUBMIT_BY</span> <a ng-class="{'positive': issuer.uid, 'gray': !issuer.uid}" - ui-sref="app.wot_view_identity({pubkey:issuer.pubkey, uid: issuer.name||issuer.uid})"> + ui-sref="app.wot_identity({pubkey:issuer.pubkey, uid: issuer.name||issuer.uid})"> <ng-if ng-if="issuer.uid"> <i class="icon ion-person"></i> {{issuer.name||issuer.uid}} diff --git a/www/plugins/es/templates/message/list.html b/www/plugins/es/templates/message/list.html index 7f6a83a1b..b80ae160b 100644 --- a/www/plugins/es/templates/message/list.html +++ b/www/plugins/es/templates/message/list.html @@ -75,12 +75,12 @@ <h3> <a class="positive" ng-if="msg.name||msg.uid" - ui-sref="app.wot_view_identity({pubkey:msg.issuer, uid:msg.name||msg.uid})"> + ui-sref="app.wot_identity({pubkey:msg.issuer, uid:msg.name||msg.uid})"> <i class="ion-person"></i> {{::msg.name||msg.uid}} </a> <a class="gray" ng-if="!msg.name && !msg.uid" - ui-sref="app.wot_view_identity({pubkey:msg.issuer})"> + ui-sref="app.wot_identity({pubkey:msg.issuer})"> <i class="ion-key"></i> {{::msg.issuer|formatPubkey}} </a> diff --git a/www/plugins/es/templates/message/view_message.html b/www/plugins/es/templates/message/view_message.html index c3b71cccf..714dd955b 100644 --- a/www/plugins/es/templates/message/view_message.html +++ b/www/plugins/es/templates/message/view_message.html @@ -51,7 +51,7 @@ <h4> <i class="ion-clock"></i> {{type == 'inbox' ? 'MESSAGE.VIEW.SENDER': 'MESSAGE.VIEW.RECIPIENT'|translate}} - <a class="positive" ui-sref="app.wot_view_identity({pubkey: (type == 'inbox') ? formData.issuer : formData.recipient, uid: formData.name||formData.uid})"> + <a class="positive" ui-sref="app.wot_identity({pubkey: (type == 'inbox') ? formData.issuer : formData.recipient, uid: formData.name||formData.uid})"> <span ng-if="formData.uid"> <i class="ion-person"></i> {{formData.name||formData.uid}} diff --git a/www/plugins/es/templates/registry/view_record.html b/www/plugins/es/templates/registry/view_record.html index 09d43b242..38e9ff83c 100644 --- a/www/plugins/es/templates/registry/view_record.html +++ b/www/plugins/es/templates/registry/view_record.html @@ -47,7 +47,7 @@ <i class="icon ion-clock" ng-if="formData.time"></i> <span translate>COMMON.SUBMIT_BY</span> <a ng-class="{'positive': issuer.uid, 'gray': !issuer.uid}" - ui-sref="app.wot_view_identity({pubkey:issuer.pubkey, uid: issuer.name||issuer.uid})"> + ui-sref="app.wot_identity({pubkey:issuer.pubkey, uid: issuer.name||issuer.uid})"> <ng-if ng-if="issuer.uid"> <i class="icon ion-person"></i> {{::issuer.name||issuer.uid}} diff --git a/www/plugins/es/templates/wot/view_identity_extend.html b/www/plugins/es/templates/wot/view_identity_extend.html index 71ef33d94..658583c6d 100644 --- a/www/plugins/es/templates/wot/view_identity_extend.html +++ b/www/plugins/es/templates/wot/view_identity_extend.html @@ -1,8 +1,8 @@ <!-- Buttons section --> <ng-if ng-if="enable && extensionPoint === 'buttons'"> - <button class="button button-stable icon ion-compose" - ng-click="showNewMessageModal()"> - {{'MESSAGE.BTN_WRITE' | translate}} + <button class="button button-stable button-small-padding icon ion-compose" + ng-click="showNewMessageModal()" + title="{{'MESSAGE.BTN_WRITE' | translate}}"> </button> </ng-if> @@ -10,10 +10,10 @@ <ng-if ng-if="enable && extensionPoint === 'general'"> <!-- About me --> - <ng-if ng-if="formData.profile.description"> + <ng-if ng-if="::formData.profile.description"> <div class="item item-divider" translate>PROFILE.DESCRIPTION</div> - <ion-item class="item-icon-left"> + <ion-item class="item-icon-left item-text-wrap"> <span class="text-keep-lines">{{formData.profile.description}} </span> </ion-item> @@ -21,30 +21,30 @@ <!-- Localisation --> - <ng-if ng-if="formData.profile.address || formData.profile.city"> + <ng-if ng-if="::formData.profile.address || formData.profile.city"> <div class="item item-divider" translate>PROFILE.LOCATION_DIVIDER</div> - <ion-item class="item-icon-left ink" copy-on-click="{{formData.profile.address ? formData.profile.address + ' ' : ''}}{{formData.profile.city}}"> - <span class="text-keep-lines" ng-if="formData.profile.address">{{formData.profile.address}} + <ion-item class="item-icon-left ink" copy-on-click="{{::formData.profile.address ? formData.profile.address + ' ' : ''}}{{::formData.profile.city}}"> + <span class="text-keep-lines" ng-if="::formData.profile.address">{{formData.profile.address}} </span> - <span>{{formData.profile.city}}</span> + <span>{{::formData.profile.city}}</span> </ion-item> </ng-if> <!-- Socials networks --> - <ng-if ng-if="formData.profile.socials && formData.profile.socials.length>0"> + <ng-if ng-if="::formData.profile.socials && formData.profile.socials.length>0"> <span class="item item-divider" translate>PROFILE.SOCIAL_NETWORKS_DIVIDER</span> - <ion-item class="item-icon-left" + <ion-item class="item-icon-left item-text-wrap" type="no-padding item-text-wrap" - ng-repeat="social in formData.profile.socials track by social.url" - id="social-{{social.url|formatSlug}}"> - <i class="icon ion-social-{{social.type}}" + ng-repeat="social in ::formData.profile.socials track by social.url" + id="social-{{::social.url|formatSlug}}"> + <i class="icon ion-social-{{::social.type}}" ng-class="{'ion-bookmark': social.type == 'other', 'ion-link': social.type == 'web', 'ion-email': social.type == 'email'}"></i> - <p ng-if="social.type && social.type != 'web'">{{social.type}}</p> + <p ng-if="::social.type && social.type != 'web'">{{::social.type}}</p> <h2> - <a href="{{social.url}}" ng-if="social.type != 'email'" target="_blank">{{social.url}}</a> - <a href="mailto:{{social.url}}" ng-if="social.type == 'email'">{{social.url}}</a> + <a href="{{social.url}}" ng-if="::social.type != 'email'" target="_blank">{{::social.url}}</a> + <a href="mailto:{{social.url}}" ng-if="::social.type == 'email'">{{::social.url}}</a> </h2> </ion-item> </ng-if> diff --git a/www/templates/blockchain/link_identity.html b/www/templates/blockchain/link_identity.html index 4f719a5c7..9c6a5a791 100644 --- a/www/templates/blockchain/link_identity.html +++ b/www/templates/blockchain/link_identity.html @@ -1,4 +1,4 @@ -<a ui-sref="app.wot_view_identity({pubkey: identity.pubkey, uid: identity.uid})"> +<a ui-sref="app.wot_identity({pubkey: identity.pubkey, uid: identity.uid})"> <span class="positive" ng-if="identity.uid"><i class="icon ion-person"></i> {{::identity.uid}} </span> <span class="gray" ng-class="{'hidden-xs hidden-sm': identity.uid}"><i class="icon ion-key"></i> {{::identity.pubkey|formatPubkey}}</span> </a> diff --git a/www/templates/blockchain/view_block.html b/www/templates/blockchain/view_block.html index 39da349c3..f1c8623c7 100644 --- a/www/templates/blockchain/view_block.html +++ b/www/templates/blockchain/view_block.html @@ -33,7 +33,7 @@ {{'BLOCKCHAIN.VIEW.COMPUTED_BY'|translate}} </span> <a class="positive" - ui-sref="app.wot_view_identity({pubkey:issuer.pubkey, uid: issuer.uid})"> + ui-sref="app.wot_identity({pubkey:issuer.pubkey, uid: issuer.uid})"> <i class="icon ion-person positive"></i> {{issuer.name||issuer.uid}} </a> diff --git a/www/templates/network/items_peers.html b/www/templates/network/items_peers.html index 316ec51ae..ec7145d5f 100644 --- a/www/templates/network/items_peers.html +++ b/www/templates/network/items_peers.html @@ -34,7 +34,7 @@ <div class="col no-padding"> <h3> <span ng-if="peer.uid" - ui-sref="app.wot_view_identity({pubkey: peer.pubkey, uid: peer.uid})"> + ui-sref="app.wot_identity({pubkey: peer.pubkey, uid: peer.uid})"> {{peer.name||peer.uid}} </span> <span ng-if="!peer.uid"> diff --git a/www/templates/wallet/view_wallet.html b/www/templates/wallet/view_wallet.html index 95f07267d..7668ed044 100644 --- a/www/templates/wallet/view_wallet.html +++ b/www/templates/wallet/view_wallet.html @@ -55,18 +55,23 @@ <div class="hidden-xs hidden-sm padding text-center" ng-if="!loading"> <button class="button button-stable button-small-padding icon ion-android-share-alt ink" - ng-click="showSharePopover($event)"> + ng-click="showSharePopover($event)" + title="{{'COMMON.BTN_SHARE' | translate}}"> </button> + <button class="button button-stable button-small-padding icon ion-loop ink" + ng-click="doUpdate()" + title="{{'COMMON.BTN_REFRESH' | translate}}"> + </button> + + + <button class="button button-calm ink" ng-click="showTransferModal()"> {{:locale:'COMMON.BTN_SEND_MONEY' | translate}} </button> - - <button class="button button-stable button-small-padding icon ion-loop ink" - ng-click="doUpdate()"> - </button> + <button id="helptip-wallet-options" class="button button-stable icon-right ink" @@ -97,7 +102,8 @@ ng-if="walletData.isMember||walletData.requirements.pendingMembership" ng-click="showCertifications()"> <i class="icon ion-ribbon-b"></i> - <span clas="input-label" ng-bind-html="'ACCOUNT.CERTIFICATION_COUNT'|translate"></span> + <span class="input-label hidden-xs" translate>ACCOUNT.CERTIFICATION_COUNT</span> + <span class="input-label visible-xs" translate>ACCOUNT.CERTIFICATION_COUNT_SHORT</span> <cs-badge-certification requirements="walletData.requirements" parameters="{sigQty: walletData.parameters.sigQty}"> </cs-badge-certification> @@ -164,7 +170,7 @@ <h2 class="col-80"> <i class="icon ion-clock"> </i> - <a ui-sref="app.wot_view_identity({pubkey:tx.pubkey, uid:tx.name||tx.uid})" class="positive"> + <a ui-sref="app.wot_identity({pubkey:tx.pubkey, uid:tx.name||tx.uid})" class="positive"> <span ng-if="tx.uid"> {{::tx.name||tx.uid}} </span> @@ -222,7 +228,7 @@ ng-class="{'ion-arrow-up-c': tx.isUD, 'ion-person': tx.uid, 'ion-card': !tx.uid && !tx.isUD}"></i> <i ng-if="tx.avatar" class="item-image avatar" style="background-image: url({{::tx.avatar.src}})"></i> <h2 class="col-80"> - <a ui-sref="app.wot_view_identity({pubkey:tx.pubkey, uid:tx.uid})" class="positive"> + <a ui-sref="app.wot_identity({pubkey:tx.pubkey, uid:tx.uid})" class="positive"> <span ng-if="tx.uid"> {{::tx.name||tx.uid}} </span> diff --git a/www/templates/wallet/view_wallet_tx_error.html b/www/templates/wallet/view_wallet_tx_error.html index 5010919df..b9cb3d703 100644 --- a/www/templates/wallet/view_wallet_tx_error.html +++ b/www/templates/wallet/view_wallet_tx_error.html @@ -46,7 +46,7 @@ <span class="item ink item-badge-right" ng-repeat="tx in $root.walletData.tx.errors | filter: filterNegative('amount')"> <h2> <i class="icon" ng-class="{'ion-clock': tx.valid, 'ion-close-circled assertive': !tx.valid}"> </i> - <span ui-sref="app.wot_view_identity({pubkey:tx.pubkey, uid:tx.uid})" class="positive"> + <span ui-sref="app.wot_identity({pubkey:tx.pubkey, uid:tx.uid})" class="positive"> <span ng-if="tx.uid"> <i class="icon ion-person"></i> {{::tx.uid}} @@ -87,7 +87,7 @@ <span class="item ink item-badge-right" ng-repeat="tx in $root.walletData.tx.errors | filter: filterPositive('amount')"> <h2> <i class="icon" ng-class="{'ion-clock': tx.valid, 'ion-close-circled assertive': !tx.valid}"> </i> - <span ui-sref="app.wot_view_identity({pubkey:tx.pubkey, uid:tx.uid})" class="positive"> + <span ui-sref="app.wot_identity({pubkey:tx.pubkey, uid:tx.uid})" class="positive"> <span ng-if="tx.uid"> <i class="icon ion-person"></i> {{::tx.uid}} diff --git a/www/templates/wot/items_given_certifications.html b/www/templates/wot/items_given_certifications.html index ddb495752..e31105536 100644 --- a/www/templates/wot/items_given_certifications.html +++ b/www/templates/wot/items_given_certifications.html @@ -43,7 +43,7 @@ <a class="item item-avatar ink" ng-repeat="cert in formData.given_cert_pending" - ui-sref="app.wot_view_identity({pubkey:cert.pubkey, uid:cert.uid})" + ui-sref="app.wot_identity({pubkey:cert.pubkey, uid:cert.uid})" ng-include="'templates/wot/item_certification.html'"> </a> @@ -59,7 +59,7 @@ <a class="item item-avatar ink" ng-repeat="cert in formData.given_cert" - ui-sref="app.wot_view_identity({pubkey:cert.pubkey, uid:cert.uid})" + ui-sref="app.wot_identity({pubkey:cert.pubkey, uid:cert.uid})" ng-include="'templates/wot/item_certification.html'"> </a> </div> diff --git a/www/templates/wot/items_received_certifications.html b/www/templates/wot/items_received_certifications.html index 055e9e6f3..cbacd3943 100644 --- a/www/templates/wot/items_received_certifications.html +++ b/www/templates/wot/items_received_certifications.html @@ -33,7 +33,7 @@ <a class="item item-avatar ink" ng-repeat="cert in formData.received_cert_pending" - ui-sref="app.wot_view_identity({pubkey:cert.pubkey, uid:cert.uid})" + ui-sref="app.wot_identity({pubkey:cert.pubkey, uid:cert.uid})" ng-include="'templates/wot/item_certification.html'"> </a> @@ -48,7 +48,7 @@ <a class="item item-avatar ink" ng-repeat="cert in formData.received_cert" - ui-sref="app.wot_view_identity({pubkey:cert.pubkey, uid:cert.uid})" + ui-sref="app.wot_identity({pubkey:cert.pubkey, uid:cert.uid})" ng-include="'templates/wot/item_certification.html'"> </a> </div> diff --git a/www/templates/wot/tabs/tab_given_certifications.html b/www/templates/wot/tabs/tab_given_certifications.html index 8160321f5..ee8df2206 100644 --- a/www/templates/wot/tabs/tab_given_certifications.html +++ b/www/templates/wot/tabs/tab_given_certifications.html @@ -4,7 +4,7 @@ </button> </ion-nav-buttons> - <ion-content> + <ion-content ng-init="motions.receivedCertifications=false"> <div class="center padding" ng-if="loading"> <ion-spinner icon="android"></ion-spinner> </div> diff --git a/www/templates/wot/tabs/tab_received_certifications.html b/www/templates/wot/tabs/tab_received_certifications.html index 2f9ccaa03..1537ba3b0 100644 --- a/www/templates/wot/tabs/tab_received_certifications.html +++ b/www/templates/wot/tabs/tab_received_certifications.html @@ -4,7 +4,7 @@ </button> </ion-nav-buttons> - <ion-content> + <ion-content ng-init="motions.givenCertifications=false"> <div class="center padding" ng-if="loading"> <ion-spinner icon="android"></ion-spinner> </div> diff --git a/www/templates/wot/view_certifications_lg.html b/www/templates/wot/view_certifications_lg.html index 1b636d22b..20e2e26ac 100644 --- a/www/templates/wot/view_certifications_lg.html +++ b/www/templates/wot/view_certifications_lg.html @@ -1,6 +1,4 @@ -<ion-view left-buttons="leftButtons" - cache-view="false" - > +<ion-view left-buttons="leftButtons"> <ion-nav-title> <span class="visible-xs visible-sm">{{::formData.name||formData.uid}}</span> <span class="hidden-xs hidden-sm" @@ -13,8 +11,7 @@ </button> </ion-nav-buttons> - <ion-content class="certifications certifications-lg" - ng-init="initLargeView()"> + <ion-content class="certifications certifications-lg"> <div class="center padding" ng-if="loading"> <ion-spinner icon="android"></ion-spinner> @@ -23,8 +20,9 @@ <!-- Buttons bar --> <div class="hidden-xs hidden-sm text-center padding" ng-if="canCertify || canSelectAndCertify"> - <button class="button button-raised icon ion-loop ink" - ng-click="doUpdate()"> + <button class="button button-stable button-small-padding icon ion-loop ink" + ng-click="doUpdate()" + title="{{'COMMON.BTN_REFRESH' | translate}}"> </button> <button id="helptip-certs-certify" class="button button-raised button-calm icon-left ion-ribbon-b" @@ -56,7 +54,7 @@ </div> <div class="col text-center no-padding"> <a style="text-decoration: none;" - ui-sref="app.wot_view_identity({pubkey: formData.pubkey, uid: formData.name||formData.uid})"> + ui-sref="app.wot_identity({pubkey: formData.pubkey, uid: formData.name||formData.uid})"> <i class="avatar avatar-large" ng-if="!formData.avatar" ng-class="{'avatar-wallet': !formData.isMember, 'avatar-member': formData.isMember}"></i> diff --git a/www/templates/wot/view_identity.html b/www/templates/wot/view_identity.html index 2821e34ed..ad0bf0fb5 100644 --- a/www/templates/wot/view_identity.html +++ b/www/templates/wot/view_identity.html @@ -1,4 +1,4 @@ -<ion-view left-buttons="leftButtons" > +<ion-view left-buttons="leftButtons"> <ion-nav-title> </ion-nav-title> @@ -6,19 +6,19 @@ <div class="positive-900-bg hero"> <div class="content" ng-if="!loading"> <i class="avatar" - ng-if="!formData.avatar" + ng-if="::!formData.avatar" ng-class="{'avatar-wallet': !formData.isMember, 'avatar-member': formData.isMember}"></i> <i class="avatar" - ng-if="formData.avatar" + ng-if="::formData.avatar" style="background-image: url({{::formData.avatar.src}})"></i> - <ng-if ng-if="formData.name"> - <h3 class="light" ng-if="formData.name">{{::formData.name}}</h3> + <ng-if ng-if="::formData.name"> + <h3 class="light">{{::formData.name}}</h3> </ng-if> - <ng-if ng-if="!formData.name"> - <h3 class="light" ng-if="formData.uid">{{formData.uid}}</h3> - <h3 class="light" ng-if="!formData.uid"><i class="ion-key"></i> {{formData.pubkey | formatPubkey}}</h3> + <ng-if ng-if="::!formData.name"> + <h3 class="light" ng-if="::formData.uid">{{::formData.uid}}</h3> + <h3 class="light" ng-if="::!formData.uid"><i class="ion-key"></i> {{::formData.pubkey | formatPubkey}}</h3> </ng-if> - <h4 class="assertive"><ng-if ng-if="(formData.name || formData.uid) && !formData.isMember" translate>WOT.NOT_MEMBER_PARENTHESIS</ng-if></h4> + <h4 class="assertive"><ng-if ng-if="::(formData.name || formData.uid) && !formData.isMember" translate>WOT.NOT_MEMBER_PARENTHESIS</ng-if></h4> </div> <h4 class="content light" ng-if="loading"> <ion-spinner icon="android"></ion-spinner> @@ -27,13 +27,23 @@ <!-- button bar--> <div class="hidden-xs hidden-sm padding text-center"> - <button class="button button-stable icon ion-android-share-alt ink" - ng-click="showSharePopover($event)"> + <button class="button button-stable button-small-padding icon ion-android-share-alt ink" + ng-click="showSharePopover($event)" + title="{{'COMMON.BTN_SHARE' | translate}}"> </button> <!-- Allow extension here --> <cs-extension-point name="buttons"></cs-extension-point> + <button id="helptip-certs-certify" + class="button button-stable button-small-padding icon ion-ribbon-b ink" + ng-click="certify()" + title="{{'WOT.BTN_CERTIFY' | translate}}" + ng-disabled="alreadyCertified"> + </button> + + + <button class="button button-calm ink" ng-click="showTransferModal({pubkey:formData.pubkey, uid: formData.name||formData.uid})"> {{'COMMON.BTN_SEND_MONEY' | translate}} @@ -41,8 +51,7 @@ </div> <div class="row no-padding"> - <div class="col col-20 hidden-xs hidden-sm"> - </div> + <div class="col col-20 hidden-xs hidden-sm"> </div> <div class="col list animate-fade-slide-in-right"> @@ -100,8 +109,7 @@ <cs-extension-point name="technical"></cs-extension-point> </div> - <div class="col col-20 hidden-xs hidden-sm"> - </div> + <div class="col col-20 hidden-xs hidden-sm"> </div> </div> </ion-content> -- GitLab