Add support for consist and minor improvements

This commit is contained in:
2022-04-19 19:18:31 +02:00
parent ef2a648667
commit 4989bac4a5
9 changed files with 391 additions and 68 deletions

View File

@@ -1,6 +1,12 @@
from django.urls import path
from portal.views import GetHome, GetHomeFiltered, GetRollingStock
from portal.views import (
GetHome,
GetHomeFiltered,
GetRollingStock,
GetConsist,
Consists,
)
urlpatterns = [
path("", GetHome.as_view(), name="index"),
@@ -8,15 +14,30 @@ urlpatterns = [
path(
"search",
GetHomeFiltered.as_view(http_method_names=["post"]),
name="index_filtered",
),
path(
"search/<str:search>", GetHomeFiltered.as_view(), name="index_filtered"
name="search",
),
path("search/<str:search>", GetHomeFiltered.as_view(), name="search"),
path(
"search/<str:search>/<int:page>",
GetHomeFiltered.as_view(),
name="index_filtered_pagination",
name="search_pagination",
),
path("consist", Consists.as_view(), name="consists"),
path("consist/<uuid:uuid>", GetConsist.as_view(), name="consist"),
path(
"consist/<uuid:uuid>/<int:page>",
GetConsist.as_view(),
name="consist_pagination",
),
path(
"<str:_filter>/<str:search>",
GetHomeFiltered.as_view(),
name="filtered",
),
path(
"<str:_filter>/<str:search>/<int:page>",
GetHomeFiltered.as_view(),
name="filtered_pagination",
),
path("<uuid:uuid>", GetRollingStock.as_view(), name="rolling_stock"),
]