from django.urls import path

from . import apps
from . import views
from .views import (
    AttachmentCreateView,
    AttachmentUpdateView,
    EtherpadCreateView,
    FileUploadCreateView,
    TaskCreateView,
    TopicCreateView,
    TopicUpdateView,
)


app_name = apps.InternConfig.name

urlpatterns = [
    path("", views.index, name="index"),
    path(
        "<slug:topic_group>/topic-create/",
        TopicCreateView.as_view(),
        name="topic-create",
    ),
    path("<slug:slug>/", views.show_topic, name="topic"),
    path(
        "<slug:slug>/update/",
        TopicUpdateView.as_view(),
        name="topic-update",
    ),
    path(
        "<slug:slug>/attachment-create/",
        AttachmentCreateView.as_view(),
        name="attachment-create",
    ),
    path("<slug:slug>/create/", TaskCreateView.as_view(), name="task-create"),
    path("<slug:topic_slug>/<slug:slug>/", views.show_attachment, name="attachment"),
    path(
        "<slug:topic_slug>/<slug:slug>/update/",
        AttachmentUpdateView.as_view(),
        name="attachment-update",
    ),
    path(
        "<slug:topic_slug>/<slug:slug>/etherpad-create/",
        EtherpadCreateView.as_view(),
        name="etherpad-create",
    ),
    path(
        "<slug:topic_slug>/<slug:slug>/file-create/",
        FileUploadCreateView.as_view(),
        name="file-create",
    ),
]
