From 8ce41032c5822dcda911bc036018a28527efb7a7 Mon Sep 17 00:00:00 2001 From: Sanj Date: Tue, 14 Aug 2012 19:37:26 +0530 Subject: [PATCH] /edit/ should work --- openmumbai/places/static/js/edit.js | 5 +++-- openmumbai/places/views.py | 7 ++++++- openmumbai/templates/edit.html | 2 +- openmumbai/urls.py | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/openmumbai/places/static/js/edit.js b/openmumbai/places/static/js/edit.js index 07997f4..0b8f05f 100644 --- a/openmumbai/places/static/js/edit.js +++ b/openmumbai/places/static/js/edit.js @@ -150,7 +150,7 @@ map.addLayer(drawnItems); var wmsLayers = {}; wmsLayers['Test Warped Map'] = L.tileLayer.wms("http://mapwarper.net/maps/wms/336", { 'format': 'image/png' -});//.addTo(map); +}).addTo(map); var baseLayers = { 'OpenStreetMap': cloudmade, @@ -236,8 +236,9 @@ $(function() { var val = $(this).val(); for (wmsLayer in wmsLayers) { if (wmsLayers.hasOwnProperty(wmsLayer)) { - wmsLayers[wmsLayer].setOpacity(val / 10); + wmsLayers[wmsLayer].setOpacity(val); } } }); + }); diff --git a/openmumbai/places/views.py b/openmumbai/places/views.py index 9474742..b788fd6 100644 --- a/openmumbai/places/views.py +++ b/openmumbai/places/views.py @@ -9,11 +9,16 @@ def index(request): def edit(request, ctype_id): ctypes = [] - content_type_id = int(ctype_id) + for c in ContentType.objects.all(): if hasattr(c.model_class(), 'is_openmumbai_model'): ctypes.append(c) + try: + content_type_id = int(ctype_id) + except: + content_type_id = ctypes[0].id + context = RequestContext(request, { 'ctypes': ctypes, 'content_type_id': content_type_id diff --git a/openmumbai/templates/edit.html b/openmumbai/templates/edit.html index 7db88b5..c9563bf 100644 --- a/openmumbai/templates/edit.html +++ b/openmumbai/templates/edit.html @@ -53,7 +53,7 @@ CONTENT_TYPE_ID = {{ content_type_id }}; {% endfor %}
- Overlay Opacity: + Overlay Opacity:
diff --git a/openmumbai/urls.py b/openmumbai/urls.py index 1f35d43..fbacd53 100644 --- a/openmumbai/urls.py +++ b/openmumbai/urls.py @@ -15,7 +15,7 @@ urlpatterns = patterns('', # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^$', 'places.views.index', name='index'), url(r'^geojson/(?P[0-9]+)$', 'base.views.geojson', name='geojson'), - url(r'^edit/(?P[0-9]+)$', 'places.views.edit', name='edit'), + url(r'^edit/(?P[0-9]*)$', 'places.views.edit', name='edit'), # Uncomment the next line to enable the admin: url(r'^admin/', include(admin.site.urls)), )