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'),
15 url
='http://gpoddernet.readthedocs.org/en/latest/user/index.html',
21 TemplateView
.as_view(template_name
='developer.html')),
24 TemplateView
.as_view(template_name
='contribute.html'),
28 TemplateView
.as_view(template_name
='privacy_policy.html'),
29 name
='privacy-policy'),
33 urlpatterns
+= patterns('mygpo.web.views.subscriptions',
34 url(r
'^user/(?P<username>[\w.+-]+)/subscriptions$', 'for_user', name
='shared-subscriptions'),
35 url(r
'^user/(?P<username>[\w.+-]+)/subscriptions\.opml$', 'for_user_opml', name
='shared-subscriptions-opml'),
38 urlpatterns
+= patterns('mygpo.web.views.podcast',
39 url(r
'^subscribe', 'subscribe_url', name
='subscribe-by-url'),
41 # Podcast Views with UUIDs
42 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/?$',
46 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/subscribe$',
50 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/subscribe/\+all$',
52 name
='subscribe-all-id'),
54 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/unsubscribe/(?P<device_uid>[\w.-]+)',
56 name
='unsubscribe-id'),
58 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/unsubscribe/\+all$',
60 name
='unsubscribe-all-id'),
62 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/add-tag',
66 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/remove-tag',
68 name
='remove-tag-id'),
70 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/set-public',
72 name
='podcast-public-id',
73 kwargs
={'public': True}),
75 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/set-private',
77 name
='podcast-private-id',
78 kwargs
={'public': False}),
80 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/-episodes',
82 name
='podcast-all-episodes-id'),
84 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/-flattr',
86 name
='podcast-flattr-id'),
89 # Podcast Views with Slugs
90 url(r
'^podcast/(?P<slug>[\w-]+)/?$',
94 url(r
'^podcast/(?P<slug>[\w-]+)/subscribe$',
96 name
='subscribe-slug'),
98 url(r
'^podcast/(?P<slug>[\w-]+)/subscribe/\+all$',
100 name
='subscribe-all-slug'),
102 url(r
'^podcast/(?P<slug>[\w-]+)/unsubscribe/(?P<device_uid>[\w.-]+)',
104 name
='unsubscribe-slug'),
106 url(r
'^podcast/(?P<slug>[\w-]+)/unsubscribe/\+all$',
107 'unsubscribe_all_slug',
108 name
='unsubscribe-all-slug'),
110 url(r
'^podcast/(?P<slug>[\w-]+)/add-tag',
112 name
='add-tag-slug'),
114 url(r
'^podcast/(?P<slug>[\w-]+)/remove-tag',
116 name
='remove-tag-slug'),
118 url(r
'^podcast/(?P<slug>[\w-]+)/set-public',
120 name
='podcast-public-slug',
121 kwargs
={'public': True}),
123 url(r
'^podcast/(?P<slug>[\w-]+)/set-private',
125 name
='podcast-private-slug',
126 kwargs
={'public': False}),
128 url(r
'^podcast/(?P<slug>[\w-]+)/-episodes',
130 name
='podcast-all-episodes-slug'),
132 url(r
'^podcast/(?P<slug>[\w-]+)/-flattr',
133 'flattr_podcast_slug',
134 name
='podcast-flattr-slug'),
138 urlpatterns
+= patterns('mygpo.web.views.episode',
145 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})$',
149 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/toggle-favorite',
150 'toggle_favorite_id',
151 name
='episode-fav-id'),
153 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/add-action',
155 name
='add-episode-action-id'),
157 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/-flattr',
159 name
='flattr-episode-id'),
161 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/\+history',
162 'episode_history_id',
163 name
='episode-history-id'),
167 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)$',
169 name
='episode-slug'),
171 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/toggle-favorite',
172 'toggle_favorite_slug',
173 name
='episode-fav-slug'),
175 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/add-action',
177 name
='add-episode-action-slug'),
179 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/-flattr',
180 'flattr_episode_slug', name
='flattr-episode-slug'),
182 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/\+history',
183 'episode_history_slug',
184 name
='episode-history-slug'),
187 from mygpo
.web
.views
.settings
import DefaultPrivacySettings
, \
188 PodcastPrivacySettings
, ProfileView
, FlattrSettingsView
, \
189 FlattrTokenView
, FlattrLogout
, AccountRemoveGoogle
191 urlpatterns
+= patterns('mygpo.web.views.settings',
192 url(r
'^account/$', 'account', name
='account'),
193 url(r
'^account/privacy$', 'privacy', name
='privacy'),
195 url(r
'^account/profile$',
196 ProfileView
.as_view(),
199 url(r
'^account/google/remove$',
200 AccountRemoveGoogle
.as_view(),
201 name
='account-google-remove'),
203 url(r
'^account/flattr$',
204 FlattrSettingsView
.as_view(),
205 name
='flattr-settings'),
207 url(r
'^account/flattr/token$',
208 FlattrTokenView
.as_view(),
209 name
='flattr-token'),
211 url(r
'^account/flattr/logout$',
212 FlattrLogout
.as_view(),
213 name
='flattr-logout'),
215 url(r
'^account/privacy/default-public$',
216 DefaultPrivacySettings
.as_view(public
=True),
217 name
='privacy_default_public'),
219 url(r
'^account/privacy/default-private$',
220 DefaultPrivacySettings
.as_view(public
=False),
221 name
='privacy_default_private'),
223 url(r
'^account/privacy/(?P<podcast_id>[\w]+)/public$',
224 PodcastPrivacySettings
.as_view(public
=True),
225 name
='privacy_podcast_public'),
227 url(r
'^account/privacy/(?P<podcast_id>[\w]+)/private$',
228 PodcastPrivacySettings
.as_view(public
=False),
229 name
='privacy_podcast_private'),
231 url(r
'^account/delete$', 'delete_account',name
='delete-account'),
234 urlpatterns
+= patterns('mygpo.web.views.device',
235 url(r
'^devices/$', 'overview', name
='devices'),
236 url(r
'^devices/create-device$', 'create', name
='device-create'),
237 url(r
'^device/(?P<uid>[\w.-]+)\.opml$', 'opml', name
='device-opml'),
238 url(r
'^device/(?P<uid>[\w.-]+)$', 'show', name
='device'),
239 url(r
'^device/(?P<uid>[\w.-]+)/symbian.opml$', 'symbian_opml', name
='device-symbian-opml'),
240 url(r
'^device/(?P<uid>[\w.-]+)/sync$', 'sync', name
='device-sync'),
241 url(r
'^device/(?P<uid>[\w.-]+)/unsync$', 'unsync', name
='device-unsync'),
242 url(r
'^device/(?P<uid>[\w.-]+)/resync$', 'resync', name
='trigger-sync'),
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'),