From dbc5f121f2a1e102556d8f85a398f9f76801c656 Mon Sep 17 00:00:00 2001
From: CamilleC <kmille.c.cc@gmail.com>
Date: Tue, 10 Jan 2017 11:44:40 +0100
Subject: [PATCH] add stepMax and xpercent resolve #209

---
 www/i18n/locale-en.json                         |  4 +++-
 www/i18n/locale-fr-FR.json                      |  4 +++-
 www/js/controllers/currency-controllers.js      |  5 +++++
 www/templates/currency/tabs/view_network.html   |  6 ++++++
 .../currency/tabs/view_parameters.html          | 17 ++++++++++++-----
 5 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json
index e565aa579..21a8b9d34 100644
--- a/www/i18n/locale-en.json
+++ b/www/i18n/locale-en.json
@@ -149,7 +149,9 @@
       "SIG_QTY_RULE": "Required certifications<br/>to become a member",
       "SIG_STOCK": "Maximal number of certifications<br/>sent by member",
       "SIG_PERIOD": "Minimum delay between 2 certifications<br/>of a same issuer.",
-      "SIG_WINDOW": "Maximum delay a certification can wait<br/>before being expired for non-writing."
+      "SIG_WINDOW": "Maximum delay a certification can wait<br/>before being expired for non-writing.",
+      "STEP_MAX": "Maximum distance between<br/>each WoT member and a newcomer.",
+      "XPERCENT":"Minimum percent of sentries<br />to reach to match the distance rule"
     }
   },
   "PEER": {
diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json
index 1288c9f51..c338981ab 100644
--- a/www/i18n/locale-fr-FR.json
+++ b/www/i18n/locale-fr-FR.json
@@ -149,7 +149,9 @@
       "SIG_QTY_RULE": "Nombre de certifications requises<br/>pour devenir membre",
       "SIG_STOCK": "Nombre maximal de certifications émises<br/>par membre",
       "SIG_PERIOD": "Délai minimal d'attente entre 2 certifications<br/>successives émises par une même personne.",
-      "SIG_WINDOW": "Délai maximal d'attente avant<br/>prise en compte d'une certification"
+      "SIG_WINDOW": "Délai maximal d'attente avant<br/>prise en compte d'une certification",
+      "STEP_MAX": "Distance maximale dans la toile de confiance <br /> entre chaque membre et un nouvel entrant.",
+      "XPERCENT":"Pourcentage minimum de sentinelle<br />à atteindre pour respecter la règle de distance."
     }
   },
   "PEER": {
diff --git a/www/js/controllers/currency-controllers.js b/www/js/controllers/currency-controllers.js
index 18d658cec..a7cda3708 100644
--- a/www/js/controllers/currency-controllers.js
+++ b/www/js/controllers/currency-controllers.js
@@ -112,7 +112,10 @@ function CurrencyViewController($scope, $q, $translate, $timeout, BMA, UIUtils,
   $scope.medianTime  = 0;
   $scope.difficulty  = 0;
   $scope.Nprev = 0;
+  $scope.stepMax = 0;
   $scope.screen = UIUtils.screen;
+  $scope.stepMax = 0;
+  $scope.xpercent = 0;
 
   $scope.$on('$ionicView.enter', function(e, state) {
     $translate(['COMMON.DATE_PATTERN'])
@@ -195,6 +198,8 @@ function CurrencyViewController($scope, $q, $translate, $timeout, BMA, UIUtils,
           $scope.sigStock = json.sigStock;
           $scope.sigWindow = json.sigWindow;
           $scope.sigPeriod = json.sigPeriod;
+          $scope.stepMax = json.stepMax;
+          $scope.xpercent = json.xpercent;
         }),
 
       // Get the current block informations
diff --git a/www/templates/currency/tabs/view_network.html b/www/templates/currency/tabs/view_network.html
index 8f8a80c93..4d9b83ccf 100644
--- a/www/templates/currency/tabs/view_network.html
+++ b/www/templates/currency/tabs/view_network.html
@@ -18,6 +18,12 @@
         <span class="badge badge-stable">{{difficulty | formatInteger}}</span>
       </ion-item>
 
+      <ion-item class="item-icon-left">
+        <i class="icon ion-steam"></i>
+        <span translate>CURRENCY.VIEW.XPERCENT</span>
+        <span class="badge badge-stable">{{xpercent}}</span>
+      </ion-item>
+
       <div id="helptip-currency-peers"
            class="item item-divider item-icon-right">
           {{'PEER.PEERS'|translate}}
diff --git a/www/templates/currency/tabs/view_parameters.html b/www/templates/currency/tabs/view_parameters.html
index c4685a075..856ecd2d8 100644
--- a/www/templates/currency/tabs/view_parameters.html
+++ b/www/templates/currency/tabs/view_parameters.html
@@ -97,15 +97,22 @@
           <span class="badge badge-stable">{{sigStock}}</span>
         </ion-item>
 
-      <ion-item class="item-icon-left">
-        <i class="icon ion-clock"></i>
-        <span translate>CURRENCY.VIEW.SIG_PERIOD</span>
-        <span class="badge badge-stable">{{sigPeriod | formatDuration}}</span>
-      </ion-item>
+        <ion-item class="item-icon-left">
+          <i class="icon ion-clock"></i>
+          <span translate>CURRENCY.VIEW.SIG_PERIOD</span>
+          <span class="badge badge-stable">{{sigPeriod | formatDuration}}</span>
+        </ion-item>
 
         <ion-item class="item-icon-left">
           <i class="icon ion-clock"></i>
           <span translate>CURRENCY.VIEW.SIG_WINDOW</span>
           <span class="badge badge-stable">{{sigWindow | formatDuration}}</span>
         </ion-item>
+
+        <ion-item class="item-icon-left">
+          <i class="icon ion-steam"></i>
+          <span translate>CURRENCY.VIEW.STEP_MAX</span>
+          <span class="badge badge-stable">{{stepMax}}</span>
+        </ion-item>
+
     </ion-list>
-- 
GitLab