2011-07-31 10:46:29 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
openslides.urls
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Global URL list for OpenSlides.
|
|
|
|
|
2012-04-25 22:29:19 +02:00
|
|
|
:copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
|
2011-07-31 10:46:29 +02:00
|
|
|
:license: GNU GPL, see LICENSE for more details.
|
|
|
|
"""
|
|
|
|
|
|
|
|
from django.conf import settings
|
2012-07-10 14:00:51 +02:00
|
|
|
from django.conf.urls.defaults import patterns, url, include
|
2012-07-16 18:13:53 +02:00
|
|
|
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
2012-07-01 16:56:01 +02:00
|
|
|
from django.shortcuts import redirect
|
2012-07-10 14:00:51 +02:00
|
|
|
from django.utils.importlib import import_module
|
2011-07-31 10:46:29 +02:00
|
|
|
|
2012-07-01 16:56:01 +02:00
|
|
|
from openslides.utils.views import FrontPage
|
2012-04-15 11:24:40 +02:00
|
|
|
|
2012-07-18 10:46:07 +02:00
|
|
|
|
2011-09-03 19:16:43 +02:00
|
|
|
handler500 = 'openslides.utils.views.server_error'
|
2011-07-31 10:46:29 +02:00
|
|
|
|
|
|
|
urlpatterns = patterns('',
|
2012-02-20 14:50:42 +01:00
|
|
|
# frontpage
|
2012-04-15 11:24:40 +02:00
|
|
|
(r'^$', FrontPage.as_view()),
|
2012-02-20 14:50:42 +01:00
|
|
|
|
2012-07-10 14:00:51 +02:00
|
|
|
(r'^agenda/', include('openslides.agenda.urls')),
|
|
|
|
(r'^application/', include('openslides.application.urls')),
|
|
|
|
(r'^assignment/', include('openslides.assignment.urls')),
|
|
|
|
(r'^participant/', include('openslides.participant.urls')),
|
|
|
|
(r'^config/', include('openslides.config.urls')),
|
|
|
|
(r'^projector/', include('openslides.projector.urls')),
|
2011-07-31 10:46:29 +02:00
|
|
|
(r'^i18n/', include('django.conf.urls.i18n')),
|
|
|
|
)
|
2011-09-03 19:16:43 +02:00
|
|
|
|
2012-07-16 18:13:53 +02:00
|
|
|
urlpatterns += patterns('django.contrib.staticfiles.views',
|
|
|
|
url(r'^static/(?P<path>.*)$', 'serve', {'insecure':True}),
|
|
|
|
)
|
|
|
|
|
2012-04-16 11:12:21 +02:00
|
|
|
js_info_dict = {
|
|
|
|
'packages': [],
|
|
|
|
}
|
|
|
|
|
2012-04-13 14:05:51 +02:00
|
|
|
for plugin in settings.INSTALLED_PLUGINS:
|
|
|
|
try:
|
|
|
|
mod = import_module(plugin + '.urls')
|
2012-04-13 16:47:40 +02:00
|
|
|
except ImportError, err:
|
2012-04-13 14:05:51 +02:00
|
|
|
continue
|
|
|
|
|
|
|
|
plugin_name = mod.__name__.split('.')[0]
|
2012-07-10 14:00:51 +02:00
|
|
|
urlpatterns += patterns('', (r'^%s/' % plugin_name, include('%s.urls'
|
|
|
|
% plugin_name)))
|
2012-04-16 11:12:21 +02:00
|
|
|
js_info_dict['packages'].append(plugin_name)
|
2012-04-13 14:05:51 +02:00
|
|
|
|
2011-09-03 19:16:43 +02:00
|
|
|
|
|
|
|
urlpatterns += patterns('',
|
2012-04-16 11:12:21 +02:00
|
|
|
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
|
2012-04-14 09:42:30 +02:00
|
|
|
|
|
|
|
url(r'^login/$',
|
2012-07-18 10:46:07 +02:00
|
|
|
'openslides.participant.views.login',
|
2012-04-14 09:42:30 +02:00
|
|
|
name='user_login',
|
|
|
|
),
|
|
|
|
|
|
|
|
url(r'^logout/$',
|
|
|
|
'django.contrib.auth.views.logout_then_login',
|
|
|
|
name='user_logout',
|
2012-05-20 22:34:41 +02:00
|
|
|
),
|
|
|
|
|
2012-07-01 16:56:01 +02:00
|
|
|
url(r'^usersettings/$',
|
2012-07-10 14:00:51 +02:00
|
|
|
'openslides.participant.views.user_settings',
|
2012-05-20 22:34:41 +02:00
|
|
|
name='user_settings',
|
|
|
|
),
|
|
|
|
|
2012-07-01 16:56:01 +02:00
|
|
|
url(r'^usersettings/changepassword/$',
|
2012-07-11 09:46:15 +02:00
|
|
|
'openslides.participant.views.user_settings_password',
|
2012-07-01 16:56:01 +02:00
|
|
|
name='password_change',
|
|
|
|
),
|
2011-09-03 19:16:43 +02:00
|
|
|
)
|