diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-02 18:48:20 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-02 18:48:20 +0200 |
commit | 7bdf09dd2a786436ef68da424e1e88ca329cb9e7 (patch) | |
tree | f8a01714caec531d48c15004b352bb5f180c9886 | |
parent | 00ee0362bfdc01e35d07639e922b1dc5f130af2f (diff) | |
download | Chimère - projet Saclay-master-v2.9.tar.bz2 Chimère - projet Saclay-master-v2.9.zip |
Many adptation for the new versionmaster-v2.9
-rw-r--r-- | settings.py | 248 | ||||
-rw-r--r-- | static/saclay/js/interface.js | 2 | ||||
-rw-r--r-- | templates/chimere/blocks/map.html | 115 | ||||
-rw-r--r-- | templates/chimere/blocks/news.html | 4 | ||||
-rw-r--r-- | templates/chimere/blocks/welcome.html | 3 | ||||
-rw-r--r-- | templates/chimere/detail.html | 3 | ||||
-rw-r--r-- | urls.py | 27 |
7 files changed, 213 insertions, 189 deletions
diff --git a/settings.py b/settings.py index 3bf047a..ddd06fc 100644 --- a/settings.py +++ b/settings.py @@ -11,10 +11,12 @@ _ = lambda s: s DEBUG = False TEMPLATE_DEBUG = DEBUG MOBILE_TEST = False -DJANGO_EXTENSIONS = False +DEBUG_TOOLBAR = False +SQL_DEBUG = False + # Django settings for chimere project. -PROJECT_NAME = u'Chimère' +PROJECT_NAME = 'Chimere' ROOT_PATH = os.path.realpath(os.path.dirname(__file__)) + "/" EMAIL_HOST = 'localhost' @@ -22,15 +24,18 @@ CONTACT_EMAIL = '' STATIC_URL = '/static/' STATIC_ROOT = ROOT_PATH + 'static/' -TINYMCE_URL = '/tinymce/' -EXTRA_CSS = [] -JQUERY_JS_URLS = [] -JQUERY_CSS_URLS = [] +STATICFILES_DIRS = ( + os.path.join(ROOT_PATH, "chimere_example_static"), +) -OSM_CSS_URLS = ["http://www.openlayers.org/api/theme/default/style.css"] +TINYMCE_URL = '' +JQUERY_JS_URLS = ('/javascript/jquery/jquery.js', + '/javascript/jquery-ui/jquery-ui.js',) +JQUERY_CSS_URLS = ('/javascript/jquery-ui/css/smoothness/jquery-ui.css', + '/javascript/jquery-ui/themes/base/jquery.ui.all.css') GPSBABEL = '/usr/bin/gpsbabel' -# simplify with an error of 5 meters +# simplify with an error of 5 meters GPSBABEL_OPTIONS = 'simplify,crosstrack,error=0.005k' # GPSBABEL_OPTIONS = 'simplify,count=100' @@ -59,13 +64,10 @@ 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 -CHIMERE_ICON_OFFSET_X = -10 -CHIMERE_ICON_OFFSET_Y = -25 +CHIMERE_DIRECTORY = True +# content inside the popup or on a specific window +CHIMERE_CONTENT_INSIDE_POPUP = False # display picture inside the description by default or inside a galery? CHIMERE_MINIATURE_BY_DEFAULT = False @@ -75,7 +77,10 @@ CHIMERE_MINIATURE_BY_DEFAULT = False # cf. OpenLayers documentation for more details # OSM mapnik map -CHIMERE_DEFAULT_MAP_LAYER = "new OpenLayers.Layer.OSM.Mapnik('Mapnik')" +CHIMERE_DEFAULT_MAP_LAYER = """new ol.layer.Tile({ + style: 'Road', + source: new ol.source.OSM() +})""" CHIMERE_XAPI_URL = 'http://open.mapquestapi.com/xapi/api/0.6/' CHIMERE_OSM_API_URL = 'api06.dev.openstreetmap.org' # test URL @@ -89,16 +94,16 @@ CHIMERE_SHAPEFILE_ENCODING = 'ISO-8859-1' # it could be a good idea to hide it to an admin who could'nt do that CHIMERE_HIDE_PROPERTYMODEL = False +# clustering of markers CHIMERE_ENABLE_CLUSTERING = False -# enable routing in Chimère +# enable routing in Chimere 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")), @@ -115,12 +120,24 @@ CHIMERE_ROUTING_ENGINE = { } CHIMERE_ROUTING_FAIL_MESSAGE = u"""<h3 class='warn'>Attention</h3> -<p>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 +<p>Le moteur de routage a echoue dans sa recherche de trajet. Les points de +depart ou d'arrivee sont peut-etre trop loin d'une voie existante ou le trajet est trop dangereux.</p>""" NOMINATIM_URL = 'http://nominatim.openstreetmap.org/search' +# Fields used to geolocate with nominatim +# (http://wiki.openstreetmap.org/wiki/Nominatim#Search) +# from external sources. Key must be a valid parameters for Nominatim. If given +# value are property slugs use the corresponding value otherwise use it as a +# fixed value +# e.g : {'street':'address', 'city':'city', 'country':u'France'} + +CHIMERE_NOMINATIM_FIELDS = {'street': 'address', 'city': 'city', + 'country': u'France'} +MOBILE_TEST = False +MOBILE_DOMAINS = [] + # thumbnail CHIMERE_THUMBS_SCALE_HEIGHT = 250 CHIMERE_THUMBS_SCALE_WIDTH = None @@ -143,13 +160,15 @@ CHIMERE_SHORT_DESC_LENGTH = 400 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>"\ - 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_ROUTING_WARN_MESSAGE = "<h3 class='warn'>Attention</h3>"\ + "<p>Cet itineraire comporte des passages dangereux, nous vous conseillons"\ + " de modifier votre recherche, en ajoutant par exemple un ou des points "\ + "d'etape à votre parcours pour eviter les zones de danger.</p>" CHIMERE_CSV_ENCODING = 'ISO-8859-1' +CHIMERE_DEFAULT_ACTIONS = ['view', 'contribute'] +CHIMERE_DEFAULT_ACTION_LABEL = [u"Cartes", u"Ajouter un element"] # generic contact email CONTACT_EMAIL = '' @@ -161,20 +180,19 @@ MANAGERS = ADMINS DATABASES = { 'default': { - 'NAME': 'ratatouille', + 'NAME': 'chimere', 'ENGINE': 'django.contrib.gis.db.backends.postgis', - 'HOST': 'localhost', + 'HOST': 'postgres', 'PORT': '5432', - 'USER': 'ratatouille', - 'PASSWORD': 'wiki', + 'USER': 'chimere', + 'PASSWORD': 'chimere', }, } -if 'test' in sys.argv: - SOUTH_TESTS_MIGRATE = False # Local time zone for this installation. Choices can be found here: -# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE +# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html +# #DATETIME-TIMEZONE-SET-TABLE # although not all variations may be possible on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. @@ -206,13 +224,13 @@ TEMPLATE_LOADERS = ( 'django.template.loaders.app_directories.Loader', ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE_CLASSES = [ 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware', 'django.contrib.messages.middleware.MessageMiddleware' -) +] ROOT_URLCONF = 'chimere_saclay.urls' @@ -243,8 +261,6 @@ INSTALLED_APPS = [ # celery try: import djcelery - import kombu - kombu djcelery.setup_loader() BROKER_URL = 'django://' INSTALLED_APPS += ['kombu.transport.django', @@ -258,60 +274,9 @@ INSTALLED_APPS += [ 'chimere', ] +LOG_PATH = '/var/log/django/' MOBILE_DOMAINS = [] # if you have specific domains for mobile access -LOGFILENAME = '/var/log/django/chimere.log' - -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. - 'mail_admins': { - 'class': 'django.utils.log.AdminEmailHandler', - 'level': 'ERROR', - # But the emails are plain text by default - HTML is nicer - 'include_html': True, - }, - # Log to a text file that can be rotated by logrotate - 'logfile': { - 'class': 'logging.handlers.WatchedFileHandler', - 'filename': '/var/log/django/chimere.log' - }, - }, - 'loggers': { - # Again, default Django configuration to email unhandled exceptions - 'django.request': { - 'handlers': ['mail_admins'], - 'level': 'ERROR', - 'propagate': True, - }, - # Might as well log any errors anywhere else in Django - 'django': { - 'handlers': ['logfile'], - 'level': 'ERROR', - 'propagate': False, - }, - # Your own app - this assumes all your logger names start with "myapp." - 'chimere': { - 'handlers': ['logfile'], - '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 * @@ -321,18 +286,49 @@ except ImportError, e: if CHIMERE_SEARCH_ENGINE: INSTALLED_APPS.insert(INSTALLED_APPS.index('south'), 'haystack') -if DJANGO_EXTENSIONS: - INSTALLED_APPS.append('django_extensions') - -if not JQUERY_JS_URLS: - JQUERY_JS_URLS = (STATIC_URL + 'jquery/jquery.min.js', - STATIC_URL + 'jquery-ui/jquery-ui.min.js') - -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') +if 'LOGGING' not in globals(): + global LOGGING + 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. + 'mail_admins': { + 'class': 'django.utils.log.AdminEmailHandler', + 'level': 'ERROR', + # But the emails are plain text by default - HTML is nicer + 'include_html': True, + }, + # Log to a text file that can be rotated by logrotate + 'logfile': { + 'class': 'logging.handlers.WatchedFileHandler', + 'filename': LOG_PATH + 'chimere.log' + }, + }, + 'loggers': { + # Again, default Django configuration to email unhandled exceptions + 'django.request': { + 'handlers': ['mail_admins'], + 'level': 'ERROR', + 'propagate': True, + }, + # Might as well log any errors anywhere else in Django + 'django': { + 'handlers': ['logfile'], + 'level': 'ERROR', + 'propagate': False, + }, + # Your own app + # this assumes all your logger names start with "myapp." + 'chimere': { + 'handlers': ['logfile'], + 'level': 'WARNING', # Or maybe INFO or DEBUG + 'propogate': False + }, + }, + } -LOGGING['handlers']['logfile']['filename'] = LOGFILENAME if 'CHIMERE_SHARE_NETWORKS' not in globals(): # after the locals to get the right STATIC_URL @@ -348,14 +344,46 @@ if 'CHIMERE_SHARE_NETWORKS' not in globals(): STATIC_URL + 'chimere/img/twitter.png'), ) -if 'OSM_JS_URLS' not in globals(): - global OSM_JS_URLS - OSM_JS_URLS = [STATIC_URL + "openlayers/OpenLayers.js", - STATIC_URL + "openlayers/SimplePanZoom.js", - "http://www.openstreetmap.org/openlayers/OpenStreetMap.js"] +if 'MAP_CSS_URLS' not in globals(): + global MAP_CSS_URLS + MAP_CSS_URLS = [STATIC_URL + "ol3/ol.css"] + +if 'MAP_JS_URLS' not in globals(): + global MAP_JS_URLS + if DEBUG: + MAP_JS_URLS = [STATIC_URL + "ol3/ol-debug.js"] + else: + MAP_JS_URLS = [STATIC_URL + "ol3/ol.js"] if 'OSM_MOBILE_JS_URLS' not in globals(): - global OSM_MOBILE_JS_URLS - OSM_MOBILE_JS_URLS = [ + global OSM_MOBILE_URLS + OSM_JS_MOBILE_URLS = [ STATIC_URL + "openlayers/OpenLayers.mobile.js", - "http://www.openstreetmap.org/openlayers/OpenStreetMap.js" - ] + STATIC_URL + "openlayers/SimplePanZoom.js", + "http://www.openstreetmap.org/openlayers/OpenStreetMap.js"] + +if DEBUG_TOOLBAR: + if '..' not in sys.path: + sys.path.insert(0, '..') + global DEBUG_TOOLBAR_PANELS + global DEBUG_TOOLBAR_CONFIG + MIDDLEWARE_CLASSES += ['debug_toolbar.middleware.DebugToolbarMiddleware'] + INSTALLED_APPS += ['debug_toolbar'] + DEBUG_TOOLBAR_PANELS = ( + 'debug_toolbar.panels.version.VersionDebugPanel', + 'debug_toolbar.panels.timer.TimerDebugPanel', + 'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel', + 'debug_toolbar.panels.headers.HeaderDebugPanel', + 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', + 'debug_toolbar.panels.template.TemplateDebugPanel', + 'debug_toolbar.panels.sql.SQLDebugPanel', + 'debug_toolbar.panels.signals.SignalDebugPanel', + 'debug_toolbar.panels.logger.LoggingPanel', + ) + DEBUG_TOOLBAR_CONFIG = {'INTERCEPT_REDIRECTS': False} + + +if SQL_DEBUG: + LOGGING['loggers']['django.db.backends'] = { + 'level': 'DEBUG', + 'handlers': ['console'], + } diff --git a/static/saclay/js/interface.js b/static/saclay/js/interface.js index 114c210..238c586 100644 --- a/static/saclay/js/interface.js +++ b/static/saclay/js/interface.js @@ -218,7 +218,7 @@ function display_feature_detail(data, settings){ }); $('html').addClass('js-on'); $(function(){ - $('div.media-player').jmeEmbedControls(); + // $('div.media-player').jmeEmbedControls(); setTimeout(function(){ settings.current_popup.updateSize(); setTimeout(function(){ settings.current_popup.updateSize(); }, 1000); diff --git a/templates/chimere/blocks/map.html b/templates/chimere/blocks/map.html index 56a87a3..1dce75f 100644 --- a/templates/chimere/blocks/map.html +++ b/templates/chimere/blocks/map.html @@ -1,15 +1,7 @@ {% 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-small'}); -}); - // --> </script> <div id="waiting"> <div id="waiting-content"> @@ -17,14 +9,16 @@ $(function(){ <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"> - <!-- var routing_panel_open = function(){ $('#frm_categories').hide(); $('#search-box').hide(); @@ -63,24 +57,43 @@ $(function(){ {% 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["routing_panel_open"] = routing_panel_open; - chimere_init_options["category_accordion"] = false; - chimere_init_options["cluster_icon"] = new OpenLayers.Icon( - STATIC_URL + "saclay/images/cluster_icon.png", - new OpenLayers.Size(39, 46), - new OpenLayers.Pixel(-(39/2), -(46/2))); - chimere_init_options["category_plus"] = STATIC_URL + "saclay/images/plus.png"; - chimere_init_options["category_minus"] = STATIC_URL + "saclay/images/minus.png"; - chimere_init_options["popupClass"] = OpenLayers.Popup.SaclayCloud; - chimere_init_options["popupClass"].imageSrc = "{{STATIC_URL}}/saclay/js/cloud-popup-saclay.png"; - chimere_init_options["popupContentFull"] = true; - chimere_init_options["explicit_popup_hide"] = true; - chimere_init_options["edition_type_is_route"] = true; - chimere_init_options["display_feature_detail_fx"] = display_feature_detail; - + var chimere_init_options = { + {% if MOBILE %}"mobile": true,{% endif %} + {% if enable_clustering %}"enable_clustering": true,{% endif %} + "routing_panel_open": routing_panel_open, + "category_accordion": false, + "category_plus": STATIC_URL + "saclay/images/plus.png", + "category_minus": STATIC_URL + "saclay/images/minus.png", + "popupContentFull": true, + "explicit_popup_hide": true, + "map_layers": [{{js_map_layers|safe|escape}}], + 'permalink_label': '{%trans "Permalink"%}', + 'permalink_element': document.getElementById('permalink'), + 'routing': {{routing}}, + {% if dynamic_categories %}'dynamic_categories': true,{% endif %} + {% if default_area %}"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 %}"zoom": {{ p_zoom }},{% endif %} + {% if p_lat %}"lat": {{ p_lat }},{% endif %} + {% if p_lon %}"lon": {{ p_lon }},{% endif %} + {% if p_routing_start_lon %}"routing_start_lon": {{ p_routing_start_lon }},{% endif %} + {% if p_routing_start_lat %}"routing_start_lat": {{ p_routing_start_lat }},{% endif %} + {% if p_routing_end_lon %}"routing_end_lon": {{ p_routing_end_lon }},{% endif %} + {% if p_routing_end_lat %}"routing_end_lat": {{ p_routing_end_lat }},{% endif %} + {% if p_routing_steps %}"routing_steps_lonlat": [{{ p_routing_steps }}],{% endif %} + {% if p_routing_transport %}"routing_transport": "{{ p_routing_transport }}",{% endif %} + {% if p_routing_speed %}"routing_speed": "{{ p_routing_speed }}",{% endif %} + "dynamic_categories": {{ dynamic_categories }}, + {% if p_display_submited %}"display_submited": {{ p_display_submited }},{% endif %} + "checked_categories": [{% for cc in checked_categories %}{% if forloop.counter0 > 0 %}, {% endif %}{{cc}}{% endfor %}], + {% if area_id %}'area_id': "{{area_id}}",{% endif %} + {% if p_current_feature %}"display_feature": {{ p_current_feature }},{% endif %} + {% if selected_map_layer %}"selected_map_layer": {{selected_map_layer}},{% endif %} + "edition_type_is_route": true + } + {% if restricted_extent %}{{ restricted_extent }} + chimere_init_options["restricted_extent"] = bounds; + {% endif %} + {% comment %} chimere_init_options["default_icon"] = new OpenLayers.Icon( '{{STATIC_URL}}saclay/images/default_icon.png', new OpenLayers.Size(37, 42), @@ -97,6 +110,7 @@ $(function(){ '{{STATIC_URL}}saclay/images/routing_step.png', new OpenLayers.Size(37, 42), new OpenLayers.Pixel(-(37/2), -42)); + }; var numZoomLevels = 7; var maxZoomLevel = 19; var resolutions; @@ -111,40 +125,18 @@ $(function(){ zoomOffset = minZoomLevel; } - 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 %} - {% if p_routing_transport %}chimere_init_options["routing_transport"] = "{{ p_routing_transport }}";{% endif %} - {% if p_routing_speed %}chimere_init_options["routing_speed"] = "{{ p_routing_speed }}";{% endif %} - chimere_init_options["icon_offset"] = new OpenLayers.Pixel({{icon_offset_x}}, - {{icon_offset_y}}); - chimere_init_options['marker_hover_offset'] = new OpenLayers.Pixel(7, 20); - 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 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 %} + "icon_offset": new OpenLayers.Pixel({{icon_offset_x}}, + {{icon_offset_y}}), + 'marker_hover_offset': new OpenLayers.Pixel(7, 20), + "popupClass": OpenLayers.Popup.SaclayCloud, + "popupClass"].imageSrc = "{{STATIC_URL}}/saclay/js/cloud-popup-saclay.png", + "cluster_icon": new OpenLayers.Icon( + STATIC_URL + "saclay/images/cluster_icon.png", + new OpenLayers.Size(39, 46), + new OpenLayers.Pixel(-(39/2), -(46/2))), + //"display_feature_detail_fx": display_feature_detail, + {% endcomment %} + $("#{{map_id}}").chimere(chimere_init_options); {% if zoom %} $('#maps').chimere('zoom', {'area':{{zoom}} }); @@ -184,7 +176,6 @@ $(function(){ } }); }); - // --> </script> <div id='marker_hover'><div id='marker_hover_content'></div></div> <div id='cluster_list'></div> diff --git a/templates/chimere/blocks/news.html b/templates/chimere/blocks/news.html index 3788b64..0bc04a1 100644 --- a/templates/chimere/blocks/news.html +++ b/templates/chimere/blocks/news.html @@ -2,9 +2,9 @@ <script type='text/javascript'> <!-- $(function(){ - $('#news div.media-player').jmeEmbedControls(); + /*$('#news div.media-player').jmeEmbedControls(); $('#news video').each(function(index){$(this).pause()}); - $('#news audio').each(function(index){$(this).pause()}); + $('#news audio').each(function(index){$(this).pause()});*/ $("#news").dialog({width:630, dialogClass:'no-titlebar', autoOpen:false}); }); diff --git a/templates/chimere/blocks/welcome.html b/templates/chimere/blocks/welcome.html index ae83180..a70e92f 100644 --- a/templates/chimere/blocks/welcome.html +++ b/templates/chimere/blocks/welcome.html @@ -3,9 +3,10 @@ <script type='text/javascript'> <!-- $(function(){ + /* $('#welcome div.media-player').jmeEmbedControls(); $('#welcome video').each(function(index){$(this).pause()}); - $('#welcome audio').each(function(index){$(this).pause()}); + $('#welcome audio').each(function(index){$(this).pause()});*/ $("#welcome").dialog({width:826, height:410, dialogClass:'welcome-dialog' {% if not display %}, autoOpen:false{% endif %}}); }); diff --git a/templates/chimere/detail.html b/templates/chimere/detail.html index 4d9348b..4397f5f 100644 --- a/templates/chimere/detail.html +++ b/templates/chimere/detail.html @@ -52,7 +52,7 @@ $('html').addClass('js-on'); $(function(){ $("#gallery-{{marker.pk}}").dialog({title:"{{marker.name}}", autoOpen: false, height: "auto", width: "auto", dialogClass:'no-titlebar'}); - $('div.media-player').jmeEmbedControls(); + /* $('div.media-player').jmeEmbedControls(); $('.tabs').tabs({ select: function(event, ui) { //pause all medias @@ -76,6 +76,7 @@ $(function(){ }).bind('userinactive', function(){ $('div.media-controls', this).stop().animate({opacity: 0}); }); + */ }); $("#gallery-{{marker.pk}}").bind( "dialogopen", function(event, ui) { $("#gallery-{{marker.pk}}").dialog("option", "height", 'auto'); @@ -24,31 +24,34 @@ from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns admin.autodiscover() -urlpatterns = patterns('django.views.static', +urlpatterns = patterns( + 'django.views.static', (r'^%s(?P<path>.*)' % settings.MEDIA_URL[1:], 'serve', {'document_root': settings.MEDIA_ROOT}), ) urlpatterns += staticfiles_urlpatterns() -urlpatterns += patterns('', +urlpatterns += patterns( + '', (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^admin/', include(admin.site.urls)), url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit/$', 'chimere_saclay.views.edit', name="edit"), - url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit/(?P<item_id>\w+)/(?P<submited>\w+)?$', - 'chimere_saclay.views.edit', name="edit-item"), + url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit/(?P<item_id>\w+)/' + r'(?P<submited>\w+)?$', + 'chimere_saclay.views.edit', name="edit-item"), url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-event/$', - 'chimere_saclay.views.edit', name="edit-event", kwargs={'event':True}), - url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-event/(?P<item_id>\w+)/(?P<submited>\w+)?$', - 'chimere_saclay.views.edit', kwargs={'event':True}, - name="edit-event-item"), + 'chimere_saclay.views.edit', name="edit-event", + kwargs={'event': True}), + url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-event/(?P<item_id>\w+)/' + r'(?P<submited>\w+)?$', 'chimere_saclay.views.edit', + kwargs={'event': True}, name="edit-event-item"), url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-route/$', 'chimere_saclay.views.edit_route', name="edit-route"), - url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-route/(?P<item_id>\w+)/(?P<submited>\w+)?$', - 'chimere_saclay.views.edit_route', name="edit-route-item"), + url(r'^(?P<area_name>[a-zA-Z0-9_-]+/)?edit-route/(?P<item_id>\w+)/' + r'(?P<submited>\w+)?$', 'chimere_saclay.views.edit_route', + name="edit-route-item"), url(r'^(saclay/)?$', 'chimere_saclay.views.index_saclay', name="index-saclay"), url(r'^', include('chimere.urls', namespace="chimere")), ) - - |