From 382794c295bfc24eff6ed1d140bc0c11364bf70a Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Mon, 31 Jul 2017 18:10:25 +0200
Subject: [PATCH] [fix] Wallet creation: better title and button text - fix
 #520

---
 www/i18n/locale-en-GB.json                |  4 ++++
 www/i18n/locale-en.json                   |  4 ++++
 www/i18n/locale-fr-FR.json                |  5 ++++-
 www/js/controllers/join-controllers.js    | 16 +++++++++-------
 www/templates/join/modal_join_member.html |  2 +-
 www/templates/join/modal_join_wallet.html |  7 +++----
 www/templates/login/modal_login.html      |  2 +-
 7 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/www/i18n/locale-en-GB.json b/www/i18n/locale-en-GB.json
index ca53dad4..69087d7b 100644
--- a/www/i18n/locale-en-GB.json
+++ b/www/i18n/locale-en-GB.json
@@ -33,6 +33,7 @@
     "BTN_REFRESH": "Refresh",
     "BTN_START": "Start",
     "BTN_CONTINUE": "Continue",
+    "BTN_CREATE": "Create",
     "BTN_UNDERSTOOD": "I understood",
     "BTN_OPTIONS": "Options",
     "BTN_HELP_TOUR": "Features tour",
@@ -279,6 +280,7 @@
     "CURRENT_BLOCK" : "Block #",
     "POPOVER_FILTER_TITLE": "Filter",
     "OFFLINE": "Offline peers",
+    "BTN_SHOW_PEER": "Show peer",
     "VIEW": {
       "TITLE": "Peer",
       "OWNER": "Owned by ",
@@ -466,8 +468,10 @@
       "REGISTRATION_NODE_HELP": "If you do not trust this peer, please change <a ng-click=\"doQuickFix('settings')\">in the settings</a> of Cesium.",
       "SELECT_ACCOUNT_TYPE": "Choose the type of account to create:",
       "MEMBER_ACCOUNT": "Member account",
+      "MEMBER_ACCOUNT_TITLE": "Create a member account",
       "MEMBER_ACCOUNT_HELP": "If you are not yet registered as an individual (one account possible per individual).",
       "WALLET_ACCOUNT": "Simple wallet",
+      "WALLET_ACCOUNT_TITLE": "Create a wallet",
       "WALLET_ACCOUNT_HELP": "If you represent a company, association, etc. or simply need an additional wallet. No universal dividend will be created by this account.",
       "SALT_WARNING": "Choose a secret identifier.<br/>You need it for each connection to this account.<br/><br/><b>Make sure to remember this identifier</b>.<br/>If lost, there are no means to retrieve it!",
       "PASSWORD_WARNING": "Choose a password.<br/>You need it for each connection to this account.<br/><br/><b>Make sure to remember this password</b>.<br/>If lost, there are no means to retrieve it!",
diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json
index ab30d6b7..655497a5 100644
--- a/www/i18n/locale-en.json
+++ b/www/i18n/locale-en.json
@@ -33,6 +33,7 @@
     "BTN_REFRESH": "Refresh",
     "BTN_START": "Start",
     "BTN_CONTINUE": "Continue",
+    "BTN_CREATE": "Create",
     "BTN_UNDERSTOOD": "I understood",
     "BTN_OPTIONS": "Options",
     "BTN_HELP_TOUR": "Features tour",
@@ -279,6 +280,7 @@
     "CURRENT_BLOCK" : "Block #",
     "POPOVER_FILTER_TITLE": "Filter",
     "OFFLINE": "Offline peers",
+    "BTN_SHOW_PEER": "Show peer",
     "VIEW": {
       "TITLE": "Peer",
       "OWNER": "Owned by ",
@@ -466,8 +468,10 @@
       "REGISTRATION_NODE_HELP": "If you do not trust this peer, please change <a ng-click=\"doQuickFix('settings')\">in the settings</a> of Cesium.",
       "SELECT_ACCOUNT_TYPE": "Choose the type of account to create:",
       "MEMBER_ACCOUNT": "Member account",
+      "MEMBER_ACCOUNT_TITLE": "Create a member account",
       "MEMBER_ACCOUNT_HELP": "If you are not yet registered as an individual (one account possible per individual).",
       "WALLET_ACCOUNT": "Simple wallet",
+      "WALLET_ACCOUNT_TITLE": "Create a wallet",
       "WALLET_ACCOUNT_HELP": "If you represent a company, association, etc. or simply need an additional wallet. No universal dividend will be created by this account.",
       "SALT_WARNING": "Choose a secret identifier.<br/>You need it for each connection to this account.<br/><br/><b>Make sure to remember this identifier</b>.<br/>If lost, there are no means to retrieve it!",
       "PASSWORD_WARNING": "Choose a password.<br/>You need it for each connection to this account.<br/><br/><b>Make sure to remember this password</b>.<br/>If lost, there are no means to retrieve it!",
diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json
index 32c9eef8..3d6f6db2 100644
--- a/www/i18n/locale-fr-FR.json
+++ b/www/i18n/locale-fr-FR.json
@@ -33,6 +33,7 @@
     "BTN_REFRESH": "Actualiser",
     "BTN_START": "Commencer",
     "BTN_CONTINUE": "Continuer",
+    "BTN_CREATE": "Créer",
     "BTN_UNDERSTOOD": "J'ai compris",
     "BTN_OPTIONS": "Options",
     "BTN_HELP_TOUR": "Visite guidée",
@@ -458,7 +459,7 @@
       "LOCKED_AMOUNT": "Conditions pour le montant :"
     },
     "NEW": {
-      "TITLE": "Inscription",
+      "TITLE": "Création de compte",
       "INTRO_WARNING_TIME": "La création d'un compte sur {{name|capitalize}} est très simple. Veuillez néanmoins prendre suffisament de temps pour faire correctement cette formalité (pour ne pas oublier les identifiants, mots de passe, etc.).",
       "INTRO_WARNING_SECURITY": "Vérifier que le matériel que vous utilisez actuellement (ordinateur, tablette, téléphone) <b>est sécurisé et digne de confiance</b>.",
       "INTRO_WARNING_SECURITY_HELP": "Anti-virus à jour, pare-feu activé, session protégée par mot de passe ou code pin, etc.",
@@ -467,8 +468,10 @@
       "REGISTRATION_NODE_HELP": "Si vous ne faites pas confiance en ce noeud, veuillez en changer <a ng-click=\"doQuickFix('settings')\">dans les paramètres</a> de Cesium.",
       "SELECT_ACCOUNT_TYPE": "Choisissez le type de compte à créer :",
       "MEMBER_ACCOUNT": "Compte membre",
+      "MEMBER_ACCOUNT_TITLE": "Création d'un compte membre",
       "MEMBER_ACCOUNT_HELP": "Si vous n'êtes pas encore inscrit en tant qu'individu (un seul compte possible par individu). Ce compte permet de co-produire la monnaie, en recevant un <b>dividende universel</b> chaque {{parameters.dt|formatPeriod}}.",
       "WALLET_ACCOUNT": "Simple portefeuille",
+      "WALLET_ACCOUNT_TITLE": "Création d'un portefeuille",
       "WALLET_ACCOUNT_HELP": "Pour tous les autres cas, par exemple si vous avez besoin d'un compte supplémentaire.<br/>Aucun dividende universel ne sera créé par ce compte.",
       "SALT_WARNING": "Choisissez votre identifiant secret.<br/>Il vous sera demandé à chaque connexion sur ce compte.<br/><br/><b>Retenez le bien</b>.<br/>En cas de perte, plus personne ne pourra accéder à votre compte !",
       "PASSWORD_WARNING": "Choisissez un mot de passe.<br/>Il vous sera demandé à chaque connexion sur ce compte.<br/><br/><b>Retenez bien ce mot de passe</b>.<br/>En cas de perte, plus personne ne pourra accéder à votre compte !",
diff --git a/www/js/controllers/join-controllers.js b/www/js/controllers/join-controllers.js
index 36d78f0f..114be6c1 100644
--- a/www/js/controllers/join-controllers.js
+++ b/www/js/controllers/join-controllers.js
@@ -137,9 +137,11 @@ function JoinModalController($scope, $state, $interval, $timeout, UIUtils, Crypt
   $scope.load = function() {
     if ($scope.loading) {
 
-      $scope.licenseFileUrl = csSettings.getLicenseUrl();
-      if ($scope.licenseFileUrl) {
-        $scope.startListenLicenseBottom();
+      if ($scope.accountType == 'member') {
+        $scope.licenseFileUrl = csSettings.getLicenseUrl();
+        if ($scope.licenseFileUrl) {
+          $scope.startListenLicenseBottom();
+        }
       }
 
       $scope.slideBehavior = $scope.computeSlideBehavior();
@@ -297,7 +299,7 @@ function JoinModalController($scope, $state, $interval, $timeout, UIUtils, Crypt
       return UIUtils.alert.confirm(messageKey, undefined,
         {
           cssClass: 'warning',
-          okText: 'COMMON.BTN_SEND',
+          okText: $scope.accountType == 'member' ? 'COMMON.BTN_SEND' : 'COMMON.BTN_CONTINUE',
           okType: 'button-assertive'
         })
         .then(function(confirm) {
@@ -342,9 +344,9 @@ function JoinModalController($scope, $state, $interval, $timeout, UIUtils, Crypt
 
                 // Redirect to wallet
                 $state.go('app.view_wallet')
-                .then(function() {
-                  $scope.downloadRevocationRegistration();
-                });
+                  .then(function() {
+                    $scope.downloadRevocationRegistration();
+                  });
               })
               .catch(function(err) {
                 if (err && err.ucode != BMA.errorCodes.MEMBERSHIP_ALREADY_SEND) return;
diff --git a/www/templates/join/modal_join_member.html b/www/templates/join/modal_join_member.html
index fc588249..4de17268 100644
--- a/www/templates/join/modal_join_member.html
+++ b/www/templates/join/modal_join_member.html
@@ -15,7 +15,7 @@
             ng-click="showHelpModal(slideBehavior.helpAnchor)">
     </button>
 
-    <h1 class="title" translate>ACCOUNT.NEW.TITLE</h1>
+    <h1 class="title" translate>ACCOUNT.NEW.MEMBER_ACCOUNT_TITLE</h1>
 
     <!-- next -->
     <button class="button button-clear icon-right visible-xs"
diff --git a/www/templates/join/modal_join_wallet.html b/www/templates/join/modal_join_wallet.html
index 63b47b11..8725e2cd 100644
--- a/www/templates/join/modal_join_wallet.html
+++ b/www/templates/join/modal_join_wallet.html
@@ -15,7 +15,7 @@
             ng-click="showHelpModal(slideBehavior.helpAnchor)">
     </button>
 
-    <h1 class="title" translate>ACCOUNT.NEW.TITLE</h1>
+    <h1 class="title" translate>ACCOUNT.NEW.WALLET_ACCOUNT_TITLE</h1>
 
     <!-- next -->
     <button class="button button-clear icon-right visible-xs"
@@ -251,8 +251,7 @@
               <button class="button button-clear button-dark ink" ng-click="closeModal()" type="button" translate>COMMON.BTN_CANCEL
               </button>
               <button class="button button-positive ink" ng-click="doNewAccount()" translate>
-                COMMON.BTN_SEND
-                <i class="icon ion-android-send"></i>
+                COMMON.BTN_CREATE
               </button>
             </div>
           </div>
@@ -288,7 +287,7 @@
 
             </div>
             <div class="padding hidden-xs text-left">
-              <button class="button button-assertive icon-left ion-chevron-left ink" 
+              <button class="button button-assertive icon-left ion-chevron-left ink"
                       ng-click="identifierRecovery()" translate>
                 COMMON.BTN_MODIFY
               </button>
diff --git a/www/templates/login/modal_login.html b/www/templates/login/modal_login.html
index eb9e64c9..f2258d6e 100644
--- a/www/templates/login/modal_login.html
+++ b/www/templates/login/modal_login.html
@@ -57,7 +57,7 @@
         <button class="button button-clear button-dark ink"
                 ng-click="closeModal()" type="button" translate>COMMON.BTN_CANCEL
         </button>
-        <button class="button button-positive ink" type="submit">
+        <button class="button button-positive ink" ng-class="{'button-assertive': isAuth, 'button-positive': !isAuth}" type="submit">
           {{isAuth ? 'AUTH.BTN_AUTH' : 'COMMON.BTN_LOGIN' | translate}}
         </button>
       </div>
-- 
GitLab