2 Commits e7248d7a1e ... 89bed17b5a

Author SHA1 Message Date
  Laurent Peuch 89bed17b5a [enh] update legend 9 years ago
  Laurent Peuch 3f28fae530 [enh] display isp that does vpn 9 years ago
2 changed files with 12 additions and 7 deletions
  1. 11 7
      ffdnispdb/templates/site_embed.js
  2. 1 0
      ffdnispdb/views.py

+ 11 - 7
ffdnispdb/templates/site_embed.js

@@ -274,8 +274,9 @@ function init_map() {
     legend.onAdd = function (map) {
     legend.onAdd = function (map) {
         var div = L.DomUtil.create('div', 'info legend');
         var div = L.DomUtil.create('div', 'info legend');
         div.innerHTML  = '<small>'+{{ _('Legend')|js_str }}+'&thinsp;:</small>&nbsp; ';
         div.innerHTML  = '<small>'+{{ _('Legend')|js_str }}+'&thinsp;:</small>&nbsp; ';
-        div.innerHTML += '<i style="background: #ff7900" title="'+{{ _('ISP')|js_str }}+'"></i> ';
-        div.innerHTML += '<i style="background: #00aac9" title="'+{{ _('Member of the FDN Federation')|js_str }}+'"></i> ';
+        div.innerHTML += '<i style="background: #EAEAEA" title="'+{{ _('Members that might do Internet Cube one day (ask them!)')|js_str }}+'"></i> ';
+        div.innerHTML += '<i style="background: #E5CC17" title="'+{{ _('Members that offers VPN services')|js_str }}+'"></i> ';
+        div.innerHTML += '<i style="background: #D20000" title="'+{{ _('Members that offers Internet Cube')|js_str }}+'"></i> ';
         $(div).children('i').tooltip({container: 'body'});
         $(div).children('i').tooltip({container: 'body'});
 
 
         return div;
         return div;
@@ -303,15 +304,18 @@ function init_map() {
     });
     });
 
 
 
 
-    var icon = L.icon({
-        iconUrl: '../static/img/marker.png',
+    var icon_nothing = L.icon({
+        iconUrl: '../static/img/marker_nothing.png',
 
 
         iconSize:     [14, 20], // size of the icon
         iconSize:     [14, 20], // size of the icon
         iconAnchor:   [7, 20], // point of the icon which will correspond to marker's location
         iconAnchor:   [7, 20], // point of the icon which will correspond to marker's location
         popupAnchor:  [0, -20] // point from which the popup should open relative to the iconAnchor
         popupAnchor:  [0, -20] // point from which the popup should open relative to the iconAnchor
     });
     });
-    var icon_ffdn = $.extend(true, {}, icon);
-    icon_ffdn['options']['iconUrl'] = '../static/img/marker_ffdn.png';
+    var icon_vpn = $.extend(true, {}, icon_nothing);
+    icon_vpn['options']['iconUrl'] = '../static/img/marker_vpn.png';
+
+    var icon_cube = $.extend(true, {}, icon_nothing);
+    icon_cube['options']['iconUrl'] = '../static/img/marker_cube.png';
 
 
     window.isp_list={};
     window.isp_list={};
     $.getJSON('/isp/map_data_cube.json', function(data) {
     $.getJSON('/isp/map_data_cube.json', function(data) {
@@ -323,7 +327,7 @@ function init_map() {
             if (!isp.ffdn_member) return;
             if (!isp.ffdn_member) return;
 
 
             var marker = L.marker([isp['coordinates']['latitude'], isp['coordinates']['longitude']],
             var marker = L.marker([isp['coordinates']['latitude'], isp['coordinates']['longitude']],
-                                  {'icon': isp.distribute_zsh:1: ube ? icon_cube : icon_ffdn});
+                                  {'icon': isp.distribute_cube ? icon_cube : (isp.has_vpn? icon_vpn : icon_nothing)});
 
 
             marker.bindPopup(isp.popup);
             marker.bindPopup(isp.popup);
             marker.getPopup().on('open', function() {
             marker.getPopup().on('open', function() {

+ 1 - 0
ffdnispdb/views.py

@@ -83,6 +83,7 @@ def isp_map_data_cube():
 
 
         d['id'] = isp.id
         d['id'] = isp.id
         d['ffdn_member'] = isp.is_ffdn_member
         d['ffdn_member'] = isp.is_ffdn_member
+        d['has_vpn'] = isp.has_technology("vpn")
         d['distribute_cube'] = isp.has_technology("cube")
         d['distribute_cube'] = isp.has_technology("cube")
         d['popup'] = render_template('map_popup.html', isp=isp)
         d['popup'] = render_template('map_popup.html', isp=isp)
         data.append(d)
         data.append(d)