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