diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2014-09-22 01:30:40 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2014-09-22 01:30:40 +0200 |
| commit | e52f9f1cbef803c826510bfdea46ea205240a882 (patch) | |
| tree | 799f791b3928413b5d60ade81bc040fe6e5a0698 /templates | |
| parent | 5c4d02160ddf89e187850bb27c42ef734cf574ec (diff) | |
| download | Chimère-e52f9f1cbef803c826510bfdea46ea205240a882.tar.bz2 Chimère-e52f9f1cbef803c826510bfdea46ea205240a882.zip | |
Work on search engine - new bootstrap layout
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/chimere/base.html | 37 | ||||
| -rw-r--r-- | templates/chimere/blocks/actions.html | 65 | ||||
| -rw-r--r-- | templates/chimere/blocks/map.html | 94 | ||||
| -rw-r--r-- | templates/chimere/main_map.html | 64 |
4 files changed, 260 insertions, 0 deletions
diff --git a/templates/chimere/base.html b/templates/chimere/base.html new file mode 100644 index 0000000..2468571 --- /dev/null +++ b/templates/chimere/base.html @@ -0,0 +1,37 @@ +{% extends "base.html" %} +{% load chimere_tags i18n %} +{% block extra_head %} +<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/styles.css" /> +<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/print.css" media='print'/> +{% if css_area %} +<link rel="stylesheet" href="{{ css_area }}" />{% endif %} +{% if MOBILE %} +<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/mobile.css" /> +<script src="{{ STATIC_URL }}chimere/js/mobile.chimere.js" type="text/javascript"></script>{%endif%} +<link rel="stylesheet" href="{{ STATIC_URL }}bootstrap/bootstrap.min.css" /> +<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/form-compat.css" /> +<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/extra-styles.css" /> +<script src="{{ STATIC_URL }}bootstrap/bootstrap.min.js" type="text/javascript"></script> +<script src="{{ STATIC_URL }}chimere/js/interface.js" type="text/javascript"></script> +{% endblock %} +{% block header %} +<noscript> + <div id="no-js-message"> + <p id='no-js' class='warning'>{% trans "You must enable JavaScript in your browser to display Chimère."%}</p> + </div> +</noscript> + {% block page_title %}{% endblock %} + {% block actions %} + {% include "chimere/blocks/actions.html" %} + {% endblock %} +{% endblock %} +{% block content %} + {% block top %}{% endblock %} + {% block message_map %}{% endblock %} + {% block message_edit %}{% endblock %} + {% block bottom %}{% endblock %} +{% endblock %} +{% block footer %} + {% include "chimere/blocks/footer.html" %} +{% endblock %} + diff --git a/templates/chimere/blocks/actions.html b/templates/chimere/blocks/actions.html new file mode 100644 index 0000000..f806d63 --- /dev/null +++ b/templates/chimere/blocks/actions.html @@ -0,0 +1,65 @@ +{% load i18n chimere_tags %}<div class="navbar navbar-default navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="#">{{PROJECT_NAME}}</a> + </div> + <div class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + {% for action, subactions in actions %} + <li{% ifequal action.id action_selected.0 %} class="active"{% endifequal %}> + <a href='{{ action.url }}' onclick='jQuery("#map").chimere("saveExtent");'>{{ action.label }}</a> + </li> + {% endfor %} + </ul> + <div class='tabbable navbar-right'> + <ul class="nav nav-pills"> + {% if is_map %} + {% if areas_visible %} + <li>{% display_areas %}</li> + <li><div id='permalink' class='ui-widget ui-button ui-state-default ui-corner-all'></div></li> + <li>{% routing %}</li> + <li>{% display_welcome %}</li> + <li>{% display_news news_visible %}</li> + <li><a id='simple_button' href='{% url chimere:simple_index area_name_slash %}'>{% trans "Simple map" %}</a></li> + {% endif %} + + + {% endif %} + <li{% if not has_search %} class='active'{%endif%}><a href='#categories' data-toggle='panel'>{% trans "Categories "%}</a></li> + {% if has_search %} + <li class='active'><a href='#search-box' data-toggle='panel'>{% trans "Search" %}</a></li> + {% endif %} + </ul> + </div> + </div> + </div> +</div> + + +<!-- +<div id="topbar"> + <ul id='action' class='action'> + {% for action, subactions in actions %} + <li class='ui-widget ui-button ui-state-default ui-corner-all {% ifequal action.id action_selected.0 %} ui-state-active{% endifequal %}'> + <a href='{{ action.url }}' onclick='jQuery("#map").chimere("saveExtent");'>{{ action.label }}</a> + </li> + {% endfor %} + </ul> + <ul id='action-2' class='action'> + {% for action, subactions in actions %} + {% ifequal action.id action_selected.0 %}{% if subactions %} + {% for subaction in subactions %} + <li class='ui-widget ui-button ui-state-default ui-corner-all{% ifequal subaction.id action_selected.1 %} ui-state-active{% endifequal %}'> + <a href='{{ subaction.url }}' onclick='saveExtent();'>{{ subaction.label }}</a> + </li> + {% endfor %} + {% endif %}{% endifequal %} + {% endfor %} + </ul> +</div> +!--> diff --git a/templates/chimere/blocks/map.html b/templates/chimere/blocks/map.html new file mode 100644 index 0000000..db0741b --- /dev/null +++ b/templates/chimere/blocks/map.html @@ -0,0 +1,94 @@ +{% load i18n %} +<div id='{{map_id}}'></div> +<script type="text/javascript"> +$("#{{map_id}}").show(); +$(function(){ + $('#cluster_list').dialog({'autoOpen':false, + 'resizable':false, + 'width':340, + 'dialogClass':'no-titlebar'}); +}); +</script> +<div id="waiting"> + <div id="waiting-content"> + <img alt='Ajax loader' src='{{STATIC_URL}}chimere/img/ajax-loader.gif'/> + <p>{% trans "Loading of the map in progress" %}</p> + </div> +</div> +<div id="layer_selection"> + <h4>{% trans "Display options" %}</h4> + <ul id='layer_list'> + <li class='head layer_map_type'>{% trans "Map type"%}</li> + </ul> +</div> +<script type="text/javascript"> + {% if single_category %} + $(function() {$('#panel').hide()});{% endif %} + var chimere_init_options = {}; + {% if MOBILE %}chimere_init_options["mobile"] = true;{% endif %} + {% if enable_clustering %}chimere_init_options["enable_clustering"] = true;{% endif %} + chimere_init_options["default_icon"] = '{{STATIC_URL}}img/marker-green.png'; + chimere_init_options["map_layers"] = [{{js_map_layers|safe|escape}}]; + chimere_init_options['permalink_label'] = '{%trans "Permalink"%}'; + chimere_init_options['permalink_element'] = document.getElementById('permalink'); + chimere_init_options['routing'] = {{routing}}; + {% if dynamic_categories %}chimere_init_options['dynamic_categories'] = true;{% endif %} + {% if default_area %} + chimere_init_options["default_area"] = new Array({{default_area.upper_left_corner.x}}, {{default_area.upper_left_corner.y}}, {{default_area.lower_right_corner.x}}, {{default_area.lower_right_corner.y}}); + {% endif %} + {% if p_zoom %}chimere_init_options["zoom"] = {{ p_zoom }};{% endif %} + {% if p_lat %}chimere_init_options["lat"] = {{ p_lat }};{% endif %} + {% if p_lon %}chimere_init_options["lon"] = {{ p_lon }};{% endif %} + {% if p_routing_start_lon %}chimere_init_options["routing_start_lon"] = {{ p_routing_start_lon }};{% endif %} + {% if p_routing_start_lat %}chimere_init_options["routing_start_lat"] = {{ p_routing_start_lat }};{% endif %} + {% if p_routing_end_lon %}chimere_init_options["routing_end_lon"] = {{ p_routing_end_lon }};{% endif %} + {% if p_routing_end_lat %}chimere_init_options["routing_end_lat"] = {{ p_routing_end_lat }};{% endif %} + {% if p_routing_steps %}chimere_init_options["routing_steps_lonlat"] = [{{ p_routing_steps }}];{% endif %} + chimere_init_options["icon_offset"] = new OpenLayers.Pixel({{icon_offset_x}}, + {{icon_offset_y}}); + chimere_init_options["dynamic_categories"] = {{ dynamic_categories }}; + {% if p_display_submited %}chimere_init_options["display_submited"] = {{ p_display_submited }};{% endif %} + chimere_init_options["checked_categories"] = [{% for cc in checked_categories %}{% if forloop.counter0 > 0 %}, {% endif %}{{cc}}{% endfor %}]; + {% if area_id %}chimere_init_options['area_id'] = "{{area_id}}";{% endif %} + {% if p_current_feature %} + chimere_init_options["display_feature"] = {{ p_current_feature }};{% endif %} + {% if p_current_route %} + chimere_init_options["display_route"] = {{ p_current_route }};{% endif %} + {% if restricted_extent %}{{ restricted_extent }} + chimere_init_options["restricted_extent"] = bounds; + {% endif %} + {% if selected_map_layer %} + chimere_init_options["selected_map_layer"] = {{selected_map_layer}}; + {% endif %} + $("#main-map").chimere(chimere_init_options); + {% if zoom %} + $('#maps').chimere('zoom', {'area':{{zoom}} }); + {% endif %} + + // init layer selection + $(function() { + {% for layer_name, js, def in map_layers %} + $('#layer_list').append("<li><input type='radio' value='{{forloop.counter0}}' name='layer_type' id='layer_{{forloop.counter}}'{% if def %} checked='checked'{% endif %}><label for='layer_{{forloop.counter}}'>{{layer_name}}</li>");{% endfor %} + {% for subcat in subcat_layer %} + {% if not subcat.category %} + $('#layer_list').append("<li class='head layer_category'>{{subcat.name}}</li>");{% else %} + $('#layer_list').append("<li><input type='checkbox' name='layer_cat' value='category_{{subcat.pk}}' id='layer_cat_{{subcat.pk}}'{% if subcat.pk in checked_categories %} checked='checked'{% endif %}><label for='layer_cat_{{subcat.pk}}'>{{subcat.name}}</li>");{%endif%}{% endfor %} + $('#layer_selection h4').click(function(){ + $('#layer_list').toggle(); + }); + $('#layer_list input[name=layer_type]').change(function(){ + $('#{{map_id}}').chimere('changeMapLayer', $(this).val()); + }); + $('#layer_list input[name=layer_cat]').change(function(){ + // the prop has to be called twice not to mess up with the triggered + // click + $('#'+$(this).val()).prop("checked", this.checked); + $('#'+$(this).val()).trigger('click'); + $('#'+$(this).val()).prop("checked", this.checked); + }); + highlight_selected_categories(); + }); +</script> +<div id='marker_hover'><div id='marker_hover_content'></div></div> +<div id='cluster_list'></div> + diff --git a/templates/chimere/main_map.html b/templates/chimere/main_map.html new file mode 100644 index 0000000..25d99c4 --- /dev/null +++ b/templates/chimere/main_map.html @@ -0,0 +1,64 @@ +{% extends "chimere/base.html" %} +{% load i18n unlocalize_point chimere_tags %} +{% block extra_head %} +{% head_jquery %} +{% head_chimere %} +{% head_jme %} +<script src="{{ STATIC_URL }}chimere/js/jquery.chimere.js" type="text/javascript"></script> +{% if has_search %} +<script src="{{ STATIC_URL }}chimere/js/search.js" type="text/javascript"></script>{% endif %} +{{ block.super }} +{% endblock %} +{% block message_edit %}{% endblock %} +{% block sidebar %} + <div id='panel'class='navbar-default'> + <form id="frm_categories"><div id='categories'></div></form> + <div id='search-box' class='ui-widget ui-corner-all'></div> + </div> + <div id='category_description'> + </div> + <script type='text/javascript'> + $(function(){$('#category_description').dialog({'autoOpen':false});}); + </script> +{%comment%} + <div id='utils-div' class='panel panel-default'> + <div class='panel-body' class="btn-group-vertical"> + {% routing %} + {% display_welcome %} + {% display_news news_visible %} + + <button id='permalink' type="button" class="btn btn-default"></button> + <button id='simple_button' type='button' class="btn btn-default" href='{% url chimere:simple_index area_name_slash %}'>{% trans "Simple map" %}</button> + <div id='permalink' class='ui-widget ui-button ui-state-default ui-corner-all'></div> + <a id='simple_button' class="btn btn-default" href='{% url chimere:simple_index area_name_slash %}'>{% trans "Simple map" %}</a> + </div> + </div> +{%endcomment%} + <div id='detail'></div> +{% endblock %} +{% block search_box %} {% endblock %} +{% block content %} + {{block.super}} + <div id='main-map'></div> +<script type="text/javascript"> + $("#main-map").show(); +</script> + {% map_menu %} + {% map 'main-map' %} + <div id='chimere_message'></div> + <script type='text/javascript'> + 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(){ + $('#chimere_message').dialog({'autoOpen':false}); + if (has_search){ + load_search_box(); + } + }); + </script> +{% endblock %} +{% block footer %} + <p class='map-footer'>{% include "chimere/blocks/footer.html" %}</p> +{% endblock %} |
