trac#687: Add unit tests for `redirect` and `redirect_obj`.
[larjonas-mediagoblin.git] / mediagoblin / user_pages / routing.py
blob1a1d41399e93a51e8006247b7e65b5cb29894fb6
1 # GNU MediaGoblin -- federated, autonomous media hosting
2 # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU Affero General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Affero General Public License for more details.
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 from mediagoblin.tools.routing import add_route
19 add_route('mediagoblin.user_pages.user_home',
20 '/u/<string:user>/', 'mediagoblin.user_pages.views:user_home')
22 add_route('mediagoblin.user_pages.media_home',
23 '/u/<string:user>/m/<string:media>/',
24 'mediagoblin.user_pages.views:media_home')
26 add_route('mediagoblin.user_pages.media_home.report_media',
27 '/u/<string:user>/m/<string:media>/report/',
28 'mediagoblin.user_pages.views:file_a_report')
30 add_route('mediagoblin.user_pages.media_confirm_delete',
31 '/u/<string:user>/m/<int:media_id>/confirm-delete/',
32 'mediagoblin.user_pages.views:media_confirm_delete')
34 add_route('mediagoblin.user_pages.activity_view',
35 '/<string:username>/activity/<string:id>/',
36 'mediagoblin.user_pages.views:activity_view')
38 # Submission handling of new comments. TODO: only allow for POST methods
39 add_route('mediagoblin.user_pages.media_post_comment',
40 '/u/<string:user>/m/<int:media_id>/comment/add/',
41 'mediagoblin.user_pages.views:media_post_comment')
43 add_route('mediagoblin.user_pages.media_preview_comment',
44 '/ajax/comment/preview/',
45 'mediagoblin.user_pages.views:media_preview_comment')
47 add_route('mediagoblin.user_pages.user_gallery',
48 '/u/<string:user>/gallery/',
49 'mediagoblin.user_pages.views:user_gallery')
51 add_route('mediagoblin.user_pages.media_home.view_comment',
52 '/u/<string:user>/m/<string:media>/c/<int:comment>/',
53 'mediagoblin.user_pages.views:media_home')
55 add_route('mediagoblin.user_pages.media_home.report_comment',
56 '/u/<string:user>/m/<string:media>/c/<int:comment>/report/',
57 'mediagoblin.user_pages.views:file_a_report')
59 # User's tags gallery
60 add_route('mediagoblin.user_pages.user_tag_gallery',
61 '/u/<string:user>/tag/<string:tag>/',
62 'mediagoblin.user_pages.views:user_gallery')
64 add_route('mediagoblin.user_pages.atom_feed',
65 '/u/<string:user>/atom/',
66 'mediagoblin.user_pages.views:atom_feed')
68 add_route('mediagoblin.user_pages.media_collect',
69 '/u/<string:user>/m/<int:media_id>/collect/',
70 'mediagoblin.user_pages.views:media_collect')
72 add_route('mediagoblin.user_pages.collection_list',
73 '/u/<string:user>/collections/',
74 'mediagoblin.user_pages.views:collection_list')
76 add_route('mediagoblin.user_pages.user_collection',
77 '/u/<string:user>/collection/<string:collection>/',
78 'mediagoblin.user_pages.views:user_collection')
80 add_route('mediagoblin.edit.edit_collection',
81 '/u/<string:user>/c/<string:collection>/edit/',
82 'mediagoblin.edit.views:edit_collection')
84 add_route('mediagoblin.user_pages.collection_confirm_delete',
85 '/u/<string:user>/c/<string:collection>/confirm-delete/',
86 'mediagoblin.user_pages.views:collection_confirm_delete')
88 add_route('mediagoblin.user_pages.collection_item_confirm_remove',
89 '/u/<string:user>/collection/<string:collection>/<string:collection_item>/confirm_remove/',
90 'mediagoblin.user_pages.views:collection_item_confirm_remove')
92 add_route('mediagoblin.user_pages.collection_atom_feed',
93 '/u/<string:user>/collection/<string:collection>/atom/',
94 'mediagoblin.user_pages.views:collection_atom_feed')
96 add_route('mediagoblin.user_pages.processing_panel',
97 '/u/<string:user>/panel/',
98 'mediagoblin.user_pages.views:processing_panel')
100 # Stray edit routes
101 add_route('mediagoblin.edit.edit_media',
102 '/u/<string:user>/m/<int:media_id>/edit/',
103 'mediagoblin.edit.views:edit_media')
105 add_route('mediagoblin.edit.attachments',
106 '/u/<string:user>/m/<int:media_id>/attachments/',
107 'mediagoblin.edit.views:edit_attachments')
109 add_route('mediagoblin.edit.metadata',
110 '/u/<string:user>/m/<int:media_id>/metadata/',
111 'mediagoblin.edit.views:edit_metadata')