Browse Source

/edit/ should work

master
Sanj 12 years ago
parent
commit
8ce41032c5
  1. 5
      openmumbai/places/static/js/edit.js
  2. 7
      openmumbai/places/views.py
  3. 2
      openmumbai/templates/edit.html
  4. 2
      openmumbai/urls.py

5
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);
}
}
});
});

7
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

2
openmumbai/templates/edit.html

@ -53,7 +53,7 @@ CONTENT_TYPE_ID = {{ content_type_id }};
</option>
{% endfor %}
</select> <br />
Overlay Opacity: <input type="range" min="0" max="10" value="10" id="opacityRange" />
Overlay Opacity: <input type="range" min="0" max="1" step="0.1" value="1" id="opacityRange" />
<ul id="itemsList">
</ul>
<div id="itemInfo">

2
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<ctype_id>[0-9]+)$', 'base.views.geojson', name='geojson'),
url(r'^edit/(?P<ctype_id>[0-9]+)$', 'places.views.edit', name='edit'),
url(r'^edit/(?P<ctype_id>[0-9]*)$', 'places.views.edit', name='edit'),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)

Loading…
Cancel
Save