2763fec34648b90f50f0bdeb8f06bda0734b1b5e
[mygpo.git] / mygpo / web / urls.py
blob2763fec34648b90f50f0bdeb8f06bda0734b1b5e
1 from django.conf.urls.defaults import *
2 from registration.views import activate, register
3 from registration.forms import RegistrationFormUniqueEmail
4 from registration.backends import default
5 from django.contrib.auth.views import logout
6 from django.views.generic.simple import direct_to_template
8 urlpatterns = patterns('mygpo.web.views',
9 url(r'^$', 'home', name='home'),
10 (r'^media/logo/(?P<size>\d+)/(?P<filename>[^/]*)\.jpg$', 'cover_art'),
11 (r'^logo/(?P<size>\d+)/(?P<filename>[^/]*)\.jpg$', 'cover_art'),
12 url(r'^history/$', 'history', name='history'),
13 url(r'^suggestions/$', 'suggestions', name='suggestions'),
14 url(r'^tags/', 'mytags', name='tags'),
15 url(r'^online-help', direct_to_template,
16 {'template': 'online-help.html'}, name='help'),
19 urlpatterns += patterns('mygpo.web.views.subscriptions',
20 url(r'^subscriptions/$', 'list', name='subscriptions'),
21 (r'^download/subscriptions\.opml$', 'download_all'),
22 url(r'^subscriptions/all.opml$', 'download_all', name='subscriptions-download'),
23 url(r'^user/(?P<username>\w+)/subscriptions$', 'for_user', name='shared-subscriptions'),
24 url(r'^user/(?P<username>\w+)/subscriptions\.opml$', 'for_user_opml', name='shared-subscriptions-opml'),
27 urlpatterns += patterns('mygpo.web.views.podcast',
28 url(r'^podcast/(?P<pid>\w+)$', 'show', name='podcast'),
29 url(r'^subscribe', 'subscribe_url', name='subscribe-by-url'),
30 url(r'^podcast/(?P<pid>\w+)/subscribe$', 'subscribe', name='subscribe'),
31 url(r'^podcast/(?P<pid>\w+)/unsubscribe/(?P<device_id>\d+)', 'unsubscribe', name='unsubscribe'),
32 url(r'^podcast/(?P<pid>\w+)/add-tag', 'add_tag', name='add-tag'),
33 url(r'^podcast/(?P<pid>\w+)/remove-tag', 'remove_tag', name='remove-tag'),
36 urlpatterns += patterns('mygpo.web.views.episode',
37 url(r'^episode/(?P<id>\d+)$', 'episode', name='episode'),
38 url(r'^episode/(?P<id>\d+)/add-chapter$', 'add_chapter', name='add-chapter'),
39 url(r'^episode/(?P<id>\d+)/remove-chapter/(?P<chapter_id>\d+)$', 'remove_chapter',name='remove-chapter'),
40 url(r'^episode/(?P<id>\d+)/toggle-favorite', 'toggle_favorite',name='episode-fav'),
41 url(r'^favorites/', 'list_favorites',name='favorites'),
44 urlpatterns += patterns('mygpo.web.views.settings',
45 url(r'^account/$', 'account', name='account'),
46 url(r'^account/privacy$', 'privacy', name='privacy'),
47 url(r'^account/delete$', 'delete_account',name='delete-account'),
48 url(r'^share/$', 'share', name='share'),
51 urlpatterns += patterns('mygpo.web.views.public',
52 url(r'^directory/$', 'browse', name='directory-home'),
53 url(r'^directory/(?P<category>[^/]+)$', 'category', name='directory'),
54 url(r'^toplist/$', 'toplist', name='toplist'),
55 url(r'^toplist/episodes$', 'episode_toplist', name='episode-toplist'),
56 (r'^gpodder-examples.opml$', 'gpodder_example_podcasts'),
59 urlpatterns += patterns('mygpo.web.views.device',
60 url(r'^devices/$', 'overview', name='devices'),
61 url(r'^device/(?P<device_id>\d+)$', 'show', name='device'),
62 url(r'^device/(?P<device_id>\d+).opml$', 'opml', name='device-opml'),
63 url(r'^device/(?P<device_id>\d+)/sync$', 'sync', name='device-sync'),
64 url(r'^device/(?P<device_id>\d+)/unsync$', 'unsync', name='device-unsync'),
65 url(r'^device/(?P<device_id>\d+)/delete$', 'delete', name='device-delete'),
66 url(r'^device/(?P<device_id>\d+)/remove$', 'delete_permanently', name='device-delete-permanently'),
67 url(r'^device/(?P<device_id>\d+)/undelete$', 'undelete', name='device-undelete'),
68 url(r'^device/(?P<device_id>\d+)/history$', 'history', name='device-history'),
69 url(r'^device/(?P<device_id>\d+)/edit$', 'edit', name='device-edit'),
72 urlpatterns += patterns('mygpo.web.views.users',
73 url(r'^login/$', 'login_user', name='login'),
74 url(r'^logout/$', logout, {'next_page': '/'}, name='logout'),
75 url(r'^migrate/$', 'migrate_user', name='migrate-user'),
76 url(r'^register/resend-activation$', 'resend_activation', name='resend-activation'),
77 url(r'^register/restore_password$', 'restore_password', name='restore-password'),
78 url(r'^register/$', register,
79 {'backend': 'registration.backends.default.DefaultBackend',
80 'form_class': RegistrationFormUniqueEmail}, name='register'),
81 (r'^registration_complete/$', direct_to_template,
82 {'template': 'registration/registration_complete.html'}),
83 (r'^activate/(?P<activation_key>\w+)$', activate,
84 {'backend': 'registration.backends.default.DefaultBackend'}),