Implement support for sets and other improvements (#34)

* Add a boolean to define item as part of a set
* Add contextual help in admin
* Introduce support to sets and to item code lookup
Also review the url path for pagination
This commit is contained in:
2024-04-21 00:31:52 +02:00
committed by GitHub
parent b37f5420c5
commit e4ad98fa38
14 changed files with 275 additions and 28 deletions

View File

@@ -4,6 +4,7 @@ from portal.views import (
GetData,
GetRoster,
GetObjectsFiltered,
GetManufacturerItem,
GetFlatpage,
GetRollingStock,
GetConsist,
@@ -20,7 +21,11 @@ from portal.views import (
urlpatterns = [
path("", GetData.as_view(template="home.html"), name="index"),
path("roster", GetRoster.as_view(), name="roster"),
path("roster/<int:page>", GetRoster.as_view(), name="roster_pagination"),
path(
"roster/page/<int:page>",
GetRoster.as_view(),
name="roster_pagination"
),
path(
"page/<str:flatpage>",
GetFlatpage.as_view(),
@@ -32,13 +37,13 @@ urlpatterns = [
name="consists"
),
path(
"consists/<int:page>",
"consists/page/<int:page>",
Consists.as_view(template="consists.html"),
name="consists_pagination"
),
path("consist/<uuid:uuid>", GetConsist.as_view(), name="consist"),
path(
"consist/<uuid:uuid>/<int:page>",
"consist/<uuid:uuid>/page/<int:page>",
GetConsist.as_view(),
name="consist_pagination",
),
@@ -48,7 +53,7 @@ urlpatterns = [
name="companies"
),
path(
"companies/<int:page>",
"companies/page/<int:page>",
Companies.as_view(template="companies.html"),
name="companies_pagination",
),
@@ -58,7 +63,7 @@ urlpatterns = [
name="manufacturers"
),
path(
"manufacturers/<str:category>/<int:page>",
"manufacturers/<str:category>/page/<int:page>",
Manufacturers.as_view(template="manufacturers.html"),
name="manufacturers_pagination",
),
@@ -68,7 +73,7 @@ urlpatterns = [
name="scales"
),
path(
"scales/<int:page>",
"scales/page/<int:page>",
Scales.as_view(template="scales.html"),
name="scales_pagination"
),
@@ -78,7 +83,7 @@ urlpatterns = [
name="types"
),
path(
"types/<int:page>",
"types/page/<int:page>",
Types.as_view(template="types.html"),
name="types_pagination"
),
@@ -88,7 +93,7 @@ urlpatterns = [
name="books"
),
path(
"bookshelf/books/<int:page>",
"bookshelf/books/page/<int:page>",
Books.as_view(template="bookshelf/books.html"),
name="books_pagination"
),
@@ -99,17 +104,37 @@ urlpatterns = [
name="search",
),
path(
"search/<str:search>/<int:page>",
"search/<str:search>/page/<int:page>",
SearchObjects.as_view(),
name="search_pagination",
),
path(
"manufacturer/<str:manufacturer>",
GetManufacturerItem.as_view(),
name="manufacturer",
),
path(
"manufacturer/<str:manufacturer>/page/<int:page>",
GetManufacturerItem.as_view(),
name="manufacturer_pagination",
),
path(
"manufacturer/<str:manufacturer>/<str:search>",
GetManufacturerItem.as_view(),
name="manufacturer",
),
path(
"manufacturer/<str:manufacturer>/<str:search>/page/<int:page>",
GetManufacturerItem.as_view(),
name="manufacturer_pagination",
),
path(
"<str:_filter>/<str:search>",
GetObjectsFiltered.as_view(),
name="filtered",
),
path(
"<str:_filter>/<str:search>/<int:page>",
"<str:_filter>/<str:search>/page/<int:page>",
GetObjectsFiltered.as_view(),
name="filtered_pagination",
),