summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-02-08 16:00:58 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-02-08 16:00:58 +0100
commita30230bfb1c8d37d9bd746ae93e7e258611497a1 (patch)
treeb160dc5f07f616763c9eed3d1e269dba997b1afd
parent82298a7ac97496b892e58252e4463e1573bb1457 (diff)
downloadChimère - projet Saclay-a30230bfb1c8d37d9bd746ae93e7e258611497a1.tar.bz2
Chimère - projet Saclay-a30230bfb1c8d37d9bd746ae93e7e258611497a1.zip
Ajout de font-awesome - gestion d'un bouton de retour pour la recherche
-rw-r--r--static/saclay/css/mobile.css149
-rw-r--r--templates/chimere/blocks/main_map.html12
-rw-r--r--templates/chimere/blocks/map.html7
-rw-r--r--templates/chimere/main_map.html15
-rw-r--r--templates/search/search.html53
5 files changed, 183 insertions, 53 deletions
diff --git a/static/saclay/css/mobile.css b/static/saclay/css/mobile.css
index c21f98a..5cb365c 100644
--- a/static/saclay/css/mobile.css
+++ b/static/saclay/css/mobile.css
@@ -1,37 +1,112 @@
-/* sample css file for mobile */
-
-.cloud, .close_img{
- width:200px;
-}
-
-#main-map {
- top : 0;
-}
-
-#detail_content{
- max-height:100px;
-}
-
-.map-footer, #footer-panel a, #action-routing, #search-form, #sidebar, #map_menu_step, #map_menu_zoomin, #map_menu_zoomout {
- display:none;
-}
-
-#sidebar {
- width:300px !important;
- top:0px !important;
-}
-
-#map-shadow, #sidebar, #panel {
- background-image:none !important;
-}
-
-.sidebar-handler {
- width:37px;
-}
-
-#footer-panel {
- background-color:#fff !important;
- border-right:1px solid #000;
- width:275px;
- color:#fff;
-}
+/* sample css file for mobile */
+
+.cloud, .close_img{
+ width:200px;
+}
+
+#main-map {
+ top : 0;
+}
+
+#detail_content{
+ max-height:100px;
+}
+
+.map-footer, #footer-panel a, #action-routing, #search-form, #sidebar, #map_menu_step, #map_menu_zoomin, #map_menu_zoomout {
+ display:none;
+}
+
+#sidebar {
+ width:300px !important;
+ top:0px !important;
+}
+
+#map-shadow, #sidebar, #panel {
+ background-image:none !important;
+}
+
+.sidebar-handler {
+ width:37px;
+}
+
+#footer-panel {
+ background-color:#fff !important;
+ border-right:1px solid #000;
+ width:275px;
+ color:#fff;
+}
+
+/* 2017-02-08 */
+
+ul.action{
+ display: none;
+}
+
+div#action-panel{
+ height:120px;
+ width:282px;
+ background-image:url(../images/logo-carto.png) ;
+ background-repeat:no-repeat;
+ background-position:center;
+ border-right:1px solid;
+ border-bottom:1px solid;
+ background-color: #fff;
+ border-color: #999;
+}
+
+div#panel{
+ position:absolute;
+ width:282px;
+ z-index:10;
+ max-height:none;
+ padding:0;
+ right:auto;
+ bottom:26px;
+ top:120px;
+ border-width:0 1px;
+ background-image:url('../images/logo.png');
+ background-repeat:repeat-x;
+ background-position:left bottom;
+ overflow-x:hidden;
+ border-right:1px solid;
+ border-color: #999;
+}
+
+#footer-panel{
+ border-color: #999;
+}
+
+#back-categories{
+ color: #60543A;
+ background-color: #eaeaea;
+ font-weight: 900;
+ padding: 0;
+ width: 282px;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ font-family: 'Numans';
+}
+
+#back-categories:hover{
+ cursor: pointer;
+}
+
+#back-categories .fa,
+#back-categories p{
+ display: inline-block;
+ padding: 0;
+ margin: 0;
+}
+
+#back-categories p{
+ height: 26px;
+ vertical-align: middle;
+ padding-left: 0.3em;
+}
+
+#back-categories .fa{
+ font-size: 2em;
+ padding-top: 4px;
+ padding-left: 12px;
+}
diff --git a/templates/chimere/blocks/main_map.html b/templates/chimere/blocks/main_map.html
index 2488bf9..6e77375 100644
--- a/templates/chimere/blocks/main_map.html
+++ b/templates/chimere/blocks/main_map.html
@@ -95,12 +95,12 @@
</div>{% endif %}
<div id='permalink'></div>
{% if not MOBILE %}
- {% if simple %}
- {% display_welcome 0 %}
- {%else%}
- {% display_welcome news_visible %}
- {% endif %}
- {% display_news news_visible %}
+ {% if simple %}
+ {% display_welcome 0 %}
+ {%else%}
+ {% display_welcome news_visible %}
+ {% endif %}
+ {% display_news news_visible %}
{% endif %}
{{ block.super }}
<div id='map-shadow'></div>
diff --git a/templates/chimere/blocks/map.html b/templates/chimere/blocks/map.html
index ebb7403..dd777c4 100644
--- a/templates/chimere/blocks/map.html
+++ b/templates/chimere/blocks/map.html
@@ -52,7 +52,7 @@ $(function(){
}
bridge.send('sidebarHide');
});
- window.JSInterface.sidebarHide();
+ window.JSInterface.sidebarHide();
});
$('#sidebar-handler-show').click(function(){
$('#sidebar').show();
@@ -69,9 +69,9 @@ $(function(){
}
bridge.send('sidebarShow');
});
- window.JSInterface.sidebarShow();
+ window.JSInterface.sidebarShow();
});
- //fin lib ios
+ //fin lib ios
var routing_panel_open = function(){
$('#frm_categories').hide();
$('#search-box').hide();
@@ -93,6 +93,7 @@ $(function(){
};
$('#action-categories').click(category_panel_open);
+ $('#back-categories').click(category_panel_open);
var search_panel_open = function(){
$('#chimere_itinerary_panel').hide();
diff --git a/templates/chimere/main_map.html b/templates/chimere/main_map.html
index 01d9ff5..cf3e308 100644
--- a/templates/chimere/main_map.html
+++ b/templates/chimere/main_map.html
@@ -5,6 +5,7 @@
{% head_chimere %}
{% head_jme %}
{% head_form %}
+<script src="https://use.fontawesome.com/28dbea13a1.js"></script>
<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>
@@ -95,13 +96,13 @@
</div>{% endif %}
<div id='permalink'></div>
{% if not MOBILE %}
- {% if simple %}
- {% display_welcome 0 %}
- {%else%}
- {% display_welcome news_visible %}
- {% endif %}
- {% display_news news_visible %}
- {% endif %}
+ {% if simple %}
+ {% display_welcome 0 %}
+ {%else%}
+ {% display_welcome news_visible %}
+ {% endif %}
+ {% display_news news_visible %}
+ {% endif %}
{{ block.super }}
<div id='map-shadow'></div>
<div id='default-message'></div>
diff --git a/templates/search/search.html b/templates/search/search.html
new file mode 100644
index 0000000..76e75ec
--- /dev/null
+++ b/templates/search/search.html
@@ -0,0 +1,53 @@
+{% load url from future %}{% load i18n %}
+<script type='text/javascript'>
+var do_you_mean = "{% trans 'Do you mean: ' %}";
+var end_do_you_mean = "{% trans '?' %}";
+</script>
+{% if query %}
+{% include "search/search_js.html" %}
+<div id='search-listing'>
+ <ul>
+{% for result in page.object_list %}
+ <li>
+ <img src='{{MEDIA_URL}}{{result.object.default_category.icon.image}}'/><a href="#" onclick="$('#main-map').chimere('showPopup', {{result.object.pk}});return false;">{{ result.object }}</a>
+ </li>
+{% empty %}
+ <li>{% trans "No results found." %}</li>
+{% endfor %}
+ </ul>
+</div>
+{% if page.has_previous or page.has_next %}
+ <div id='search-nav'>
+ <nav>
+ <ul class="pager">
+ {% if page.has_previous %}<li class="previous"><a href="#" onclick="haystack_search(this, {{ page.previous_page_number }});">&larr; {% trans "Previous" %}</a></li>{% endif %}
+ {% if page.has_next %}<li class="next"><a href="#" onclick="haystack_search(this, {{ page.next_page_number }});">{% trans "More results..." %} &rarr;</a></li>{% endif %}
+ </ul>
+ </nav>
+ </div>
+{% endif %}
+
+{% else %}
+<form id='search-form' class='autocomplete-me'>
+ <input type="text" id="id_q" name="q" autocomplete="off"/>
+ <button name='haystack-search' id='haystack-search' type='button' class="btn btn-default"><span class='action-label'>{% trans "Search" %} </span><span class="glyphicon glyphicon-search"></span></button>
+</form>
+<div id='spelling'></div>
+<div id='search-result'></div>
+<script type='text/javascript'>
+no_result_message = "{% trans 'No exact match.' %}";
+$(function(){
+ $('#haystack-search').click(
+ function(evt){
+ $("#main-map").chimere("razMap");
+ haystack_search(evt);
+ });
+ {% if autocomplete %}
+ window.autocomplete = new Autocomplete({
+ form_selector: '.autocomplete-me'
+ });
+ window.autocomplete.setup();{% endif %}
+});
+</script>
+{% endif %}
+<div id='back-categories'><i class="fa fa-arrow-circle-left" aria-hidden="true"></i> <p>REVENIR AUX CATÉGORIES</p></div>