Commit c0d435a2 authored by Stauros Kroustouris's avatar Stauros Kroustouris

fix broken links

parent 7189cd8a
......@@ -23,7 +23,7 @@
<input class='search' type="search" name='tag' placeholder="insert tag..." value="{{ filter }}">
<input type="submit" value="Filter">
</form>
<a href='{% url pops:default %}'><i class='fa fa-home fa-2x'></i></a>
<a href='{% url pops:view %}'><i class='fa fa-home fa-2x'></i></a>
</div>
<div class="locations-details ">
<h3></h3>
......
......@@ -5,8 +5,7 @@ from pops.views import pops_views
urlpatterns = patterns(
'',
url(r'^(?P<view>.+)/(?P<city>.+)/(?P<location>.+)$', pops_views.map_view, name='view'),
url(r'^(?P<view>.+)/(?P<city>.+)/$', pops_views.map_view, name='view'),
url(r'^(?P<view>.+)/$', pops_views.map_view, name='view'),
url(r'^$', pops_views.map_view, name='default'),
url(r'^(?P<city>.+)/(?P<location>.+)$', pops_views.map_view, name='view'),
url(r'^(?P<city>.+)/$', pops_views.map_view, name='view'),
url(r'^$', pops_views.map_view, name='view'),
)
......@@ -6,7 +6,8 @@ from django.core.urlresolvers import reverse, NoReverseMatch
# view should be the name of the url from the rest api
def map_view(request, view='pops', city=None, location=None):
if view:
try:
# try:
# raise Exception
if city:
if location:
url = reverse('api:' + view, args=(city, location,))
......@@ -14,8 +15,8 @@ def map_view(request, view='pops', city=None, location=None):
url = reverse('api:' + view, args=(city,))
else:
url = reverse('api:' + view)
except NoReverseMatch:
raise Http404
# except NoReverseMatch:
# raise Http404
if request.GET.get('tag'):
return render(request, 'pops/map.html', {'view': '%s?tag=%s' % (url, request.GET.get('tag')), 'filter': request.GET.get('tag')})
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment