Commit c21e91f4 authored by alexandre's avatar alexandre

Fixed on-the-fly page creation

parent 3c3a7214
......@@ -107,13 +107,7 @@
<div class="main-area">
<div id="timeline"></div>
<article id="canvas" class="anonymous">
{% for annotation in object.annotation_set.all %}
{{ annotation.body|markdownify }}
{% endfor %}
<article id="canvas" class="anonymous"></article>
<div class="error">
......@@ -3,10 +3,8 @@
from django.conf.urls import include, patterns, url
from tastypie.api import Api
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from olga.api import SiteResource, PageResource, AnnotationResource, UserResource
from django.views.generic import RedirectView
from olga.models import Page
v1_api = Api(api_name='v1')
......@@ -14,16 +12,13 @@ v1_api.register(AnnotationResource())
urlpatterns = patterns('',
url(r'^api/v1/user/me/', ''),
url(r'^api/', include(v1_api.urls)),
url(r'^tests/$', TemplateView.as_view(template_name='olga/tests.html'), name='tests'),
# The following route should: A) catch everything so that the real routing can be left to Backbone
# B) still allow for a reverse url from the pages model (that’s why the ‘slug’ match group is still there)
# We use a DetailView instead of a more simple TemplateView (as before) in
# order to serve the annotations content in case javascript is disabled
# (SEO).
url(r'pages/(?P<slug>[^/]+)', DetailView.as_view(template_name='olga/page_detail.html', model=Page), name='page-detail'),
url(r'pages/(?P<slug>[^/]+)', TemplateView.as_view(template_name='olga/page_detail.html'), name='page-detail'),
url(r'^$', RedirectView.as_view(url='pages/Index'), name='home'),
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment