Files
interchan/board/urls.py
Alek Ratzloff 0ac383ce6c Update PostModifyForm to use permissions to create its fields
Fields are only displayed via the PostModifyForm if the user has
specific permissions to do things, like set stickies.

Also, add PostModifySuccessView that will close the modify window when
the process is complete.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2022-06-30 18:16:08 -07:00

31 lines
1.4 KiB
Python

from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from board.views import *
app_name = "board"
urlpatterns = [
# Board views
path("<slug:url>/", BoardView.as_view(), name="board_detail"),
path("<slug:url>/page/<int:page>/", BoardView.as_view(), name="board_detail"),
path("<slug:url>/post/<int:id>/", PostView.as_view(), name="post_detail"),
path("<slug:url>/post/create/", PostCreateView.as_view(), name="post_create"),
path("<slug:url>/reply/<int:id>/", ReplyCreateView.as_view(), name="reply_create"),
path("post/success/", PostSuccessView.as_view(), name="post_success"),
# Reports
path("report/<slug:url>/<int:id>/", ReportView.as_view(), name="report_form"),
path("report/success/", ReportSuccessView.as_view(), name="report_success"),
# Bans
path("ban/<slug:url>/<int:id>/", BanCreateView.as_view(), name="ban_create"),
path("ban/success/", BanSuccessView.as_view(), name="ban_success"),
path("banned", BannedView.as_view(), name="banned"),
# Other moderation pages
path("modify/<int:pk>/", PostModifyView.as_view(), name="post_modify"),
path(
"modify/success/", PostModifySuccessView.as_view(), name="post_modify_success"
),
]
# TODO - make this conditional so we can serve images up with whatever server we want
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)