[Publisher] incorrect number of new/existing publisher permissions
[mygpo.git] / mygpo / web / urls.py
blob970453debf78f3d8522eb767d07ec63a5d1c3c34
1 from django.conf.urls import *
2 from django.contrib.auth.views import logout
3 from django.views.generic.base import TemplateView, RedirectView
5 from mygpo.web.logo import CoverArt
8 urlpatterns = patterns('mygpo.web.views',
9 url(r'^$', 'home', name='home'),
10 url(r'^logo/(?P<size>\d+)/(?P<prefix>.{3})/(?P<filename>[^/]*)$', CoverArt.as_view(), name='logo'),
11 url(r'^tags/', 'mytags', name='tags'),
13 url(r'^online-help',
14 RedirectView.as_view(
15 url='http://gpoddernet.readthedocs.org/en/latest/user/index.html'),
16 name='help'),
18 url(r'^developer/',
19 TemplateView.as_view(template_name='developer.html')),
21 url(r'^contribute/',
22 TemplateView.as_view(template_name='contribute.html'),
23 name='contribute'),
25 url(r'^privacy/',
26 TemplateView.as_view(template_name='privacy_policy.html'),
27 name='privacy-policy'),
31 urlpatterns += patterns('mygpo.web.views.subscriptions',
32 url(r'^user/(?P<username>[\w.+-]+)/subscriptions$', 'for_user', name='shared-subscriptions'),
33 url(r'^user/(?P<username>[\w.+-]+)/subscriptions\.opml$', 'for_user_opml', name='shared-subscriptions-opml'),
36 urlpatterns += patterns('mygpo.web.views.podcast',
37 url(r'^subscribe', 'subscribe_url', name='subscribe-by-url'),
39 # Podcast Views with UUIDs
40 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/?$',
41 'show_id',
42 name='podcast-id'),
44 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/subscribe$',
45 'subscribe_id',
46 name='subscribe-id'),
48 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/subscribe/\+all$',
49 'subscribe_all_id',
50 name='subscribe-all-id'),
52 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/unsubscribe/(?P<device_uid>[\w.-]+)',
53 'unsubscribe_id',
54 name='unsubscribe-id'),
56 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/unsubscribe/\+all$',
57 'unsubscribe_all_id',
58 name='unsubscribe-all-id'),
60 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/add-tag',
61 'add_tag_id',
62 name='add-tag-id'),
64 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/remove-tag',
65 'remove_tag_id',
66 name='remove-tag-id'),
68 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/set-public',
69 'set_public_id',
70 name='podcast-public-id',
71 kwargs={'public': True}),
73 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/set-private',
74 'set_public_id',
75 name='podcast-private-id',
76 kwargs={'public': False}),
78 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/-episodes',
79 'all_episodes_id',
80 name='podcast-all-episodes-id'),
82 url(r'^podcast/(?P<podcast_id>[0-9a-f]{32})/-flattr',
83 'flattr_podcast_id',
84 name='podcast-flattr-id'),
87 # Podcast Views with Slugs
88 url(r'^podcast/(?P<slug>[\w-]+)/?$',
89 'show_slug',
90 name='podcast-slug'),
92 url(r'^podcast/(?P<slug>[\w-]+)/subscribe$',
93 'subscribe_slug',
94 name='subscribe-slug'),
96 url(r'^podcast/(?P<slug>[\w-]+)/subscribe/\+all$',
97 'subscribe_all_slug',
98 name='subscribe-all-slug'),
100 url(r'^podcast/(?P<slug>[\w-]+)/unsubscribe/(?P<device_uid>[\w.-]+)',
101 'unsubscribe_slug',
102 name='unsubscribe-slug'),
104 url(r'^podcast/(?P<slug>[\w-]+)/unsubscribe/\+all$',
105 'unsubscribe_all_slug',
106 name='unsubscribe-all-slug'),
108 url(r'^podcast/(?P<slug>[\w-]+)/add-tag',
109 'add_tag_slug',
110 name='add-tag-slug'),
112 url(r'^podcast/(?P<slug>[\w-]+)/remove-tag',
113 'remove_tag_slug',
114 name='remove-tag-slug'),
116 url(r'^podcast/(?P<slug>[\w-]+)/set-public',
117 'set_public_slug',
118 name='podcast-public-slug',
119 kwargs={'public': True}),
121 url(r'^podcast/(?P<slug>[\w-]+)/set-private',
122 'set_public_slug',
123 name='podcast-private-slug',
124 kwargs={'public': False}),
126 url(r'^podcast/(?P<slug>[\w-]+)/-episodes',
127 'all_episodes_slug',
128 name='podcast-all-episodes-slug'),
130 url(r'^podcast/(?P<slug>[\w-]+)/-flattr',
131 'flattr_podcast_slug',
132 name='podcast-flattr-slug'),
136 urlpatterns += patterns('mygpo.web.views.episode',
138 url(r'^favorites/$',
139 'list_favorites',
140 name='favorites'),
142 # Episodes for UUIDs
143 url(r'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})$',
144 'show_id',
145 name='episode-id'),
147 url(r'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/toggle-favorite',
148 'toggle_favorite_id',
149 name='episode-fav-id'),
151 url(r'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/add-action',
152 'add_action_id',
153 name='add-episode-action-id'),
155 url(r'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/-flattr',
156 'flattr_episode_id',
157 name='flattr-episode-id'),
159 url(r'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/\+history',
160 'episode_history_id',
161 name='episode-history-id'),
164 # Episodes for Slugs
165 url(r'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)$',
166 'show_slug',
167 name='episode-slug'),
169 url(r'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/toggle-favorite',
170 'toggle_favorite_slug',
171 name='episode-fav-slug'),
173 url(r'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/add-action',
174 'add_action_slug',
175 name='add-episode-action-slug'),
177 url(r'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/-flattr',
178 'flattr_episode_slug', name='flattr-episode-slug'),
180 url(r'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/\+history',
181 'episode_history_slug',
182 name='episode-history-slug'),
185 from mygpo.web.views.settings import DefaultPrivacySettings, \
186 PodcastPrivacySettings, ProfileView, FlattrSettingsView, \
187 FlattrTokenView, FlattrLogout, AccountRemoveGoogle
189 urlpatterns += patterns('mygpo.web.views.settings',
190 url(r'^account/$', 'account', name='account'),
191 url(r'^account/privacy$', 'privacy', name='privacy'),
193 url(r'^account/profile$',
194 ProfileView.as_view(),
195 name='profile'),
197 url(r'^account/google/remove$',
198 AccountRemoveGoogle.as_view(),
199 name='account-google-remove'),
201 url(r'^account/flattr$',
202 FlattrSettingsView.as_view(),
203 name='flattr-settings'),
205 url(r'^account/flattr/token$',
206 FlattrTokenView.as_view(),
207 name='flattr-token'),
209 url(r'^account/flattr/logout$',
210 FlattrLogout.as_view(),
211 name='flattr-logout'),
213 url(r'^account/privacy/default-public$',
214 DefaultPrivacySettings.as_view(public=True),
215 name='privacy_default_public'),
217 url(r'^account/privacy/default-private$',
218 DefaultPrivacySettings.as_view(public=False),
219 name='privacy_default_private'),
221 url(r'^account/privacy/(?P<podcast_id>[\w]+)/public$',
222 PodcastPrivacySettings.as_view(public=True),
223 name='privacy_podcast_public'),
225 url(r'^account/privacy/(?P<podcast_id>[\w]+)/private$',
226 PodcastPrivacySettings.as_view(public=False),
227 name='privacy_podcast_private'),
229 url(r'^account/delete$', 'delete_account',name='delete-account'),
232 urlpatterns += patterns('mygpo.web.views.device',
233 url(r'^devices/$', 'overview', name='devices'),
234 url(r'^devices/create-device$', 'create', name='device-create'),
235 url(r'^device/(?P<uid>[\w.-]+)\.opml$', 'opml', name='device-opml'),
236 url(r'^device/(?P<uid>[\w.-]+)$', 'show', name='device'),
237 url(r'^device/(?P<uid>[\w.-]+)/symbian.opml$', 'symbian_opml', name='device-symbian-opml'),
238 url(r'^device/(?P<uid>[\w.-]+)/sync$', 'sync', name='device-sync'),
239 url(r'^device/(?P<uid>[\w.-]+)/unsync$', 'unsync', name='device-unsync'),
240 url(r'^device/(?P<uid>[\w.-]+)/resync$', 'resync', name='trigger-sync'),
241 url(r'^device/(?P<uid>[\w.-]+)/delete$', 'delete', name='device-delete'),
242 url(r'^device/(?P<uid>[\w.-]+)/remove$', 'delete_permanently', name='device-delete-permanently'),
243 url(r'^device/(?P<uid>[\w.-]+)/undelete$', 'undelete', name='device-undelete'),
244 url(r'^device/(?P<uid>[\w.-]+)/edit$', 'edit', name='device-edit'),
245 url(r'^device/(?P<uid>[\w.-]+)/update$', 'update', name='device-update'),
246 url(r'^device/(?P<uid>[\w.-]+)/upload-opml$', 'upload_opml', name='device-upload-opml'),
250 from mygpo.web.views.users import LoginView, GoogleLogin, GoogleLoginCallback
252 urlpatterns += patterns('mygpo.web.views.users',
254 url(r'^register/restore_password$',
255 'restore_password',
256 name='restore-password'),
258 url(r'^login/$',
259 LoginView.as_view(),
260 name='login'),
262 url(r'^login/google$',
263 GoogleLogin.as_view(),
264 name='login-google'),
266 url(r'^login/oauth2callback$',
267 GoogleLoginCallback.as_view(),
268 name='login-google-callback'),
270 url(r'^logout/$', logout, {'next_page': '/'}, name='logout'),