summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-06-16 19:37:24 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-09-25 16:24:44 +0200
commit63c5d947426725fc558f9e3936313876a878c38e (patch)
tree8f52fca0c7cb49281443ee866d2541894b6b3812
parentc1c2bb8999341389eb1ea4d0ebed4cf3f932c566 (diff)
downloadChimère - projet Saclay-63c5d947426725fc558f9e3936313876a878c38e.tar.bz2
Chimère - projet Saclay-63c5d947426725fc558f9e3936313876a878c38e.zip
Search: html and JS integration of search module
-rw-r--r--templates/chimere/blocks/map.html15
-rw-r--r--templates/chimere/main_map.html13
2 files changed, 28 insertions, 0 deletions
diff --git a/templates/chimere/blocks/map.html b/templates/chimere/blocks/map.html
index fe5ea06..56a87a3 100644
--- a/templates/chimere/blocks/map.html
+++ b/templates/chimere/blocks/map.html
@@ -27,8 +27,10 @@ $(function(){
<!--
var routing_panel_open = function(){
$('#frm_categories').hide();
+ $('#search-box').hide();
$('#chimere_itinerary_panel').show();
$('#action-categories').removeClass('state-active');
+ $('#action-search').removeClass('state-active');
$('#action-routing').addClass('state-active');
};
@@ -36,13 +38,26 @@ $(function(){
var category_panel_open = function(){
$('#chimere_itinerary_panel').hide();
+ $('#search-box').hide();
$('#frm_categories').show();
$('#action-routing').removeClass('state-active');
+ $('#action-search').removeClass('state-active');
$('#action-categories').addClass('state-active');
};
$('#action-categories').click(category_panel_open);
+ var search_panel_open = function(){
+ $('#chimere_itinerary_panel').hide();
+ $('#frm_categories').hide();
+ $('#search-box').show();
+ $('#action-routing').removeClass('state-active');
+ $('#action-categories').removeClass('state-active');
+ $('#action-search').addClass('state-active');
+ };
+
+ $('#action-search').click(search_panel_open);
+
$('#sidebar-handler-hide').click(function(){$('#sidebar').hide();});
$('#sidebar-handler-show').click(function(){$('#sidebar').show();});
diff --git a/templates/chimere/main_map.html b/templates/chimere/main_map.html
index 76b46fd..2acbba5 100644
--- a/templates/chimere/main_map.html
+++ b/templates/chimere/main_map.html
@@ -8,6 +8,9 @@
<script src="{{ STATIC_URL }}chimere/js/jquery.chimere.js" type="text/javascript"></script>
<script src="{{ STATIC_URL }}saclay/js/SaclayCloud.js" type="text/javascript"></script>
<script src="{{ STATIC_URL }}saclay/js/jquery.form.js" type="text/javascript"></script>
+{% if has_search %}
+<script src="{{ STATIC_URL }}chimere/js/search.js" type="text/javascript"></script>
+<script src="{{ STATIC_URL }}chimere/js/search-autocomplete.js" type="text/javascript"></script>{% endif %}
<script type='text/javascript' language='javascript'>
<!--
@@ -53,6 +56,7 @@
<div id='categories'>{# dynamic content #}
</div>
</form>
+ <div id='search-box'></div>
{% routing %}
</div>
<div id='edit-panel'>
@@ -102,6 +106,15 @@
<script type="text/javascript">
<!--
$("#main-map").show();
+ var has_search = {% if has_search %}true{% else %}false{% endif %};
+ // array to keep trace of already displayed items
+ var search_result = new Array();
+ var search_url = "/search/";
+ $(function(){
+ if (has_search){
+ load_search_box();
+ }
+ });
// -->
</script>
{% map_menu %}