diff options
Diffstat (limited to 'ishtar_common/static')
| -rw-r--r-- | ishtar_common/static/js/ishtar-map.js | 1 | ||||
| -rw-r--r-- | ishtar_common/static/js/ishtar.js | 43 | 
2 files changed, 43 insertions, 1 deletions
| diff --git a/ishtar_common/static/js/ishtar-map.js b/ishtar_common/static/js/ishtar-map.js index b78d759a4..247bc4bb6 100644 --- a/ishtar_common/static/js/ishtar-map.js +++ b/ishtar_common/static/js/ishtar-map.js @@ -294,6 +294,7 @@ var click_on_feature = function(map_id, feature, e){      if (!$(e.target).is($(popup_item[map_id]))          && !$.contains($(popup_item[map_id])[0], e.target) ) {          $(popup_item[map_id]).hide(); +        $('#ishtar-map-window-' + map_id).hide();      }      if (typeof feature == 'undefined'){ diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index e8652720a..415398b95 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -1265,6 +1265,9 @@ var limit_map_msg = "Limit to {0} items";  var limit_map_help_msg = "Unchecking this limit on a poorly performing device may result in web browser freeze";  var limit_map_nb = 50000;  var current_map_limit = limit_map_nb; +var displayed_map_msg = "{0} items displayed on the map"; +var non_displayed_map_msg = "{0} items not displayed"; +var non_displayed_map_link_msg = "(list)";  var render_map = function(map_id, use_map_limit){      var html = ""; @@ -1274,7 +1277,8 @@ var render_map = function(map_id, use_map_limit){      html += "<input class='form-check-input' type='checkbox' id='ishtar-map-limit-" + map_id + "' ";      if (use_map_limit) html += " checked='checked'";      html += "/> "; -    html += "<label class='form-check-label' for='ishtar-map-limit-" + map_id + "'>" + limit_map_msg.format(limit_map_nb); +    html += "<label class='form-check-label' for='ishtar-map-limit-" + map_id + "'>"; +    html += limit_map_msg.format(number_with_commas(limit_map_nb));      html += " <i class='fa fa-question-circle' title=\""+  limit_map_help_msg  +"\" aria-hidden='true'></i></label>";      html += "</div></div>";      html += "<div class='ishtar-table-map' id='" + map_id + "'></div>"; @@ -1284,6 +1288,8 @@ var render_map = function(map_id, use_map_limit){      return html;  }; +var no_geo_window_content = ""; +  var register_map = function(map_id, points){      display_map(map_id, points);      $('#ishtar-map-limit-' + map_id).change(function() { @@ -1294,6 +1300,41 @@ var register_map = function(map_id, points){          }          $(".search_button").click();      }); +    if (points){ +        var lbl = ""; +        if (points['features'].length){ +            lbl += displayed_map_msg.format( +                number_with_commas(points['features'].length) +            ); +        } +        if (points['no-geo'].length){ +            if (points['features'].length){ +                lbl += " - "; +            } +            lbl += non_displayed_map_msg.format( +                number_with_commas(points['no-geo'].length) +            ); +            lbl += " <a href='#' id='no-geo-" + map_id + "'>" + non_displayed_map_link_msg + "</a>"; +        } +        $("#ishtar-map-info-" + map_id).html(lbl); + +        no_geo_window_content = "<ul>"; +        for (var idx in points['no-geo']){ +            no_geo = points['no-geo'][idx]; +            var link = link_template[map_id].replace("<pk>", no_geo["id"]); +            var txt = "<li>" + link + " " + no_geo['name'] + "</li>"; +            no_geo_window_content += txt; +        } +        no_geo_window_content += "</ul>"; +        $("#no-geo-" + map_id).click(function(){ +            $(popup_item[map_id]).hide(); +            $('#ishtar-map-window-' + map_id).hide(); +            $("#ishtar-map-window-" + map_id + " .modal-body").html( +                no_geo_window_content +            ); +            $('#ishtar-map-window-' + map_id).show(); +        }); +    }  };  var main_submit_search = function(){ | 
