summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-09-25 17:57:09 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-09-25 17:57:09 +0200
commitcd42d7301d0cfb40c448b9a8a64280a42b6126ad (patch)
tree4d45483011c67689f30d956cc9f73d3e4a7a7e1b
parent357703c1ccd12db89bc2da80ecfe9941ba11723d (diff)
parenta01ba65e701c3fb39d81e3350ed8c029adb54ea5 (diff)
downloadChimère - projet Saclay-cd42d7301d0cfb40c448b9a8a64280a42b6126ad.tar.bz2
Chimère - projet Saclay-cd42d7301d0cfb40c448b9a8a64280a42b6126ad.zip
Merge branch 'master-v2.2' into saclay-v2.2
Conflicts: static/saclay/css/styles.css templates/chimere/detail.html
-rwxr-xr-xmanage.py2
-rw-r--r--settings.py99
-rw-r--r--static/saclay/css/styles.css51
-rw-r--r--static/saclay/images/button-cat-three-off.pngbin1340 -> 4039 bytes
-rw-r--r--static/saclay/images/button-cat-three-on.pngbin1232 -> 3957 bytes
-rw-r--r--static/saclay/images/button-route-three-off.pngbin900 -> 3604 bytes
-rw-r--r--static/saclay/images/button-route-three-on.pngbin806 -> 3499 bytes
-rw-r--r--static/saclay/images/button-search-off.pngbin805 -> 3736 bytes
-rw-r--r--static/saclay/images/button-search-on.pngbin640 -> 3556 bytes
-rw-r--r--static/saclay/js/interface.js14
-rw-r--r--templates/chimere/blocks/share_bar.html7
-rw-r--r--templates/chimere/detail.html24
12 files changed, 104 insertions, 93 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/settings.py b/settings.py
index 99117a6..0a9ba06 100644
--- a/settings.py
+++ b/settings.py
@@ -4,7 +4,8 @@
# Don't edit this file:
# overload all theses settings in your local_settings.py file
-import os, sys
+import os
+import sys
_ = lambda s: s
DEBUG = False
@@ -29,11 +30,11 @@ JQUERY_CSS_URLS = []
OSM_CSS_URLS = ["http://www.openlayers.org/api/theme/default/style.css"]
GPSBABEL = '/usr/bin/gpsbabel'
-GPSBABEL_OPTIONS = 'simplify,crosstrack,error=0.005k' # simplify with an
- # error of 5 meters
-#GPSBABEL_OPTIONS = 'simplify,count=100'
+# simplify with an error of 5 meters
+GPSBABEL_OPTIONS = 'simplify,crosstrack,error=0.005k'
+# GPSBABEL_OPTIONS = 'simplify,count=100'
-## chimere specific ##
+# # chimere specific ##
CHIMERE_DEFAULT_ZOOM = 10
# center of the map
CHIMERE_DEFAULT_CENTER = (-1.679444, 48.114722)
@@ -71,10 +72,12 @@ CHIMERE_MINIATURE_BY_DEFAULT = False
# JS definition of the default map (for admin and when no map are defined in
# the application)
# cf. OpenLayers documentation for more details
-CHIMERE_DEFAULT_MAP_LAYER = "new OpenLayers.Layer.OSM.Mapnik('Mapnik')" # OSM mapnik map
+
+# OSM mapnik map
+CHIMERE_DEFAULT_MAP_LAYER = "new OpenLayers.Layer.OSM.Mapnik('Mapnik')"
CHIMERE_XAPI_URL = 'http://open.mapquestapi.com/xapi/api/0.6/'
-CHIMERE_OSM_API_URL = 'api06.dev.openstreetmap.org' # test URL
+CHIMERE_OSM_API_URL = 'api06.dev.openstreetmap.org' # test URL
CHIMERE_OSM_USER = 'test'
CHIMERE_OSM_PASSWORD = 'test'
@@ -90,16 +93,18 @@ CHIMERE_ENABLE_CLUSTERING = False
# enable routing in Chimère
CHIMERE_ENABLE_ROUTING = False
-CHIMERE_ROUTING_TRANSPORT = (('foot', _(u"Foot")),
- ('bicycle', _(u"Bicycle")),
- ('motorcar', _(u"Motorcar")),
- )
+CHIMERE_ROUTING_TRANSPORT = (
+ ('foot', _(u"Foot")),
+ ('bicycle', _(u"Bicycle")),
+ ('motorcar', _(u"Motorcar")),
+)
-CHIMERE_ROUTING_SPEEDS = {'foot':((3, _(u"You are walking slowly")),
- (6, _(u"You are walking pretty quickly")),),
- 'bicycle':((16, _(u"You are riding pretty slowly")),
- (22, _(u"You are riding pretty quickly")),)
- }
+CHIMERE_ROUTING_SPEEDS = {
+ 'foot': ((3, _(u"You are walking slowly")),
+ (6, _(u"You are walking pretty quickly")),),
+ 'bicycle': ((16, _(u"You are riding pretty slowly")),
+ (22, _(u"You are riding pretty quickly")),)
+}
# available routing engine: 'routino'
CHIMERE_ROUTING_ENGINE = {
@@ -116,8 +121,8 @@ est trop dangereux.</p>"""
NOMINATIM_URL = 'http://nominatim.openstreetmap.org/search'
# thumbnail
-CHIMERE_THUMBS_SCALE_HEIGHT=250
-CHIMERE_THUMBS_SCALE_WIDTH=None
+CHIMERE_THUMBS_SCALE_HEIGHT = 250
+CHIMERE_THUMBS_SCALE_WIDTH = None
# search engine
CHIMERE_SEARCH_ENGINE = False
@@ -134,12 +139,13 @@ 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_MODIF_EMAIL = _(u"Hello, I would like to propose you a modification "
+ u"about this item: ")
-CHIMERE_ROUTING_WARN_MESSAGE = u"""<h3 class='warn'>Attention</h3>
-<p>Cet itinéraire comporte des passages dangereux, nous vous conseillons de
-modifier votre recherche.</p>
-"""
+CHIMERE_ROUTING_WARN_MESSAGE = u"<h3 class='warn'>Attention</h3>"\
+ u"<p>Cet itinéraire comporte des passages dangereux, nous vous conseillons"\
+ u" de modifier votre recherche, en ajoutant par exemple un ou des points "\
+ u"d'étape à votre parcours pour éviter les zones de danger.</p>"
CHIMERE_CSV_ENCODING = 'ISO-8859-1'
@@ -197,7 +203,6 @@ MEDIA_URL = '/media/'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
-# 'django.template.loaders.eggs.load_template_source',
)
MIDDLEWARE_CLASSES = (
@@ -211,9 +216,6 @@ MIDDLEWARE_CLASSES = (
ROOT_URLCONF = 'chimere_saclay.urls'
TEMPLATE_DIRS = [
- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
ROOT_PATH + 'templates',
]
@@ -241,6 +243,7 @@ INSTALLED_APPS = [
try:
import djcelery
import kombu
+ kombu
djcelery.setup_loader()
BROKER_URL = 'django://'
INSTALLED_APPS += ['kombu.transport.django',
@@ -254,12 +257,13 @@ INSTALLED_APPS += [
'chimere',
]
-MOBILE_DOMAINS = [] # if you have specific domains for mobile access
+MOBILE_DOMAINS = [] # if you have specific domains for mobile access
LOGFILENAME = '/var/log/django/chimere.log'
-LOGGING = {'version': 1,
- 'disable_existing_loggers': False,
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': False,
'handlers': {
# Include the default Django email handler for errors
# This is what you'd get without configuring logging at all.
@@ -291,12 +295,23 @@ LOGGING = {'version': 1,
# Your own app - this assumes all your logger names start with "myapp."
'chimere': {
'handlers': ['logfile'],
- 'level': 'WARNING', # Or maybe INFO or DEBUG
- 'propogate': False
+ 'level': 'WARNING', # Or maybe INFO or DEBUG
+ 'propogate': False
},
},
}
+CHIMERE_SEARCH_ENGINE = False
+# default haystack parameters when search engine is activated
+HAYSTACK_CONNECTIONS = {
+ 'default': {
+ 'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
+ 'URL': 'http://127.0.0.1:8080/solr'
+ },
+}
+HAYSTACK_SEARCH_RESULTS_PER_PAGE = 12
+HAYSTACK_AUTOCOMPLETE = False
+
try:
from local_settings import *
except ImportError, e:
@@ -316,7 +331,6 @@ if not JQUERY_CSS_URLS:
JQUERY_CSS_URLS = (STATIC_URL + 'jquery-ui/smoothness/jquery-ui.css',
STATIC_URL + 'jquery-ui/base/jquery.ui.all.css')
-
LOGGING['handlers']['logfile']['filename'] = LOGFILENAME
if 'CHIMERE_SHARE_NETWORKS' not in globals():
@@ -325,12 +339,12 @@ if 'CHIMERE_SHARE_NETWORKS' not in globals():
# share with
global CHIMERE_SHARE_NETWORKS
CHIMERE_SHARE_NETWORKS = (
- ("Email", 'mailto:?subject=%(text)s&body=%(url)s',
- STATIC_URL + 'chimere/img/email.png'),
- ("Facebook", 'http://www.facebook.com/sharer.php?t=%(text)s&u=%(url)s',
- STATIC_URL + 'chimere/img/facebook.png'),
- ("Twitter", 'http://twitter.com/home?status=%(text)s %(url)s',
- STATIC_URL + 'chimere/img/twitter.png'),
+ ("Email", 'mailto:?subject=%(text)s&body=%(url)s',
+ STATIC_URL + 'chimere/img/email.png'),
+ ("Facebook", 'http://www.facebook.com/sharer.php?t=%(text)s&u=%(url)s',
+ STATIC_URL + 'chimere/img/facebook.png'),
+ ("Twitter", 'http://twitter.com/home?status=%(text)s %(url)s',
+ STATIC_URL + 'chimere/img/twitter.png'),
)
if 'OSM_JS_URLS' not in globals():
@@ -340,6 +354,7 @@ if 'OSM_JS_URLS' not in globals():
"http://www.openstreetmap.org/openlayers/OpenStreetMap.js"]
if 'OSM_MOBILE_JS_URLS' not in globals():
global OSM_MOBILE_JS_URLS
- OSM_MOBILE_JS_URLS = [STATIC_URL + "openlayers/OpenLayers.mobile.js",
- "http://www.openstreetmap.org/openlayers/OpenStreetMap.js"
- ]
+ OSM_MOBILE_JS_URLS = [
+ STATIC_URL + "openlayers/OpenLayers.mobile.js",
+ "http://www.openstreetmap.org/openlayers/OpenStreetMap.js"
+ ]
diff --git a/static/saclay/css/styles.css b/static/saclay/css/styles.css
index 52bb412..005ec2d 100644
--- a/static/saclay/css/styles.css
+++ b/static/saclay/css/styles.css
@@ -23,7 +23,7 @@ h2, .cloud h4, #layer_selection, #layer_selection h4, #permalink a,
}
/* activated */
-.small-galery p.legend, #detail_footer, #detail_footer a, #chimere_itinerary h4,
+#detail_footer, #detail_footer a, #chimere_itinerary h4,
h3.warn, .itinerary_label.itinerary_start, .itinerary_label.itinerary_end,
.action li.ui-state-active{
color:#fff;
@@ -72,6 +72,10 @@ caption{
font-size:0.9em;
}
+#detail_footer a {
+ display: inline-block;
+}
+
/*
* Background colors
*/
@@ -93,7 +97,6 @@ ul#multimedia_list_content li, #welcome .footer,
background-color:#d6d6c4;
}
-.small-galery p.legend,
#detail_footer{
background-color:#9f9f89;
}
@@ -144,11 +147,6 @@ div.warning, .errorlist{
background-color:#fff;
}
-/* black */
-.small-galery{
- background-color:#000;
-}
-
h2, h3{
background:none;
}
@@ -163,7 +161,7 @@ h2, h3{
#map-footer, #utils-div, #action, #panel #categories, .main_category,
#page_title, #ul_categories .subcategories li, #action-panel,
ul.ui-autocomplete.ui-menu.ui-corner-all.ui-widget-content, .extra-criteria,
-#chimere_itinerary_form, .welcome-logo, #permalink{
+#chimere_itinerary_form, .welcome-logo, #permalink, #footer-panel{
border-color:#999;
}
@@ -451,6 +449,7 @@ a#ui-active-menuitem.ui-state-hover{
display:none;
left:7px;
top:10px;
+ width: 281px;
}
#haystack-search{
@@ -789,7 +788,7 @@ ul#action{
#panel #categories{
clear:both;
- border-top-width:1px;
+ border-top-width:0;
border-top-style:solid;
}
@@ -1121,7 +1120,7 @@ div#sidebar{
div#sidebar{
z-index:7;
- width:282px;
+ width:281px;
top:26px;
position:absolute;
bottom:0;
@@ -1136,13 +1135,13 @@ div#action-panel{
height:60px;
width:282px;
background-image:url(../images/background-small.png) ;
- background-repeat:no-repeat;
+ background-repeat:repeat;
background-position:center;
}
div#panel{
position:absolute;
- width:282px;
+ width:281px;
z-index:10;
max-height:none;
padding:0;
@@ -1153,6 +1152,7 @@ div#panel{
background-image:url('../images/logo.png');
background-repeat:no-repeat;
background-position:left bottom;
+ overflow-x:hidden;
}
/* share toolbar */
@@ -1168,6 +1168,13 @@ a.share_id_email_single{
font-size:0;
}
+ul.share {
+ display: inline;
+ text-align: center;
+ font-style: normal;
+ padding: 2px 0;
+}
+
#footer-panel{
text-align:center;
padding:3px;
@@ -1175,6 +1182,7 @@ a.share_id_email_single{
position:absolute;
width:275px;
height:22px;
+ border-right:1px solid;
}
.sidebar-handler{
@@ -1334,9 +1342,14 @@ label[for=id_transport_0]{
background-image:url('../images/buttons/walk.png');
}
+#id_transport_it span#id_transport_it_foot{
+ display:none;
+}
+
#id_transport_it span#id_transport_it_foot.selected,
label[for=id_transport_0]:hover,
label[for=id_transport_0][aria-pressed=true]{
+ display:inline-block;
background-image:url('../images/buttons/walk_on.png');
}
@@ -1345,9 +1358,14 @@ label[for=id_transport_1]{
background-image:url('../images/buttons/bicycle.png');
}
+#id_transport_it span#id_transport_it_bicycle{
+ display:none;
+}
+
#id_transport_it span#id_transport_it_bicycle.selected,
label[for=id_transport_1]:hover,
label[for=id_transport_1][aria-pressed=true]{
+ display:inline-block;
background-image:url('../images/buttons/bicycle_on.png');
}
@@ -1507,8 +1525,9 @@ ul#roadmap_toolbar a img{
}
ul#roadmap_toolbar{
position:absolute;
- top:45px;
right:10px;
+ top: 47px;
+ margin: 0;
}
ul#roadmap_toolbar, ul#roadmap_toolbar ul, ul#roadmap_toolbar li{
@@ -1704,7 +1723,7 @@ input.hasDatepicker{
}
.cloud{
- width:350px;
+ width:351px;
padding:0;
margin:0;
}
@@ -1726,7 +1745,7 @@ div.cloud h4{
.close_img{
display:block;
overflow:hidden;
- width:350px;
+ width:351px;
height:22px;
background-image:url(../images/popup/close.png);
background-position:center;
@@ -1793,7 +1812,7 @@ a.close_img{
margin-top:0;
}
-.small-galery p.legend{
+.small-gallery p.legend{
line-height:22px;
}
diff --git a/static/saclay/images/button-cat-three-off.png b/static/saclay/images/button-cat-three-off.png
index 55822a3..9d728de 100644
--- a/static/saclay/images/button-cat-three-off.png
+++ b/static/saclay/images/button-cat-three-off.png
Binary files differ
diff --git a/static/saclay/images/button-cat-three-on.png b/static/saclay/images/button-cat-three-on.png
index 1c90751..d9bcc7e 100644
--- a/static/saclay/images/button-cat-three-on.png
+++ b/static/saclay/images/button-cat-three-on.png
Binary files differ
diff --git a/static/saclay/images/button-route-three-off.png b/static/saclay/images/button-route-three-off.png
index ad65794..388fd9d 100644
--- a/static/saclay/images/button-route-three-off.png
+++ b/static/saclay/images/button-route-three-off.png
Binary files differ
diff --git a/static/saclay/images/button-route-three-on.png b/static/saclay/images/button-route-three-on.png
index ea096b3..9581525 100644
--- a/static/saclay/images/button-route-three-on.png
+++ b/static/saclay/images/button-route-three-on.png
Binary files differ
diff --git a/static/saclay/images/button-search-off.png b/static/saclay/images/button-search-off.png
index 8aa6f96..9188039 100644
--- a/static/saclay/images/button-search-off.png
+++ b/static/saclay/images/button-search-off.png
Binary files differ
diff --git a/static/saclay/images/button-search-on.png b/static/saclay/images/button-search-on.png
index 27f6d69..b7ed487 100644
--- a/static/saclay/images/button-search-on.png
+++ b/static/saclay/images/button-search-on.png
Binary files differ
diff --git a/static/saclay/js/interface.js b/static/saclay/js/interface.js
index 8c7eb6b..e004ce4 100644
--- a/static/saclay/js/interface.js
+++ b/static/saclay/js/interface.js
@@ -145,11 +145,6 @@ $(function(){
return false;
});
- $('.share-icon').click(function(){
- $(this).hide();
- $(this).nextAll('.shared').show();
- return false;
- });
$('.print-page').click(function(){
window.print();
return false;
@@ -222,11 +217,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({
@@ -237,6 +227,10 @@ function display_feature_detail(data, settings){
$('html').addClass('js-on');
$(function(){
$('div.media-player').jmeEmbedControls();
+ setTimeout(function(){
+ settings.current_popup.updateSize();
+ setTimeout(function(){ settings.current_popup.updateSize(); }, 1000);
+ }, 1000);
});
}
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 @@
<a href='{{share_network.1}}'>{{share_network.0}}</a>
{% endfor %}{%else%}
<ul class='share'>
- <li class='share-send'><a class='share_link share_id_{{share_networks.0.0}}{% if email_only %}_single{%endif%}' href='{{share_networks.0.1}}'>{% trans "Email" %}</a></li>
+ <li class='share-send'><a class='share_link share_id_{{share_networks.0.0}}{% if email_only %}_single{%endif%}' href='{{share_networks.0.1}}'><img src="{{share_network.0.2}}" alt="{{share_network.0.0}}"/></a></li>
{% if not email_only %}<li class='share-icon'><a href="#">{% trans "Share" %}</a></li>{% for share_network in share_networks %}
- {%if forloop.counter0%}
- <li class='shared' style='display:none'><a class='share_link share_id_{{share_network.0}}' href='{{share_network.1}}'><img src="{{share_network.2}}" alt="{{share_network.0}}"/></a></li>{%endif%}
+ <li class='shared'><a class='share_link share_id_{{share_network.0}}' href='{{share_network.1}}'><img src="{{share_network.2}}" alt="{{share_network.0}}"/></a></li>
{% endfor %}
- <li class='shared' style='display:none'><a href='{% url chimere:feeds-global %}'><img src='{{STATIC_URL}}chimere/img/feed.png' alt='Feeds'/></a></li>{%endif%}
+ <li class='shared'><a href='{% url chimere:feeds-global %}'><img src='{{STATIC_URL}}chimere/img/feed.png' alt='Feeds'/></a></li>{%endif%}
</ul>{% endif %}
<script type='text/javascript'>
<!--
diff --git a/templates/chimere/detail.html b/templates/chimere/detail.html
index be4615b..e8a95d4 100644
--- a/templates/chimere/detail.html
+++ b/templates/chimere/detail.html
@@ -10,6 +10,9 @@
{% for multimedia_item in marker.default_multimedia_items %}
{% multimedia_render multimedia_item %}
{%endfor%}
+ {% for item in marker.multimedia_items %}
+ {% multimedia_render item %}
+ {%endfor%}
</div>
{%endif%}
<div>
@@ -21,14 +24,8 @@
<div id='description_long_{{marker.pk}}' class='description'>{{ marker.description|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4 table td tr th"|safe}}</div>
{% endif %}
{% for property in marker.getProperties %}{% if property.value %}
- <div class='properties' id='{{property.propertymodel.getAttrName}}'><strong>{{property.propertymodel.name}}</strong> : {% if 'http://' in property.value %}<a href='{{ property.value|sanitize:""}}'>{%endif%}{{ property.value|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4 table td tr th"|safe}}{% if 'http://' in property.value %}</a>{%endif%}</div>
+ <div class='properties' id='{{property.propertymodel.getAttrName}}'><strong>{{property.propertymodel.name}}</strong> : {% if 'http://' in property.value or 'https://' in property.value %}<a href='{{ property.value|sanitize:""}}'>{%endif%}{{ property.value|sanitize:"p b i br hr strong em span:style a:href:target ul li ol h1 h2 h3 h4 table td tr th"|safe}}{% if 'http://' in property.value or 'https://' in property.value %}</a>{%endif%}</div>
{%endif%}{% endfor %}
- {% if marker.origin %}
- <div class='origin'><label>Source :</label> {{marker.origin|safe}}</div>
- {% endif %}
- {% if marker.multimedia_items %}
- <a href='#' id='show_gallery_link'>{% trans "Show multimedia gallery" %}</a>
- {% endif %}
</div>
</div>
<div id='detail_footer'>
@@ -49,19 +46,6 @@
</a>
{% endcomment %}
</div>
-{% if marker.multimedia_items %}
-<div id='gallery-{{marker.pk}}' class='gallery'>
- <div class='tabs'>
- <ul>{% for item in marker.multimedia_items %}
- <li><a href="#tab-{{ forloop.counter }}">{{ item.name }}</a></li>{% endfor %}
- </ul>
- {% for multimedia_item in marker.multimedia_items %}
- <div id="tab-{{ forloop.counter }}" class='{% ifequal multimedia_item.multimedia_type.media_type 'V' %}video{% else %}other{% endifequal %}'>
- {% multimedia_render multimedia_item %}
- </div>{% endfor %}
- </div>
-</div>
-{% endif %}
<script language='javascript' type='text/javascript'>
<!--
$('html').addClass('js-on');