routing.py 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # GNU MediaGoblin -- federated, autonomous media hosting
  2. # Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
  3. #
  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.
  8. #
  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.
  13. #
  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/>.
  16. from mediagoblin.tools.routing import add_route
  17. add_route('mediagoblin.user_pages.user_home',
  18. '/u/<string:user>/', 'mediagoblin.user_pages.views:user_home')
  19. add_route('mediagoblin.user_pages.media_home',
  20. '/u/<string:user>/m/<string:media>/',
  21. 'mediagoblin.user_pages.views:media_home')
  22. add_route('mediagoblin.user_pages.media_home.report_media',
  23. '/u/<string:user>/m/<string:media>/report/',
  24. 'mediagoblin.user_pages.views:file_a_report')
  25. add_route('mediagoblin.user_pages.media_confirm_delete',
  26. '/u/<string:user>/m/<int:media_id>/confirm-delete/',
  27. 'mediagoblin.user_pages.views:media_confirm_delete')
  28. add_route('mediagoblin.user_pages.activity_view',
  29. '/<string:username>/activity/<string:id>/',
  30. 'mediagoblin.user_pages.views:activity_view')
  31. # Submission handling of new comments. TODO: only allow for POST methods
  32. add_route('mediagoblin.user_pages.media_post_comment',
  33. '/u/<string:user>/m/<int:media_id>/comment/add/',
  34. 'mediagoblin.user_pages.views:media_post_comment')
  35. add_route('mediagoblin.user_pages.media_preview_comment',
  36. '/ajax/comment/preview/',
  37. 'mediagoblin.user_pages.views:media_preview_comment')
  38. add_route('mediagoblin.user_pages.user_gallery',
  39. '/u/<string:user>/gallery/',
  40. 'mediagoblin.user_pages.views:user_gallery')
  41. add_route('mediagoblin.user_pages.media_home.view_comment',
  42. '/u/<string:user>/m/<string:media>/c/<int:comment>/',
  43. 'mediagoblin.user_pages.views:media_home')
  44. add_route('mediagoblin.user_pages.media_home.report_comment',
  45. '/u/<string:user>/m/<string:media>/c/<int:comment>/report/',
  46. 'mediagoblin.user_pages.views:file_a_report')
  47. # User's tags gallery
  48. add_route('mediagoblin.user_pages.user_tag_gallery',
  49. '/u/<string:user>/tag/<string:tag>/',
  50. 'mediagoblin.user_pages.views:user_gallery')
  51. add_route('mediagoblin.user_pages.atom_feed',
  52. '/u/<string:user>/atom/',
  53. 'mediagoblin.user_pages.views:atom_feed')
  54. add_route('mediagoblin.user_pages.media_collect',
  55. '/u/<string:user>/m/<int:media_id>/collect/',
  56. 'mediagoblin.user_pages.views:media_collect')
  57. add_route('mediagoblin.user_pages.collection_list',
  58. '/u/<string:user>/collections/',
  59. 'mediagoblin.user_pages.views:collection_list')
  60. add_route('mediagoblin.user_pages.user_collection',
  61. '/u/<string:user>/collection/<string:collection>/',
  62. 'mediagoblin.user_pages.views:user_collection')
  63. add_route('mediagoblin.edit.edit_collection',
  64. '/u/<string:user>/c/<string:collection>/edit/',
  65. 'mediagoblin.edit.views:edit_collection')
  66. add_route('mediagoblin.user_pages.collection_confirm_delete',
  67. '/u/<string:user>/c/<string:collection>/confirm-delete/',
  68. 'mediagoblin.user_pages.views:collection_confirm_delete')
  69. add_route('mediagoblin.user_pages.collection_item_confirm_remove',
  70. '/u/<string:user>/collection/<string:collection>/<string:collection_item>/confirm_remove/',
  71. 'mediagoblin.user_pages.views:collection_item_confirm_remove')
  72. add_route('mediagoblin.user_pages.collection_atom_feed',
  73. '/u/<string:user>/collection/<string:collection>/atom/',
  74. 'mediagoblin.user_pages.views:collection_atom_feed')
  75. add_route('mediagoblin.user_pages.processing_panel',
  76. '/u/<string:user>/panel/',
  77. 'mediagoblin.user_pages.views:processing_panel')
  78. # Stray edit routes
  79. add_route('mediagoblin.edit.edit_media',
  80. '/u/<string:user>/m/<int:media_id>/edit/',
  81. 'mediagoblin.edit.views:edit_media')
  82. add_route('mediagoblin.edit.attachments',
  83. '/u/<string:user>/m/<int:media_id>/attachments/',
  84. 'mediagoblin.edit.views:edit_attachments')
  85. add_route('mediagoblin.edit.metadata',
  86. '/u/<string:user>/m/<int:media_id>/metadata/',
  87. 'mediagoblin.edit.views:edit_metadata')