Fix some locale problems.
[wolnelektury.git] / wolnelektury / urls.py
1 # -*- coding: utf-8 -*-
2 import os
3
4 from django.conf.urls.defaults import *
5 from django.conf import settings
6 from django.contrib import admin
7 from django.views.generic import RedirectView
8 import wolnelektury_core.views
9
10
11 admin.autodiscover()
12
13 urlpatterns = patterns('wolnelektury_core.views',
14     url(r'^$', 'main_page', name='main_page'),
15     url(r'^planowane/$', 'publish_plan', name='publish_plan'),
16
17     url(r'^zegar/$', 'clock', name='clock'),
18
19     # Authentication
20     url(r'^uzytkownik/$', 'user_settings', name='user_settings'),
21     url(r'^uzytkownik/login/$', wolnelektury_core.views.LoginFormView(), name='login'),
22     url(r'^uzytkownik/signup/$', wolnelektury_core.views.RegisterFormView(), name='register'),
23     url(r'^uzytkownik/logout/$', 'logout_then_redirect', name='logout'),
24     url(r'^uzytkownik/zaloguj-utworz/$', wolnelektury_core.views.LoginRegisterFormView(), name='login_register'),
25 )
26
27 urlpatterns += patterns('',
28     url(r'^katalog/', include('catalogue.urls')),
29     url(r'^opds/', include('opds.urls')),
30     url(r'^sugestia/', include('suggest.urls')),
31     url(r'^lesmianator/', include('lesmianator.urls')),
32     url(r'^przypisy/', include('dictionary.urls')),
33     url(r'^raporty/', include('reporting.urls')),
34     url(r'^info/', include('infopages.urls')),
35     url(r'^ludzie/', include('social.urls')),
36     url(r'^uzytkownik/', include('allauth.urls')),
37     url(r'^czekaj/', include('waiter.urls')),
38     url(r'^biblioteki', include('libraries.urls')),
39
40     # Admin panel
41     url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
42     url(r'^admin/catalogue/picture/import$', 'picture.views.import_picture', name='import_picture'),
43     url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
44     url(r'^admin/', include(admin.site.urls)),
45
46     # API
47     (r'^api/', include('api.urls')),
48     # OAIPMH
49     (r'^oaipmh/', include('oai.urls')),
50
51     url(r'^szukaj/', include('search.urls')),
52
53     # Static files
54     url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve',
55         {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
56     url(r'^%s(?P<path>.*)$' % settings.STATIC_URL[1:], 'django.views.static.serve',
57         {'document_root': settings.STATIC_ROOT, 'show_indexes': True}),
58     url(r'^i18n/', include('django.conf.urls.i18n')),
59 )
60
61 urlpatterns += patterns('',
62     # old static pages - redirected
63     url(r'^1procent/$', RedirectView.as_view(
64         url='http://nowoczesnapolska.org.pl/wesprzyj_nas/')),
65     url(r'^epub/$', RedirectView.as_view(
66         url='/katalog/lektury/')),
67     url(r'^mozesz-nam-pomoc/$', RedirectView.as_view(
68         url='/info/mozesz-nam-pomoc')),
69     url(r'^o-projekcie/$', RedirectView.as_view(
70         url='/info/o-projekcie')),
71     url(r'^widget/$', RedirectView.as_view(
72         url='/info/widget')),
73     url(r'^wolontariat/$', RedirectView.as_view(
74         url='/info/mozesz-nam-pomoc/')),
75 )
76     
77
78 if 'rosetta' in settings.INSTALLED_APPS:
79     urlpatterns += patterns('',
80         url(r'^rosetta/', include('rosetta.urls')),
81     )