Major templates and views refactoring

This commit is contained in:
2023-01-08 00:40:13 +01:00
parent 9279142a41
commit 9dfa9172f4
13 changed files with 212 additions and 332 deletions

View File

@@ -1,8 +1,9 @@
from django.urls import path
from portal.views import (
GetHome,
GetHomeFiltered,
GetData,
GetRoster,
GetRosterFiltered,
GetFlatpage,
GetRollingStock,
GetConsist,
@@ -13,8 +14,9 @@ from portal.views import (
)
urlpatterns = [
path("", GetHome.as_view(), name="index"),
path("<int:page>", GetHome.as_view(), name="index_pagination"),
path("", GetData.as_view(), name="index"),
path("roster", GetRoster.as_view(), name="roster"),
path("roster/<int:page>", GetRoster.as_view(), name="roster_pagination"),
path(
"page/<str:flatpage>",
GetFlatpage.as_view(),
@@ -22,7 +24,7 @@ urlpatterns = [
),
path(
"search",
GetHomeFiltered.as_view(http_method_names=["post"]),
GetRosterFiltered.as_view(http_method_names=["post"]),
name="search",
),
path("consists", Consists.as_view(), name="consists"),
@@ -55,12 +57,12 @@ urlpatterns = [
path("scales/<int:page>", Scales.as_view(), name="scales_pagination"),
path(
"<str:_filter>/<str:search>",
GetHomeFiltered.as_view(),
GetRosterFiltered.as_view(),
name="filtered",
),
path(
"<str:_filter>/<str:search>/<int:page>",
GetHomeFiltered.as_view(),
GetRosterFiltered.as_view(),
name="filtered_pagination",
),
path("<uuid:uuid>", GetRollingStock.as_view(), name="rolling_stock"),