diff --git a/www/i18n/locale-en-GB.json b/www/i18n/locale-en-GB.json index 7020aae5d8959c3de2b326650ca1b85295b1cd89..c0e1a55db36bb12c2c89e383e7015ddf95ab9744 100644 --- a/www/i18n/locale-en-GB.json +++ b/www/i18n/locale-en-GB.json @@ -156,6 +156,8 @@ "SIG_WINDOW": "Maximum delay before a certification<br/>will be treated", "STEP_MAX": "Maximum distance between<br/>each WoT member and a newcomer.", "WOT_RULES_DIVIDER": "Rules for web of trust", + "SENTRIES": "Required number of certifications<br/>to become a sentries", + "SENTRIES_FORMULA": "Required number of certifications<br/>to become a sentries (formula)", "XPERCENT":"Minimum percent of sentries<br />to reach to match the distance rule", "AVG_GEN_TIME": "The average time between 2 blocks", "CURRENT": "current" diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index 5a54fb125667f79e362f1240f022206c31eb7a15..59d1b94ca1dfc9f3541b64f74d4fe997dc1d6312 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -156,6 +156,8 @@ "SIG_WINDOW": "Maximum delay before a certification<br/>will be treated", "STEP_MAX": "Maximum distance between<br/>each WoT member and a newcomer.", "WOT_RULES_DIVIDER": "Rules for web of trust", + "SENTRIES": "Required number of certifications<br/>to become a sentries", + "SENTRIES_FORMULA": "Required number of certifications<br/>to become a sentries (formula)", "XPERCENT":"Minimum percent of sentries<br />to reach to match the distance rule", "AVG_GEN_TIME": "The average time between 2 blocks", "CURRENT": "current" diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index 0ff4393ae443caf4954d60cd80c82ffa329970bc..b2fa40cb6af02c1d5e4d24107371faecaf5b2225 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -154,9 +154,11 @@ "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", - "STEP_MAX": "Distance maximale dans la toile de confiance <br /> entre chaque membre et un nouvel entrant.", + "STEP_MAX": "Distance maximale dans la toile de confiance <br/> entre chaque membre et un nouvel entrant.", "WOT_RULES_DIVIDER": "Règles de la toile de confiance", - "XPERCENT":"Pourcentage minimum de sentinelle<br/>à atteindre pour respecter la règle de distance.", + "SENTRIES": "Nombre de certification requises<br/>pour être sentinelle", + "SENTRIES_FORMULA": "Nombre de certification<br/>pour être sentinelle (formule)", + "XPERCENT":"Pourcentage minimum de sentinelle<br/>à atteindre pour respecter la règle de distance", "AVG_GEN_TIME": "Temps moyen entre deux blocs", "CURRENT": "actuel" } diff --git a/www/js/controllers/currency-controllers.js b/www/js/controllers/currency-controllers.js index 6e6be9721675f3b4fc761a66d4c2c2b9745c798d..10c1a0fd178a6a374578f59c19b2b13f8f2556dc 100644 --- a/www/js/controllers/currency-controllers.js +++ b/www/js/controllers/currency-controllers.js @@ -154,6 +154,7 @@ function CurrencyViewController($scope, $q, $timeout, BMA, UIUtils, csSettings, difficulty : 0, Nprev: 0, stepMax: 0, + sentries: 0, xpercent: 0, durationFromLastUD: 0, blockUid: null, @@ -281,6 +282,7 @@ function CurrencyViewController($scope, $q, $timeout, BMA, UIUtils, csSettings, data.UD = data.currentUD; data.durationFromLastUD = lastUDTime ? data.medianTime - lastUDTime : 0; data.useRelative = $scope.formData.useRelative; + data.sentries = Math.ceil(Math.pow(data.N, 1/ data.stepMax)); // Apply to formData angular.copy(data, $scope.formData); diff --git a/www/templates/currency/items_wot.html b/www/templates/currency/items_wot.html index 8fece4eaca1901f1584fe57ec4e4f9d9ed7cb254..b48a0c03aed1acbfc8f683bb9ef94d00b0ffb6e9 100644 --- a/www/templates/currency/items_wot.html +++ b/www/templates/currency/items_wot.html @@ -1,7 +1,7 @@ <ion-list bind-notifier="{ rebind:formData.useRelative }"> - <ion-item class="item-icon-left"> + <ion-item class="item-icon-left item-text-wrap"> <i class="icon ion-person-stalker"></i> <span translate>CURRENCY.VIEW.MEMBERS</span> (N<sub>{{'CURRENCY.VIEW.CURRENT'|translate}}</sub>) <span class="badge badge-assertive" ng-if="!loading">{{formData.N | formatInteger}}</span> @@ -17,6 +17,12 @@ </div> </ion-item> + <ion-item class="item-icon-left item-text-wrap"> + <i class="icon ion-ribbon-b"></i> + <b class="ion-star " style="color: yellow; position: absolute; font-size: 16px; left: 25px; bottom: 32px"></b> + <span translate>CURRENCY.VIEW.SENTRIES</span> + <span class="badge badge-royal" ng-if="!loading">{{formData.sentries}}</span> + </ion-item> <div id="helptip-currency-rules" class="item item-divider"> @@ -54,10 +60,18 @@ <ion-item class="item-icon-left item-text-wrap"> <i class="icon ion-steam"></i> - <span class="col col-75" translate>CURRENCY.VIEW.STEP_MAX</span> + <b class="ion-person" style="position: absolute; font-size: 16px; left: 38px; top: 17px"></b> + <span class="col col-75"><span ng-bind-html="'CURRENCY.VIEW.STEP_MAX'|translate"></span> (stepMax)</span> <span class="badge badge-stable" ng-if="!loading">{{formData.stepMax}}</span> </ion-item> + <ion-item class="item-icon-left item-text-wrap"> + <i class="icon ion-ribbon-b"></i> + <b class="ion-star " style="color: yellow; position: absolute; font-size: 16px; left: 25px; bottom: 32px"></b> + <span ng-bind-html="'CURRENCY.VIEW.SENTRIES_FORMULA'|translate"></span> + <span class="item-note dark" ng-if="!loading">CEIL( N<sub>t</sub><sup>^ (1 / stepMax)</sup>)</span> + </ion-item> + <ion-item class="item-icon-left item-text-wrap"> <i class="icon ion-pull-request"></i> <span class="col col-75" translate>CURRENCY.VIEW.XPERCENT</span>