from django.urls import path, re_path

from . import apps
from . import views
from .utils import slug_calc, tag_complete

app_name = apps.PostsConfig.name

urlpatterns = [
    path("", views.index, name="posts.index"),
    # fet calendar (path have to be ahead posts.show)
    path("fet_calendar.ics", views.calendar, name="posts.calendar"),
    path("<str:id>", views.show, name="posts.show"),
    re_path(
        r"^(?P<id>[-\w]+)/agenda.pdf$",
        views.show_pdf_agenda,
        name="show_pdf_agenda",
    ),
    re_path(
        r"^(?P<id>[-\w]+)/protokoll.pdf$",
        views.show_pdf_protocol,
        name="show_pdf_protocol",
    ),
    path("t/<str:tag>", views.tags, name="posts.tags"),
    path("func/tag_complete", tag_complete),
    path("func/slug_calc", slug_calc),
]
