SciPost Code Repository

Skip to content
Snippets Groups Projects
urls.py 3.51 KiB
Newer Older
Jean-Sébastien Caux's avatar
Jean-Sébastien Caux committed
__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"


from django.urls import path, include
from django.views.generic import TemplateView

Jean-Sébastien Caux's avatar
Jean-Sébastien Caux committed

from . import views

app_name = "forums"
Jean-Sébastien Caux's avatar
Jean-Sébastien Caux committed
urlpatterns = [
        "forum/<str:parent_model>/<int:parent_id>/add/",
        views.ForumCreateView.as_view(),
        name="forum_create",
    path("add/", views.ForumCreateView.as_view(), name="forum_create"),
        "meeting/<str:parent_model>/<int:parent_id>/add/",
        views.MeetingCreateView.as_view(),
        name="meeting_create",
    path("meeting/add/", views.MeetingCreateView.as_view(), name="meeting_create"),
        "<slug:slug>/",
        include([
            path(
                "",
                views.ForumDetailView.as_view(),
                name="forum_detail",
            ),
            path(
                "quicklinks/all",
                views.HX_ForumQuickLinksAllView.as_view(),
                name="_hx_forum_quick_links_all",
            ),
            path(
                "quicklinks/followups",
                views.HX_ForumQuickLinksFollowupsView.as_view(),
                name="_hx_forum_quick_links_followups",
            ),
            path(
                "_hx_thread_from_post/<int:post_id>",
                views._hx_thread_from_post,
                name="_hx_thread_from_post",
            ),
            path(
                "update/",
                views.ForumUpdateView.as_view(),
                name="forum_update",
            ),
            path(
                "delete/",
                views.ForumDeleteView.as_view(),
                name="forum_delete",
            ),
            path(
                "permissions/",
                include([
                    path(
                        "",
                        views.ForumPermissionsView.as_view(),
                        name="forum_permissions",
                    ),
                    path(
                        "<int:group_id>/",
                        views.ForumPermissionsView.as_view(),
                        name="forum_permissions",
                    ),
                    path(
                        "_hx_forum_permissions/",
                        views.HX_ForumPermissionsView.as_view(),
                        name="_hx_forum_permissions",
                    ),
                ]),
            ),
                (
                    "_hx_post_form/<str:parent_model>/<int:parent_id>/"
                    "<str:origin>/<str:target>/<str:text>/"
                include([
                    path(
                        "button",
                        views._hx_post_form_button,
                        name="_hx_post_form_button",
                    ),
                    path(
                        "",
                        views._hx_post_form,
                        name="_hx_post_form",
                    ),
                ]),
            ),
Jean-Sébastien Caux's avatar
Jean-Sébastien Caux committed
    ),
    path("", views.ForumListView.as_view(), name="forums"),
        "<slug:slug>/motion/<str:parent_model>/<int:parent_id>/add/",
        views.MotionCreateView.as_view(),
        name="motion_create",
        "<slug:slug>/motion/<str:parent_model>/<int:parent_id>/add/confirm/",
        views.MotionConfirmCreateView.as_view(),
        name="motion_confirm_create",
        "<slug:slug>/motion/<int:motion_id>/<str:vote>/",
        views.motion_vote,
        name="motion_vote",
Jean-Sébastien Caux's avatar
Jean-Sébastien Caux committed
]