From dd3bb6e2b29075259e8d900a5020765c99d76347 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Jun 2015 18:46:36 +0200 Subject: Search: add new images for menu, style and template change --- static/saclay/css/styles.css | 37 ++++++++++++++++++++++-- static/saclay/images/button-cat-three-off.png | Bin 0 -> 805 bytes static/saclay/images/button-cat-three-on.png | Bin 0 -> 1232 bytes static/saclay/images/button-route-three-off.png | Bin 0 -> 900 bytes static/saclay/images/button-route-three-on.png | Bin 0 -> 806 bytes static/saclay/images/button-search-off.png | Bin 0 -> 805 bytes static/saclay/images/button-search-on.png | Bin 0 -> 640 bytes templates/chimere/main_map.html | 6 ++-- 8 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 static/saclay/images/button-cat-three-off.png create mode 100644 static/saclay/images/button-cat-three-on.png create mode 100644 static/saclay/images/button-route-three-off.png create mode 100644 static/saclay/images/button-route-three-on.png create mode 100644 static/saclay/images/button-search-off.png create mode 100644 static/saclay/images/button-search-on.png diff --git a/static/saclay/css/styles.css b/static/saclay/css/styles.css index 3e84b33..5e62f51 100644 --- a/static/saclay/css/styles.css +++ b/static/saclay/css/styles.css @@ -757,6 +757,12 @@ ul#action{ margin-top:22px; } +#action-panel.three .action li { + padding: 0px; + height: 38px; + width: 92px; +} + .action li, .action li a, .action li label{ @@ -903,9 +909,34 @@ ul#action{ background-repeat:no-repeat; } -#action-routing.state-active, -#action-routing:hover{ - background-image:url(../images/button-route-on.png) ; +.three #action-categories{ + background-image:url(../images/button-cat-three-off.png) ; + margin-right:3px; +} + +.three #action-categories.state-active, +.three #action-categories:hover{ + background-image:url(../images/button-cat-three-on.png) ; +} + +.three #action-routing{ + background-image:url(../images/button-route-three-off.png) ; +} + +.three #action-routing.state-active, +.three #action-routing:hover{ + background-image:url(../images/button-route-three-on.png) ; +} + +#action-search{ + background-image:url(../images/button-search-off.png) ; + background-repeat:no-repeat; + margin-right:3px; +} + +#action-search.state-active, +#action-search:hover{ + background-image:url(../images/button-search-on.png) ; background-repeat:no-repeat; } diff --git a/static/saclay/images/button-cat-three-off.png b/static/saclay/images/button-cat-three-off.png new file mode 100644 index 0000000..a581a6b Binary files /dev/null and b/static/saclay/images/button-cat-three-off.png differ diff --git a/static/saclay/images/button-cat-three-on.png b/static/saclay/images/button-cat-three-on.png new file mode 100644 index 0000000..1c90751 Binary files /dev/null and b/static/saclay/images/button-cat-three-on.png differ diff --git a/static/saclay/images/button-route-three-off.png b/static/saclay/images/button-route-three-off.png new file mode 100644 index 0000000..ad65794 Binary files /dev/null and b/static/saclay/images/button-route-three-off.png differ diff --git a/static/saclay/images/button-route-three-on.png b/static/saclay/images/button-route-three-on.png new file mode 100644 index 0000000..ea096b3 Binary files /dev/null and b/static/saclay/images/button-route-three-on.png differ diff --git a/static/saclay/images/button-search-off.png b/static/saclay/images/button-search-off.png new file mode 100644 index 0000000..8aa6f96 Binary files /dev/null and b/static/saclay/images/button-search-off.png differ diff --git a/static/saclay/images/button-search-on.png b/static/saclay/images/button-search-on.png new file mode 100644 index 0000000..27f6d69 Binary files /dev/null and b/static/saclay/images/button-search-on.png differ diff --git a/templates/chimere/main_map.html b/templates/chimere/main_map.html index a14ea3f..76b46fd 100644 --- a/templates/chimere/main_map.html +++ b/templates/chimere/main_map.html @@ -24,11 +24,13 @@ {% block sidebar %} -
+
  • -
  • {% if itinerary_form %} + {% if has_search %}{% endif %}{% if itinerary_form %}
  • {% endif %} -- cgit v1.2.3 From 3386edf21c1d49459e5373bdcde6a50686ae8d64 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Jun 2015 18:48:24 +0200 Subject: Search: new settings for search --- settings.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/settings.py b/settings.py index 371edc1..9c88545 100644 --- a/settings.py +++ b/settings.py @@ -57,6 +57,8 @@ CHIMERE_DAYS_BEFORE_EVENT = 30 CHIMERE_ALL_DATED_ARE_FRONT = True # allow feeds CHIMERE_FEEDS = True +# display a directory of items +CHIMERE_DIRECTORY = False CHIMERE_ICON_WIDTH = 21 CHIMERE_ICON_HEIGHT = 25 @@ -108,7 +110,7 @@ CHIMERE_ROUTING_ENGINE = { } CHIMERE_ROUTING_FAIL_MESSAGE = u"""

    Attention

    -

    Le moteur de routage a échoué dans sa recherche de trajet. Les points de +

    Le moteur de routage a échoué dans sa recherche de trajet. Les points de départ ou d'arrivée sont peut-être trop loin d'une voie existante ou le trajet est trop dangereux.

    """ @@ -118,13 +120,25 @@ NOMINATIM_URL = 'http://nominatim.openstreetmap.org/search' CHIMERE_THUMBS_SCALE_HEIGHT=250 CHIMERE_THUMBS_SCALE_WIDTH=None +# search engine +CHIMERE_SEARCH_ENGINE = False +HAYSTACK_CONNECTIONS = { + 'default': { + 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', + 'URL': 'http://127.0.0.1:8080/solr', + 'INCLUDE_SPELLING': True, + }, +} +HAYSTACK_SEARCH_RESULTS_PER_PAGE = 12 +HAYSTACK_AUTOCOMPLETE = False + # length of short description CHIMERE_SHORT_DESC_LENGTH = 400 CHIMERE_MODIF_EMAIL = _(u"""Hello, I would like to propose you a modification about this item: """) CHIMERE_ROUTING_WARN_MESSAGE = u"""

    Attention

    -

    Cet itinéraire comporte des passages dangereux, nous vous conseillons de +

    Cet itinéraire comporte des passages dangereux, nous vous conseillons de modifier votre recherche.

    """ @@ -289,6 +303,9 @@ try: except ImportError, e: print 'Unable to load local_settings.py:', e +if CHIMERE_SEARCH_ENGINE: + INSTALLED_APPS.insert(INSTALLED_APPS.index('south'), 'haystack') + if DJANGO_EXTENSIONS: INSTALLED_APPS.append('django_extensions') -- cgit v1.2.3 From 88f0ecd60bededd88473fa8cd8c675fbb9ed381c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Jun 2015 19:37:24 +0200 Subject: Search: html and JS integration of search module --- templates/chimere/blocks/map.html | 15 +++++++++++++++ templates/chimere/main_map.html | 13 +++++++++++++ 2 files changed, 28 insertions(+) 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(){ {% map_menu %} -- cgit v1.2.3 From 72905a236226e28cb0f33918d85790141952f22b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Jun 2015 19:43:44 +0200 Subject: Search: CSS adaptation for Saclay theme --- static/saclay/css/styles.css | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/static/saclay/css/styles.css b/static/saclay/css/styles.css index 5e62f51..8863764 100644 --- a/static/saclay/css/styles.css +++ b/static/saclay/css/styles.css @@ -447,6 +447,51 @@ a#ui-active-menuitem.ui-state-hover{ background-image:none; } +#search-box{ + display:none; + left:7px; + top:10px; +} + +#haystack-search{ + width:35px; + height:28px; + background-image:url(../images/search.png); + background-repeat:no-repeat; + background-position:center; + background-color: #fff; + border: 1px solid #ddd; + vertical-align:top; +} + +#search-listing img{ + vertical-align:middle; +} + +#search-listing ul{ + padding:4px; +} + +#search-listing ul li { + padding: 0; +} + +ul.pager{ + list-style:none; +} + +ul.pager li{ + display:block; +} + +ul.pager.next{ + float:right; +} + +ul.pager.right{ + float:right; +} + #logos{ width:340px; margin-left:auto; -- cgit v1.2.3 From c10ecbb8dabc1c4f32b1fadf997793cc12316bc4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Jun 2015 19:54:46 +0200 Subject: Search: minor CSS adjustment --- static/saclay/css/styles.css | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/static/saclay/css/styles.css b/static/saclay/css/styles.css index 8863764..1283fc6 100644 --- a/static/saclay/css/styles.css +++ b/static/saclay/css/styles.css @@ -482,15 +482,13 @@ ul.pager{ ul.pager li{ display:block; + width:100%; } -ul.pager.next{ - float:right; +ul.pager .next{ + text-align:right; } -ul.pager.right{ - float:right; -} #logos{ width:340px; -- cgit v1.2.3 From 6e0960ec3f9f2d0773cf4e2a9ec4e64c8389929f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Jun 2015 20:50:59 +0200 Subject: Search: add missing image --- static/saclay/images/search.png | Bin 0 -> 686 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 static/saclay/images/search.png diff --git a/static/saclay/images/search.png b/static/saclay/images/search.png new file mode 100644 index 0000000..0eff19b Binary files /dev/null and b/static/saclay/images/search.png differ -- cgit v1.2.3 From ae381830f5f3bfca56ba9f9c3f120ee67e3d6111 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Jun 2015 21:04:46 +0200 Subject: Search: fix bad action image --- static/saclay/images/button-cat-three-off.png | Bin 805 -> 1340 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/static/saclay/images/button-cat-three-off.png b/static/saclay/images/button-cat-three-off.png index a581a6b..55822a3 100644 Binary files a/static/saclay/images/button-cat-three-off.png and b/static/saclay/images/button-cat-three-off.png differ -- cgit v1.2.3 From 89ee0ad65b72be31cd01e7b97dd509a2877603b3 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 13 Jul 2015 12:46:24 +0200 Subject: Don't hide share links --- manage.py | 2 +- static/saclay/js/interface.js | 10 ---------- templates/chimere/blocks/share_bar.html | 7 +++---- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/manage.py b/manage.py index 7bbd479..abb366f 100755 --- a/manage.py +++ b/manage.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import os, sys from django.core.management import execute_manager sys.path.insert(0, '/home/nim/Work/chimere-project/chimere/') diff --git a/static/saclay/js/interface.js b/static/saclay/js/interface.js index 3f23a72..cfaaae5 100644 --- a/static/saclay/js/interface.js +++ b/static/saclay/js/interface.js @@ -137,11 +137,6 @@ $(function(){ return false; }); - $('.share-icon').click(function(){ - $(this).hide(); - $(this).nextAll('.shared').show(); - return false; - }); $('.print-page').click(function(){ window.print(); return false; @@ -214,11 +209,6 @@ function display_feature_detail(data, settings){ $("#read_less_"+settings.current_feature.pk).hide(); $("#read_more_"+settings.current_feature.pk).show(); }); - $('.share-icon').click(function(){ - $(this).hide(); - $(this).parent().nextAll('.shared').show(); - return false; - }); $(document).ready(function(){ share_link_update(); $("a[rel^='prettyPhoto']").prettyPhoto({ diff --git a/templates/chimere/blocks/share_bar.html b/templates/chimere/blocks/share_bar.html index 73177fc..aaa9fc4 100644 --- a/templates/chimere/blocks/share_bar.html +++ b/templates/chimere/blocks/share_bar.html @@ -4,12 +4,11 @@ {{share_network.0}} {% endfor %}{%else%} {% endif %}