fix links for blacklisting suggestions
[mygpo.git] / mygpo / web / urls.py
blob4a8444e78e754e9aa95cb8c4f42128456efc1a89
1 from django.conf.urls.defaults import *
2 from django.contrib.auth.views import logout
3 from django.views.generic.simple import direct_to_template
5 from django_couchdb_utils.registration.views import activate, register
6 from django_couchdb_utils.registration.forms import RegistrationFormUniqueEmail
8 from mygpo.web.logo import CoverArt
11 urlpatterns = patterns('mygpo.web.views',
12 url(r'^$', 'home', name='home'),
13 url(r'^logo/(?P<size>\d+)/(?P<prefix>.{3})/(?P<filename>[^/]*)$', CoverArt.as_view(), name='logo'),
14 url(r'^history/$', 'history', name='history'),
15 url(r'^suggestions/$', 'suggestions', name='suggestions'),
16 url(r'^suggestions/rate$', 'rate_suggestions', name='suggestions-rate'),
17 url(r'^suggestions/blacklist/(?P<slug_id>[\w-]+)$', 'blacklist', name='suggestions-blacklist-slug-id'),
18 url(r'^tags/', 'mytags', name='tags'),
19 url(r'^online-help', direct_to_template,
20 {'template': 'online-help.html'}, name='help'),
21 (r'^developer/', direct_to_template,
22 {'template': 'developer.html'}),
23 url(r'^contribute/', direct_to_template,
24 {'template': 'contribute.html'},
25 name='contribute'),
26 url(r'^privacy/', direct_to_template,
27 {'template': 'privacy_policy.html'}, name='privacy-policy'),
31 urlpatterns += patterns('mygpo.web.views.subscriptions',
32 url(r'^subscriptions/$', 'show_list', name='subscriptions'),
33 url(r'^download/subscriptions\.opml$', 'download_all', name='subscriptions-opml'),
34 url(r'^subscriptions/all.opml$', 'download_all', name='subscriptions-download'),
35 url(r'^user/(?P<username>[\w.-]+)/subscriptions$', 'for_user', name='shared-subscriptions'),
36 url(r'^user/(?P<username>[\w.-]+)/subscriptions\.opml$', 'for_user_opml', name='shared-subscriptions-opml'),
37 url(r'^user/(?P<username>[\w.-]+)/subscriptions/rss/$', 'subscriptions_feed', name='shared-subscriptions-rss'),
40 urlpatterns += patterns('mygpo.web.views.podcast',
41 url(r'^subscribe', 'subscribe_url', name='subscribe-by-url'),
43 url(r'^podcast/(?P<pid>\d+)$', 'show_oldid', name='podcast'),
44 url(r'^podcast/(?P<pid>\d+)/subscribe$', 'subscribe_oldid', name='subscribe'),
45 url(r'^podcast/(?P<pid>\d+)/unsubscribe/(?P<device_uid>[\w.-]+)', 'unsubscribe_oldid', name='unsubscribe'),
46 url(r'^podcast/(?P<pid>\d+)/add-tag', 'add_tag_oldid', name='add-tag'),
47 url(r'^podcast/(?P<pid>\d+)/remove-tag', 'remove_tag_oldid', name='remove-tag'),
48 url(r'^podcast/(?P<pid>\d+)/set-public', 'set_public_oldid', name='podcast-public', kwargs={'public': True}),
49 url(r'^podcast/(?P<pid>\d+)/set-private', 'set_public_oldid', name='podcast-private', kwargs={'public': False}),
50 url(r'^podcast/(?P<pid>\d+)/-episodes', 'all_episodes_oldid', name='podcast-all-episodes'),
52 url(r'^podcast/(?P<slug_id>[\w-]+)/?$', 'show_slug_id', name='podcast-slug-id'),
53 url(r'^podcast/(?P<slug_id>[\w-]+)/subscribe$', 'subscribe_slug_id', name='subscribe-slug-id'),
54 url(r'^podcast/(?P<slug_id>[\w-]+)/unsubscribe/(?P<device_uid>[\w.-]+)', 'unsubscribe_slug_id', name='unsubscribe-slug-id'),
55 url(r'^podcast/(?P<slug_id>[\w-]+)/add-tag', 'add_tag_slug_id', name='add-tag-slug-id'),
56 url(r'^podcast/(?P<slug_id>[\w-]+)/remove-tag', 'remove_tag_slug_id', name='remove-tag-slug-id'),
57 url(r'^podcast/(?P<slug_id>[\w-]+)/set-public', 'set_public_slug_id', name='podcast-public-slug-id', kwargs={'public': True}),
58 url(r'^podcast/(?P<slug_id>[\w-]+)/set-private', 'set_public_slug_id', name='podcast-private-slug-id', kwargs={'public': False}),
59 url(r'^podcast/(?P<slug_id>[\w-]+)/-episodes', 'all_episodes_slug_id', name='podcast-all-episodes-slug-id'),
63 urlpatterns += patterns('mygpo.web.views.episode',
65 url(r'^favorites/$',
66 'list_favorites',
67 name='favorites'),
69 url(r'^episode/(?P<id>\d+)$', 'show_oldid', name='episode'),
70 url(r'^episode/(?P<id>\d+)/add-chapter$', 'add_chapter_oldid', name='add-chapter'),
71 url(r'^episode/(?P<id>\d+)/remove-chapter/(?P<start>\d+)-(?P<end>\d+)$', 'remove_chapter_oldid',name='remove-chapter'),
72 url(r'^episode/(?P<id>\d+)/toggle-favorite', 'toggle_favorite_oldid',name='episode-fav'),
73 url(r'^episode/(?P<id>\d+)/add-action', 'add_action_oldid', name='add-episode-action'),
75 url(r'^podcast/(?P<p_slug_id>[\w-]+)/(?P<e_slug_id>[\w-]+)$', 'show_slug_id', name='episode-slug-id'),
76 url(r'^episode/(?P<p_slug_id>[\w-]+)/(?P<e_slug_id>[\w-]+)/add-chapter$', 'add_chapter_slug_id', name='add-chapter-slug-id'),
77 url(r'^episode/(?P<p_slug_id>[\w-]+)/(?P<e_slug_id>[\w-]+)/remove-chapter/(?P<start>\d+)-(?P<end>\d+)$',
78 'remove_chapter', name='remove-chapter'),
79 url(r'^episode/(?P<p_slug_id>[\w-]+)/(?P<e_slug_id>[\w-]+)/toggle-favorite', 'toggle_favorite_slug_id', name='episode-fav-slug-id'),
80 url(r'^episode/(?P<p_slug_id>[\w-]+)/(?P<e_slug_id>[\w-]+)/add-action', 'add_action_slug_id', name='add-episode-action-slug-id'),
83 from mygpo.web.views.settings import DefaultPrivacySettings, \
84 PodcastPrivacySettings
86 urlpatterns += patterns('mygpo.web.views.settings',
87 url(r'^account/$', 'account', name='account'),
88 url(r'^account/privacy$', 'privacy', name='privacy'),
90 url(r'^account/privacy/default-public$',
91 DefaultPrivacySettings.as_view(public=True),
92 name='privacy_default_public'),
94 url(r'^account/privacy/default-private$',
95 DefaultPrivacySettings.as_view(public=False),
96 name='privacy_default_private'),
98 url(r'^account/privacy/(?P<podcast_id>[\w]+)/public$',
99 PodcastPrivacySettings.as_view(public=True),
100 name='privacy_podcast_public'),
102 url(r'^account/privacy/(?P<podcast_id>[\w]+)/private$',
103 PodcastPrivacySettings.as_view(public=False),
104 name='privacy_podcast_private'),
106 url(r'^account/delete$', 'delete_account',name='delete-account'),
109 urlpatterns += patterns('mygpo.web.views.device',
110 url(r'^devices/$', 'overview', name='devices'),
111 url(r'^devices/create$', 'edit_new', name='device-edit-new'),
112 url(r'^devices/create-device$', 'create', name='device-create'),
113 url(r'^device/(?P<uid>[\w.-]+)\.opml$', 'opml', name='device-opml'),
114 url(r'^device/(?P<uid>[\w.-]+)$', 'show', name='device'),
115 url(r'^device/(?P<uid>[\w.-]+)/symbian.opml$', 'symbian_opml', name='device-symbian-opml'),
116 url(r'^device/(?P<uid>[\w.-]+)/sync$', 'sync', name='device-sync'),
117 url(r'^device/(?P<uid>[\w.-]+)/unsync$', 'unsync', name='device-unsync'),
118 url(r'^device/(?P<uid>[\w.-]+)/delete$', 'delete', name='device-delete'),
119 url(r'^device/(?P<uid>[\w.-]+)/remove$', 'delete_permanently', name='device-delete-permanently'),
120 url(r'^device/(?P<uid>[\w.-]+)/undelete$', 'undelete', name='device-undelete'),
121 url(r'^device/(?P<uid>[\w.-]+)/history$', 'history', name='device-history'),
122 url(r'^device/(?P<uid>[\w.-]+)/edit$', 'edit', name='device-edit'),
123 url(r'^device/(?P<uid>[\w.-]+)/update$', 'update', name='device-update'),
124 url(r'^device/(?P<uid>[\w.-]+)/upload-opml$', 'upload_opml', name='device-upload-opml'),
127 urlpatterns += patterns('mygpo.web.views.users',
128 url(r'^login/$', 'login_user', name='login'),
129 url(r'^logout/$', logout, {'next_page': '/'}, name='logout'),
130 url(r'^register/resend-activation$', 'resend_activation', name='resend-activation'),
131 url(r'^register/restore_password$', 'restore_password', name='restore-password'),
132 url(r'^register/$', register,
133 {'backend': 'django_couchdb_utils.registration.backends.default.DefaultBackend',
134 'form_class': RegistrationFormUniqueEmail}, name='register'),
135 (r'^registration_complete/$', direct_to_template,
136 {'template': 'registration/registration_complete.html'}),
137 (r'^activate/(?P<activation_key>\w+)$', activate,
138 {'backend': 'django_couchdb_utils.registration.backends.default.DefaultBackend'}),