/edit/ should work

This commit is contained in:
Sanj 2012-08-14 19:37:26 +05:30
parent 71d4a919b2
commit 8ce41032c5
4 changed files with 11 additions and 5 deletions

View File

@ -150,7 +150,7 @@ map.addLayer(drawnItems);
var wmsLayers = {}; var wmsLayers = {};
wmsLayers['Test Warped Map'] = L.tileLayer.wms("http://mapwarper.net/maps/wms/336", { wmsLayers['Test Warped Map'] = L.tileLayer.wms("http://mapwarper.net/maps/wms/336", {
'format': 'image/png' 'format': 'image/png'
});//.addTo(map); }).addTo(map);
var baseLayers = { var baseLayers = {
'OpenStreetMap': cloudmade, 'OpenStreetMap': cloudmade,
@ -236,8 +236,9 @@ $(function() {
var val = $(this).val(); var val = $(this).val();
for (wmsLayer in wmsLayers) { for (wmsLayer in wmsLayers) {
if (wmsLayers.hasOwnProperty(wmsLayer)) { if (wmsLayers.hasOwnProperty(wmsLayer)) {
wmsLayers[wmsLayer].setOpacity(val / 10); wmsLayers[wmsLayer].setOpacity(val);
} }
} }
}); });
}); });

View File

@ -9,11 +9,16 @@ def index(request):
def edit(request, ctype_id): def edit(request, ctype_id):
ctypes = [] ctypes = []
content_type_id = int(ctype_id)
for c in ContentType.objects.all(): for c in ContentType.objects.all():
if hasattr(c.model_class(), 'is_openmumbai_model'): if hasattr(c.model_class(), 'is_openmumbai_model'):
ctypes.append(c) ctypes.append(c)
try:
content_type_id = int(ctype_id)
except:
content_type_id = ctypes[0].id
context = RequestContext(request, { context = RequestContext(request, {
'ctypes': ctypes, 'ctypes': ctypes,
'content_type_id': content_type_id 'content_type_id': content_type_id

View File

@ -53,7 +53,7 @@ CONTENT_TYPE_ID = {{ content_type_id }};
</option> </option>
{% endfor %} {% endfor %}
</select> <br /> </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 id="itemsList">
</ul> </ul>
<div id="itemInfo"> <div id="itemInfo">

View File

@ -15,7 +15,7 @@ urlpatterns = patterns('',
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^$', 'places.views.index', name='index'), url(r'^$', 'places.views.index', name='index'),
url(r'^geojson/(?P<ctype_id>[0-9]+)$', 'base.views.geojson', name='geojson'), 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: # Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
) )