2009-05-17 11:34:55 +00:00
|
|
|
# vim: set fileencoding=utf-8
|
|
|
|
|
2013-12-29 02:59:14 +00:00
|
|
|
from django.conf.urls import *
|
2016-07-26 21:08:23 +00:00
|
|
|
from .views import *
|
|
|
|
from .page.views import page, langpage
|
2014-09-14 14:51:29 +00:00
|
|
|
|
|
|
|
urlpatterns = patterns(
|
|
|
|
'',
|
2009-05-17 11:34:55 +00:00
|
|
|
url(r'^$',
|
2014-09-14 14:51:29 +00:00
|
|
|
questionnaire, name='questionnaire_noargs'),
|
2012-02-21 12:37:45 +00:00
|
|
|
url(r'^csv/(?P<qid>\d+)/$',
|
2014-09-14 14:51:29 +00:00
|
|
|
export_csv, name='export_csv'),
|
|
|
|
url(r'^(?P<runcode>[^/]+)/progress/$',
|
|
|
|
get_async_progress, name='progress'),
|
2016-07-26 21:08:23 +00:00
|
|
|
url(r'^take/(?P<questionnaire_id>[0-9]+)/$', generate_run),
|
|
|
|
url(r'^$', page, {'page_to_render' : 'index'}),
|
|
|
|
url(r'^(?P<page_to_render>.*)\.html$', page),
|
|
|
|
url(r'^(?P<lang>..)/(?P<page_to_trans>.*)\.html$', langpage),
|
|
|
|
url(r'^setlang/$', set_language),
|
|
|
|
url(r'^landing/(?P<nonce>\w+)/$', SurveyView.as_view(), name="landing"),
|
|
|
|
url(r'^(?P<runcode>[^/]+)/(?P<qs>[-]{0,1}\d+)/$',
|
|
|
|
questionnaire, name='questionset'),
|
|
|
|
url(r'^q/manage/csv/(\d+)/',
|
|
|
|
export_csv, name="export_csv"),
|
2014-09-14 14:51:29 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if not use_session:
|
|
|
|
urlpatterns += patterns(
|
|
|
|
'',
|
|
|
|
url(r'^(?P<runcode>[^/]+)/$',
|
2009-05-17 11:34:55 +00:00
|
|
|
questionnaire, name='questionnaire'),
|
2015-12-02 23:41:59 +00:00
|
|
|
url(r'^(?P<runcode>[^/]+)/(?P<qs>[-]{0,1}\d+)/prev/$',
|
|
|
|
redirect_to_prev_questionnaire,
|
|
|
|
name='redirect_to_prev_questionnaire'),
|
2014-09-14 14:51:29 +00:00
|
|
|
)
|
|
|
|
else:
|
|
|
|
urlpatterns += patterns(
|
|
|
|
'',
|
|
|
|
url(r'^$',
|
|
|
|
questionnaire, name='questionnaire'),
|
2014-09-14 15:36:08 +00:00
|
|
|
url(r'^prev/$',
|
|
|
|
redirect_to_prev_questionnaire,
|
|
|
|
name='redirect_to_prev_questionnaire')
|
2014-09-14 14:51:29 +00:00
|
|
|
)
|