1 from django
.conf
.urls
import url
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 from .views
import subscriptions
, podcast
, episode
, settings
, device
, users
17 url(r
'^logo/(?P<size>\d+)/(?P<prefix>.{3})/(?P<filename>[^/]*)$',
27 url
='http://gpoddernet.readthedocs.org/en/latest/user/index.html',
33 TemplateView
.as_view(template_name
='developer.html')),
36 TemplateView
.as_view(template_name
='contribute.html'),
40 TemplateView
.as_view(template_name
='privacy_policy.html'),
41 name
='privacy-policy'),
43 url(r
'^user/(?P<username>[\w.+-]+)/subscriptions$',
44 subscriptions
.for_user
,
45 name
='shared-subscriptions'),
47 url(r
'^user/(?P<username>[\w.+-]+)/subscriptions\.opml$',
48 subscriptions
.for_user_opml
,
49 name
='shared-subscriptions-opml'),
52 podcast
.subscribe_url
,
53 name
='subscribe-by-url'),
55 # Podcast Views with UUIDs
56 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/?$',
60 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/subscribe$',
64 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/subscribe/\+all$',
65 podcast
.subscribe_all_id
,
66 name
='subscribe-all-id'),
68 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/unsubscribe/'
69 '(?P<device_uid>[\w.-]+)',
70 podcast
.unsubscribe_id
,
71 name
='unsubscribe-id'),
73 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/unsubscribe/\+all$',
74 podcast
.unsubscribe_all_id
,
75 name
='unsubscribe-all-id'),
77 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/add-tag',
81 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/remove-tag',
82 podcast
.remove_tag_id
,
83 name
='remove-tag-id'),
85 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/set-public',
86 podcast
.set_public_id
,
87 name
='podcast-public-id',
88 kwargs
={'public': True}),
90 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/set-private',
91 podcast
.set_public_id
,
92 name
='podcast-private-id',
93 kwargs
={'public': False}),
95 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/-episodes',
96 podcast
.all_episodes_id
,
97 name
='podcast-all-episodes-id'),
99 url(r
'^podcast/(?P<podcast_id>[0-9a-f]{32})/-flattr',
100 podcast
.flattr_podcast_id
,
101 name
='podcast-flattr-id'),
103 # Podcast Views with Slugs
104 url(r
'^podcast/(?P<slug>[\w-]+)/?$',
106 name
='podcast-slug'),
108 url(r
'^podcast/(?P<slug>[\w-]+)/subscribe$',
109 podcast
.subscribe_slug
,
110 name
='subscribe-slug'),
112 url(r
'^podcast/(?P<slug>[\w-]+)/subscribe/\+all$',
113 podcast
.subscribe_all_slug
,
114 name
='subscribe-all-slug'),
116 url(r
'^podcast/(?P<slug>[\w-]+)/unsubscribe/(?P<device_uid>[\w.-]+)',
117 podcast
.unsubscribe_slug
,
118 name
='unsubscribe-slug'),
120 url(r
'^podcast/(?P<slug>[\w-]+)/unsubscribe/\+all$',
121 podcast
.unsubscribe_all_slug
,
122 name
='unsubscribe-all-slug'),
124 url(r
'^podcast/(?P<slug>[\w-]+)/add-tag',
125 podcast
.add_tag_slug
,
126 name
='add-tag-slug'),
128 url(r
'^podcast/(?P<slug>[\w-]+)/remove-tag',
129 podcast
.remove_tag_slug
,
130 name
='remove-tag-slug'),
132 url(r
'^podcast/(?P<slug>[\w-]+)/set-public',
133 podcast
.set_public_slug
,
134 name
='podcast-public-slug',
135 kwargs
={'public': True}),
137 url(r
'^podcast/(?P<slug>[\w-]+)/set-private',
138 podcast
.set_public_slug
,
139 name
='podcast-private-slug',
140 kwargs
={'public': False}),
142 url(r
'^podcast/(?P<slug>[\w-]+)/-episodes',
143 podcast
.all_episodes_slug
,
144 name
='podcast-all-episodes-slug'),
146 url(r
'^podcast/(?P<slug>[\w-]+)/-flattr',
147 podcast
.flattr_podcast_slug
,
148 name
='podcast-flattr-slug'),
151 episode
.list_favorites
,
155 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})$',
159 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/'
161 episode
.toggle_favorite_id
,
162 name
='episode-fav-id'),
164 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/add-action',
165 episode
.add_action_id
,
166 name
='add-episode-action-id'),
168 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/-flattr',
169 episode
.flattr_episode_id
,
170 name
='flattr-episode-id'),
172 url(r
'^podcast/(?P<p_id>[0-9a-f]{32})/(?P<e_id>[0-9a-f]{32})/\+history',
173 episode
.episode_history_id
,
174 name
='episode-history-id'),
177 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)$',
179 name
='episode-slug'),
181 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/toggle-favorite',
182 episode
.toggle_favorite_slug
,
183 name
='episode-fav-slug'),
185 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/add-action',
186 episode
.add_action_slug
,
187 name
='add-episode-action-slug'),
189 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/-flattr',
190 episode
.flattr_episode_slug
, name
='flattr-episode-slug'),
192 url(r
'^podcast/(?P<p_slug>[\w-]+)/(?P<e_slug>[\w-]+)/\+history',
193 episode
.episode_history_slug
,
194 name
='episode-history-slug'),
200 url(r
'^account/privacy$',
204 url(r
'^account/profile$',
205 settings
.ProfileView
.as_view(),
208 url(r
'^account/google/remove$',
209 settings
.AccountRemoveGoogle
.as_view(),
210 name
='account-google-remove'),
212 url(r
'^account/flattr$',
213 settings
.FlattrSettingsView
.as_view(),
214 name
='flattr-settings'),
216 url(r
'^account/flattr/token$',
217 settings
.FlattrTokenView
.as_view(),
218 name
='flattr-token'),
220 url(r
'^account/flattr/logout$',
221 settings
.FlattrLogout
.as_view(),
222 name
='flattr-logout'),
224 url(r
'^account/privacy/default-public$',
225 settings
.DefaultPrivacySettings
.as_view(public
=True),
226 name
='privacy_default_public'),
228 url(r
'^account/privacy/default-private$',
229 settings
.DefaultPrivacySettings
.as_view(public
=False),
230 name
='privacy_default_private'),
232 url(r
'^account/privacy/(?P<podcast_id>[\w]+)/public$',
233 settings
.PodcastPrivacySettings
.as_view(public
=True),
234 name
='privacy_podcast_public'),
236 url(r
'^account/privacy/(?P<podcast_id>[\w]+)/private$',
237 settings
.PodcastPrivacySettings
.as_view(public
=False),
238 name
='privacy_podcast_private'),
240 url(r
'^account/delete$',
241 settings
.delete_account
,
242 name
='delete-account'),
248 url(r
'^devices/create-device$',
250 name
='device-create'),
252 url(r
'^device/(?P<uid>[\w.-]+)\.opml$',
256 url(r
'^device/(?P<uid>[\w.-]+)$',
260 url(r
'^device/(?P<uid>[\w.-]+)/symbian.opml$',
262 name
='device-symbian-opml'),
264 url(r
'^device/(?P<uid>[\w.-]+)/sync$',
268 url(r
'^device/(?P<uid>[\w.-]+)/unsync$',
270 name
='device-unsync'),
272 url(r
'^device/(?P<uid>[\w.-]+)/resync$',
274 name
='trigger-sync'),
276 url(r
'^device/(?P<uid>[\w.-]+)/delete$',
278 name
='device-delete'),
280 url(r
'^device/(?P<uid>[\w.-]+)/remove$',
281 device
.delete_permanently
,
282 name
='device-delete-permanently'),
284 url(r
'^device/(?P<uid>[\w.-]+)/undelete$',
286 name
='device-undelete'),
288 url(r
'^device/(?P<uid>[\w.-]+)/edit$',
292 url(r
'^device/(?P<uid>[\w.-]+)/update$',
294 name
='device-update'),
296 url(r
'^device/(?P<uid>[\w.-]+)/upload-opml$',
298 name
='device-upload-opml'),
300 url(r
'^register/restore_password$',
301 users
.restore_password
,
302 name
='restore-password'),
305 users
.LoginView
.as_view(),
308 url(r
'^login/google$',
309 users
.GoogleLogin
.as_view(),
310 name
='login-google'),
312 url(r
'^login/oauth2callback$',
313 users
.GoogleLoginCallback
.as_view(),
314 name
='login-google-callback'),
318 kwargs
={'next_page': '/'},