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
'^suggestions/$', 'suggestions', name
='suggestions'),
12 url(r
'^suggestions/rate$', 'rate_suggestions', name
='suggestions-rate'),
13 url(r
'^suggestions/blacklist/(?P<slug>[\w-]+)$', 'blacklist', name
='suggestions-blacklist-slug'),
14 url(r
'^tags/', 'mytags', name
='tags'),
18 url
='http://gpoddernet.readthedocs.org/en/latest/user/index.html'),
22 TemplateView
.as_view(template_name
='developer.html')),
25 TemplateView
.as_view(template_name
='contribute.html'),
29 TemplateView
.as_view(template_name
='privacy_policy.html'),
30 name
='privacy-policy'),
34 urlpatterns
+= patterns('mygpo.web.views.subscriptions',
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'),
39 urlpatterns
+= patterns('mygpo.web.views.podcast',
40 url(r
'^subscribe', 'subscribe_url', name
='subscribe-by-url'),
42 # Podcast Views with UUIDs
43 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/?$',
47 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/subscribe$',
51 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/subscribe/\+all$',
53 name
='subscribe-all-id'),
55 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/unsubscribe/(?P<device_uid>[\w.-]+)',
57 name
='unsubscribe-id'),
59 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/unsubscribe/\+all$',
61 name
='unsubscribe-all-id'),
63 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/add-tag',
67 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/remove-tag',
69 name
='remove-tag-id'),
71 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/set-public',
73 name
='podcast-public-id',
74 kwargs
={'public': True}),
76 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/set-private',
78 name
='podcast-private-id',
79 kwargs
={'public': False}),
81 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/-episodes',
83 name
='podcast-all-episodes-id'),
85 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/-flattr',
87 name
='podcast-flattr-id'),
90 # Podcast Views with Slugs
91 url(r
'^podcast/(?P<slug>[\w-]+)/?$',
95 url(r
'^podcast/(?P<slug>[\w-]+)/subscribe$',
97 name
='subscribe-slug'),
99 url(r
'^podcast/(?P<slug>[\w-]+)/subscribe/\+all$',
100 'subscribe_all_slug',
101 name
='subscribe-all-slug'),
103 url(r
'^podcast/(?P<slug>[\w-]+)/unsubscribe/(?P<device_uid>[\w.-]+)',
105 name
='unsubscribe-slug'),
107 url(r
'^podcast/(?P<slug>[\w-]+)/unsubscribe/\+all$',
108 'unsubscribe_all_slug',
109 name
='unsubscribe-all-slug'),
111 url(r
'^podcast/(?P<slug>[\w-]+)/add-tag',
113 name
='add-tag-slug'),
115 url(r
'^podcast/(?P<slug>[\w-]+)/remove-tag',
117 name
='remove-tag-slug'),
119 url(r
'^podcast/(?P<slug>[\w-]+)/set-public',
121 name
='podcast-public-slug',
122 kwargs
={'public': True}),
124 url(r
'^podcast/(?P<slug>[\w-]+)/set-private',
126 name
='podcast-private-slug',
127 kwargs
={'public': False}),
129 url(r
'^podcast/(?P<slug>[\w-]+)/-episodes',
131 name
='podcast-all-episodes-slug'),
133 url(r
'^podcast/(?P<slug>[\w-]+)/-flattr',
134 'flattr_podcast_slug',
135 name
='podcast-flattr-slug'),
139 urlpatterns
+= patterns('mygpo.web.views.episode',
146 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})$',
150 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/toggle-favorite',
151 'toggle_favorite_id',
152 name
='episode-fav-id'),
154 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/add-action',
156 name
='add-episode-action-id'),
158 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/-flattr',
160 name
='flattr-episode-id'),
162 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/\+history',
163 'episode_history_id',
164 name
='episode-history-id'),
168 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)$',
170 name
='episode-slug'),
172 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/toggle-favorite',
173 'toggle_favorite_slug',
174 name
='episode-fav-slug'),
176 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/add-action',
178 name
='add-episode-action-slug'),
180 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/-flattr',
181 'flattr_episode_slug', name
='flattr-episode-slug'),
183 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/\+history',
184 'episode_history_slug',
185 name
='episode-history-slug'),
188 from mygpo
.web
.views
.settings
import DefaultPrivacySettings
, \
189 PodcastPrivacySettings
, ProfileView
, FlattrSettingsView
, \
190 FlattrTokenView
, FlattrLogout
, AccountRemoveGoogle
192 urlpatterns
+= patterns('mygpo.web.views.settings',
193 url(r
'^account/$', 'account', name
='account'),
194 url(r
'^account/privacy$', 'privacy', name
='privacy'),
196 url(r
'^account/profile$',
197 ProfileView
.as_view(),
200 url(r
'^account/google/remove$',
201 AccountRemoveGoogle
.as_view(),
202 name
='account-google-remove'),
204 url(r
'^account/flattr$',
205 FlattrSettingsView
.as_view(),
206 name
='flattr-settings'),
208 url(r
'^account/flattr/token$',
209 FlattrTokenView
.as_view(),
210 name
='flattr-token'),
212 url(r
'^account/flattr/logout$',
213 FlattrLogout
.as_view(),
214 name
='flattr-logout'),
216 url(r
'^account/privacy/default-public$',
217 DefaultPrivacySettings
.as_view(public
=True),
218 name
='privacy_default_public'),
220 url(r
'^account/privacy/default-private$',
221 DefaultPrivacySettings
.as_view(public
=False),
222 name
='privacy_default_private'),
224 url(r
'^account/privacy/(?P<podcast_id>[\w]+)/public$',
225 PodcastPrivacySettings
.as_view(public
=True),
226 name
='privacy_podcast_public'),
228 url(r
'^account/privacy/(?P<podcast_id>[\w]+)/private$',
229 PodcastPrivacySettings
.as_view(public
=False),
230 name
='privacy_podcast_private'),
232 url(r
'^account/delete$', 'delete_account',name
='delete-account'),
235 urlpatterns
+= patterns('mygpo.web.views.device',
236 url(r
'^devices/$', 'overview', name
='devices'),
237 url(r
'^devices/create-device$', 'create', name
='device-create'),
238 url(r
'^device/(?P<uid>[\w.-]+)\.opml$', 'opml', name
='device-opml'),
239 url(r
'^device/(?P<uid>[\w.-]+)$', 'show', name
='device'),
240 url(r
'^device/(?P<uid>[\w.-]+)/symbian.opml$', 'symbian_opml', name
='device-symbian-opml'),
241 url(r
'^device/(?P<uid>[\w.-]+)/sync$', 'sync', name
='device-sync'),
242 url(r
'^device/(?P<uid>[\w.-]+)/unsync$', 'unsync', name
='device-unsync'),
243 url(r
'^device/(?P<uid>[\w.-]+)/delete$', 'delete', name
='device-delete'),
244 url(r
'^device/(?P<uid>[\w.-]+)/remove$', 'delete_permanently', name
='device-delete-permanently'),
245 url(r
'^device/(?P<uid>[\w.-]+)/undelete$', 'undelete', name
='device-undelete'),
246 url(r
'^device/(?P<uid>[\w.-]+)/edit$', 'edit', name
='device-edit'),
247 url(r
'^device/(?P<uid>[\w.-]+)/update$', 'update', name
='device-update'),
248 url(r
'^device/(?P<uid>[\w.-]+)/upload-opml$', 'upload_opml', name
='device-upload-opml'),
252 from mygpo
.web
.views
.users
import LoginView
, GoogleLogin
, GoogleLoginCallback
254 urlpatterns
+= patterns('mygpo.web.views.users',
256 url(r
'^register/restore_password$',
258 name
='restore-password'),
264 url(r
'^login/google$',
265 GoogleLogin
.as_view(),
266 name
='login-google'),
268 url(r
'^login/oauth2callback$',
269 GoogleLoginCallback
.as_view(),
270 name
='login-google-callback'),
272 url(r
'^logout/$', logout
, {'next_page': '/'}, name
='logout'),