From 84652c5f96fd4582a8e8e11e112c97516f683c8d Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Fri, 3 Nov 2017 15:03:31 +0100
Subject: [PATCH] [fix] Add missing EN i18n for pages

---
 www/js/directives.js                          | 17 +++++++--
 .../es/js/controllers/registry-controllers.js |  4 +--
 www/plugins/es/templates/registry/lookup.html | 19 +---------
 .../es/templates/registry/lookup_tabs.html    |  3 +-
 www/plugins/map/i18n/locale-en-GB.json        | 24 ++++++++++---
 www/plugins/map/i18n/locale-en.json           | 24 ++++++++++---
 www/plugins/map/i18n/locale-fr-FR.json        | 14 ++++----
 .../js/controllers/registry-controllers.js    | 36 +++++++++----------
 .../map/js/controllers/wot-controllers.js     |  8 ++---
 .../registry/item_search_tooltip.html         |  7 ++--
 10 files changed, 88 insertions(+), 68 deletions(-)

diff --git a/www/js/directives.js b/www/js/directives.js
index 23d3823d..e757297e 100644
--- a/www/js/directives.js
+++ b/www/js/directives.js
@@ -165,9 +165,9 @@ angular.module('cesium.directives', [])
       restrict: 'A',
       link: function(scope, element, attrs, controller) {
         var clazz = attrs.activeLink;
-        var path = attrs.activeLinkPathPrefix ? attrs.activeLinkPathPrefix : attrs.href;
-        if (path) {
-          path = path.substring(1); //hack because path does not return including hashbang
+        var path;
+        if (attrs.activeLinkPathPrefix) {
+          path = attrs.activeLinkPathPrefix.substring(1); //hack because path does not return including hashbang
           scope.location = $location;
           scope.$watch('location.path()', function (newPath) {
             if (newPath && newPath.indexOf(path) === 0) {
@@ -177,6 +177,17 @@ angular.module('cesium.directives', [])
             }
           });
         }
+        else if (attrs.href) {
+          path = attrs.href.substring(1); //hack because path does not return including hashbang
+          scope.location = $location;
+          scope.$watch('location.path()', function (newPath) {
+            if (newPath && newPath == path) {
+              element.addClass(clazz);
+            } else {
+              element.removeClass(clazz);
+            }
+          });
+        }
       }
     };
   })
diff --git a/www/plugins/es/js/controllers/registry-controllers.js b/www/plugins/es/js/controllers/registry-controllers.js
index a0ab2469..aa457a45 100644
--- a/www/plugins/es/js/controllers/registry-controllers.js
+++ b/www/plugins/es/js/controllers/registry-controllers.js
@@ -6,7 +6,7 @@ angular.module('cesium.es.registry.controllers', ['cesium.es.services', 'cesium.
     $stateProvider
 
     .state('app.registry_lookup', {
-      url: "/page?q&category&location&type&issuer&reload",
+      url: "/wot/page?q&category&location&type&issuer&reload",
       views: {
         'menuContent': {
           templateUrl: "plugins/es/templates/registry/lookup.html",
@@ -19,7 +19,7 @@ angular.module('cesium.es.registry.controllers', ['cesium.es.services', 'cesium.
     })
 
     .state('app.registry_lookup_lg', {
-      url: "/page/lg?q&category&location&type&issuer&reload",
+      url: "/wot/page/lg?q&category&location&type&issuer&reload",
       views: {
         'menuContent': {
           templateUrl: "plugins/es/templates/registry/lookup_lg.html",
diff --git a/www/plugins/es/templates/registry/lookup.html b/www/plugins/es/templates/registry/lookup.html
index f42907c8..2777cba1 100644
--- a/www/plugins/es/templates/registry/lookup.html
+++ b/www/plugins/es/templates/registry/lookup.html
@@ -6,24 +6,7 @@
 
     <ion-content class="lookupForm padding no-padding-xs">
 
-      <div class="buttons-tabs">
-
-        <div class="pull-right">
-          <div
-            class="button button-tab dark"
-            title="{{'REGISTRY.BTN_SHOW_WOT_HELP' | translate}}"
-            ng-click="openWotLookup()">
-            <i class="icon ion-person-stalker"></i>
-            {{'REGISTRY.BTN_SHOW_WOT' | translate}}
-          </div>
-          <div
-            class="button button-tab ink yellow-bg dark active"
-            title="{{'REGISTRY.BTN_SHOW_PAGES_HELP' | translate}}">
-            <i class="icon ion-social-buffer"></i>
-            {{'REGISTRY.BTN_SHOW_PAGES' | translate}}
-          </div>
-        </div>
-      </div>
+      <ng-include src="'plugins/es/templates/registry/lookup_tabs.html'"></ng-include>
 
       <form ng-submit="doSearch()"/>
         <label class="item item-input">
diff --git a/www/plugins/es/templates/registry/lookup_tabs.html b/www/plugins/es/templates/registry/lookup_tabs.html
index 0b717c43..7c5b0858 100644
--- a/www/plugins/es/templates/registry/lookup_tabs.html
+++ b/www/plugins/es/templates/registry/lookup_tabs.html
@@ -10,10 +10,11 @@
       {{'REGISTRY.BTN_SHOW_WOT' | translate}}
     </div>
     <a
-       class="button button-tab ink yellow-100-bg dark"
+       class="button button-tab ink yellow-bg dark"
        title="{{'REGISTRY.BTN_SHOW_PAGES_HELP' | translate}}"
        nav-transition="none"
        active-link="active"
+       active-link-path-prefix="#/app/wot/page"
        ui-sref="app.registry_lookup({q: search.text, location: search.location})">
       <i class="icon ion-social-buffer"></i>
       {{'REGISTRY.BTN_SHOW_PAGES' | translate}}
diff --git a/www/plugins/map/i18n/locale-en-GB.json b/www/plugins/map/i18n/locale-en-GB.json
index 0b455004..6f7d56b2 100644
--- a/www/plugins/map/i18n/locale-en-GB.json
+++ b/www/plugins/map/i18n/locale-en-GB.json
@@ -28,11 +28,25 @@
         "LAYER": {
           "MEMBER": "<i class=\"icon ion-person positive\"></i> Members",
           "PENDING": "<i class=\"icon ion-clock energized\"></i> Pending registrations",
-          "WALLET": "<i class=\"icon ion-card gray\"></i> Simple wallets",
-          "SHOP": "<i class=\"icon ion-page-shop balanced\"></i> Local shops",
-          "COMPANY": "<i class=\"icon ion-page-company balanced\"></i> Companies",
-          "ASSOCIATION": "<i class=\"icon ion-page-association balanced\"></i> Associations",
-          "INSTITUTION": "<i class=\"icon ion-page-institution balanced\"></i> Institutions"
+          "WALLET": "<i class=\"icon ion-card gray\"></i> Simple wallets"
+        }
+      },
+      "ERROR": {
+        "LOAD_POSITION_FAILED": "Can not retrieve the positions to display."
+      }
+    },
+    "REGISTRY": {
+      "LOOKUP": {
+        "BTN_MAP": "Map",
+        "BTN_MAP_HELP": "Open the map of the pages"
+      },
+      "VIEW": {
+        "TITLE": "Map of pages",
+        "LAYER": {
+          "SHOP": "<i class=\"icon ion-page-shop positive\"></i> Local shops",
+          "COMPANY": "<i class=\"icon ion-page-company positive\"></i> Companies",
+          "ASSOCIATION": "<i class=\"icon ion-page-association energized\"></i> Associations",
+          "INSTITUTION": "<i class=\"icon ion-page-institution gray\"></i> Institutions"
         }
       }
     },
diff --git a/www/plugins/map/i18n/locale-en.json b/www/plugins/map/i18n/locale-en.json
index 0b455004..6f7d56b2 100644
--- a/www/plugins/map/i18n/locale-en.json
+++ b/www/plugins/map/i18n/locale-en.json
@@ -28,11 +28,25 @@
         "LAYER": {
           "MEMBER": "<i class=\"icon ion-person positive\"></i> Members",
           "PENDING": "<i class=\"icon ion-clock energized\"></i> Pending registrations",
-          "WALLET": "<i class=\"icon ion-card gray\"></i> Simple wallets",
-          "SHOP": "<i class=\"icon ion-page-shop balanced\"></i> Local shops",
-          "COMPANY": "<i class=\"icon ion-page-company balanced\"></i> Companies",
-          "ASSOCIATION": "<i class=\"icon ion-page-association balanced\"></i> Associations",
-          "INSTITUTION": "<i class=\"icon ion-page-institution balanced\"></i> Institutions"
+          "WALLET": "<i class=\"icon ion-card gray\"></i> Simple wallets"
+        }
+      },
+      "ERROR": {
+        "LOAD_POSITION_FAILED": "Can not retrieve the positions to display."
+      }
+    },
+    "REGISTRY": {
+      "LOOKUP": {
+        "BTN_MAP": "Map",
+        "BTN_MAP_HELP": "Open the map of the pages"
+      },
+      "VIEW": {
+        "TITLE": "Map of pages",
+        "LAYER": {
+          "SHOP": "<i class=\"icon ion-page-shop positive\"></i> Local shops",
+          "COMPANY": "<i class=\"icon ion-page-company positive\"></i> Companies",
+          "ASSOCIATION": "<i class=\"icon ion-page-association energized\"></i> Associations",
+          "INSTITUTION": "<i class=\"icon ion-page-institution gray\"></i> Institutions"
         }
       }
     },
diff --git a/www/plugins/map/i18n/locale-fr-FR.json b/www/plugins/map/i18n/locale-fr-FR.json
index 1a68e91f..2290781d 100644
--- a/www/plugins/map/i18n/locale-fr-FR.json
+++ b/www/plugins/map/i18n/locale-fr-FR.json
@@ -28,11 +28,7 @@
         "LAYER": {
           "MEMBER": "<i class=\"icon ion-person positive\"></i> Membres",
           "PENDING": "<i class=\"icon ion-clock energized\"></i> Inscriptions en attente",
-          "WALLET": "<i class=\"icon ion-card gray\"></i> Simples portefeuilles",
-          "SHOP": "<i class=\"icon ion-page-shop balanced\"></i> Commerces locaux",
-          "COMPANY": "<i class=\"icon ion-page-company balanced\"></i> Entreprises",
-          "ASSOCIATION": "<i class=\"icon ion-page-association balanced\"></i> Associations",
-          "INSTITUTION": "<i class=\"icon ion-page-institution balanced\"></i> Institutions"
+          "WALLET": "<i class=\"icon ion-card gray\"></i> Simples portefeuilles"
         }
       },
       "ERROR": {
@@ -45,7 +41,13 @@
         "BTN_MAP_HELP": "Ouvrir la carte des pages"
       },
       "VIEW": {
-        "TITLE": "Carte des pages"
+        "TITLE": "Carte des pages",
+        "LAYER": {
+          "SHOP": "<i class=\"icon ion-page-shop positive\"></i> Commerces locaux",
+          "COMPANY": "<i class=\"icon ion-page-company positive\"></i> Entreprises",
+          "ASSOCIATION": "<i class=\"icon ion-page-association energized\"></i> Associations",
+          "INSTITUTION": "<i class=\"icon ion-page-institution gray\"></i> Institutions"
+        }
       }
     },
     "PROFILE": {
diff --git a/www/plugins/map/js/controllers/registry-controllers.js b/www/plugins/map/js/controllers/registry-controllers.js
index d6a508ef..a4170baf 100644
--- a/www/plugins/map/js/controllers/registry-controllers.js
+++ b/www/plugins/map/js/controllers/registry-controllers.js
@@ -50,30 +50,26 @@ function MapRegistryViewController($scope, $filter, $templateCache, $interpolate
     // Create a  hidden layer, to hold search markers
     markersSearchLayer,
     icons= {
-      group: {
-        type: 'awesomeMarker',
-          icon: 'person-stalker',
-          markerColor: 'green'
-      },
       shop: {
         type: 'awesomeMarker',
         icon: 'page-shop',
-        markerColor: 'green'
-      },
-      association: {
-        type: 'awesomeMarker',
-        icon: 'page-association',
-        markerColor: 'green'
+        markerColor: 'blue'
       },
       company: {
         type: 'awesomeMarker',
         icon: 'page-company',
-        markerColor: 'green'
+        markerColor: 'blue'
+      },
+      association: {
+        type: 'awesomeMarker',
+        icon: 'page-association',
+        markerColor: 'lightgreen',
+        iconColor: 'gray'
       },
       institution: {
         type: 'awesomeMarker',
         icon: 'page-institution',
-        markerColor: 'green'
+        markerColor: 'lightgray'
       }
     };
 
@@ -87,22 +83,22 @@ function MapRegistryViewController($scope, $filter, $templateCache, $interpolate
         // Pages
         shop: {
           type: 'featureGroup',
-          name: 'MAP.WOT.VIEW.LAYER.SHOP',
+          name: 'MAP.REGISTRY.VIEW.LAYER.SHOP',
           visible: true
         },
-        association: {
+        company: {
           type: 'featureGroup',
-          name: 'MAP.WOT.VIEW.LAYER.ASSOCIATION',
+          name: 'MAP.REGISTRY.VIEW.LAYER.COMPANY',
           visible: true
         },
-        company: {
+        association: {
           type: 'featureGroup',
-          name: 'MAP.WOT.VIEW.LAYER.COMPANY',
+          name: 'MAP.REGISTRY.VIEW.LAYER.ASSOCIATION',
           visible: true
         },
         institution: {
           type: 'featureGroup',
-          name: 'MAP.WOT.VIEW.LAYER.INSTITUTION',
+          name: 'MAP.REGISTRY.VIEW.LAYER.INSTITUTION',
           visible: true
         }
       }
@@ -240,7 +236,7 @@ function MapRegistryViewController($scope, $filter, $templateCache, $interpolate
         showCoverageOnHover: false,
         iconCreateFunction: function (cluster) {
           var countByLayer = _.countBy(cluster.getAllChildMarkers(), extractMarkerLayer);
-          var markerColor = countByLayer.member ? 'blue' : (countByLayer.pending ? 'lightgreen' : 'lightgray');
+          var markerColor = countByLayer.shop||countByLayer.company ? 'blue' : (countByLayer.association ? 'lightgreen' : 'lightgray');
           var childCount = cluster.getChildCount();
           var className = 'marker-cluster ' + markerColor + ' marker-cluster-';
           if (childCount < 10) {
diff --git a/www/plugins/map/js/controllers/wot-controllers.js b/www/plugins/map/js/controllers/wot-controllers.js
index c7725be6..0d0bd13f 100644
--- a/www/plugins/map/js/controllers/wot-controllers.js
+++ b/www/plugins/map/js/controllers/wot-controllers.js
@@ -52,8 +52,8 @@ function MapWotViewController($scope, $filter, $templateCache, $interpolate, $ti
     icons= {
       member: {
         type: 'awesomeMarker',
-          icon: 'person',
-          markerColor: 'blue'
+        icon: 'person',
+        markerColor: 'blue'
       },
       pending: {
         type: 'awesomeMarker',
@@ -63,8 +63,8 @@ function MapWotViewController($scope, $filter, $templateCache, $interpolate, $ti
       },
       wallet: {
         type: 'awesomeMarker',
-          icon: 'key',
-          markerColor: 'lightgray'
+        icon: 'key',
+        markerColor: 'lightgray'
       }
     };
 
diff --git a/www/plugins/map/templates/registry/item_search_tooltip.html b/www/plugins/map/templates/registry/item_search_tooltip.html
index 0c4a8705..4fde89c2 100644
--- a/www/plugins/map/templates/registry/item_search_tooltip.html
+++ b/www/plugins/map/templates/registry/item_search_tooltip.html
@@ -1,8 +1,7 @@
 <a href="#" class="{{type}}">
-  <i class="{{pending ? 'ion-clock': (type ? 'cion-page-' + type : '')}}"></i>
+  <i class="{{'cion-page-' + type}}"></i>
   {{name != uid ? name +' ' : ''}}
-  <span class="{{uid ? 'positive' : 'gray'}}">
-    <i class="{{uid ? 'ion-person' : 'ion-key'}}"></i>
-    {{uid ? uid : (pubkey|formatPubkey) }}
+  <span class="gray">
+    {{pubkey ? (pubkey|formatPubkey) : ''}}
   </span>
 </a>
-- 
GitLab