timetracker/games/urls.py

155 lines
4.9 KiB
Python
Raw Normal View History

2022-12-31 13:18:27 +00:00
from django.urls import path
2024-08-11 16:34:50 +00:00
from games import (
deviceviews,
2024-08-11 18:21:27 +00:00
editionviews,
2024-08-11 16:34:50 +00:00
gameviews,
platformviews,
purchaseviews,
sessionviews,
views,
)
2022-12-31 13:18:27 +00:00
urlpatterns = [
2023-02-18 19:50:36 +00:00
path("", views.index, name="index"),
2024-08-12 19:42:34 +00:00
path("device/add", deviceviews.add_device, name="add_device"),
2024-08-11 15:53:36 +00:00
path(
"device/delete/<int:device_id>", deviceviews.delete_device, name="delete_device"
),
path("device/edit/<int:device_id>", deviceviews.edit_device, name="edit_device"),
path("device/list", deviceviews.list_devices, name="list_devices"),
2024-08-12 19:42:34 +00:00
path("edition/add", editionviews.add_edition, name="add_edition"),
2023-02-18 19:50:36 +00:00
path(
2024-06-03 16:18:58 +00:00
"edition/add/for-game/<int:game_id>",
2024-08-12 19:42:34 +00:00
editionviews.add_edition,
2024-06-03 16:18:58 +00:00
name="add_edition_for_game",
2023-02-18 19:50:36 +00:00
),
2024-08-12 19:42:34 +00:00
path(
"edition/<int:edition_id>/edit", editionviews.edit_edition, name="edit_edition"
),
2024-08-11 18:21:27 +00:00
path("edition/list", editionviews.list_editions, name="list_editions"),
path(
"edition/<int:edition_id>/delete",
editionviews.delete_edition,
name="delete_edition",
),
2024-08-12 19:42:34 +00:00
path("game/add", gameviews.add_game, name="add_game"),
path("game/<int:game_id>/edit", gameviews.edit_game, name="edit_game"),
path("game/<int:game_id>/view", gameviews.view_game, name="view_game"),
path("game/<int:game_id>/delete", gameviews.delete_game, name="delete_game"),
2024-08-11 16:21:11 +00:00
path("game/list", gameviews.list_games, name="list_games"),
2024-08-12 19:42:34 +00:00
path("platform/add", platformviews.add_platform, name="add_platform"),
path(
"platform/<int:platform_id>/edit",
platformviews.edit_platform,
name="edit_platform",
),
2024-08-11 16:34:50 +00:00
path(
"platform/<int:platform_id>/delete",
platformviews.delete_platform,
name="delete_platform",
),
path("platform/list", platformviews.list_platforms, name="list_platforms"),
2024-08-12 19:42:34 +00:00
path("purchase/add", purchaseviews.add_purchase, name="add_purchase"),
path(
"purchase/<int:purchase_id>/edit",
purchaseviews.edit_purchase,
name="edit_purchase",
),
2024-06-03 16:18:58 +00:00
path(
"purchase/<int:purchase_id>/delete",
2024-08-12 19:42:34 +00:00
purchaseviews.delete_purchase,
2024-06-03 16:18:58 +00:00
name="delete_purchase",
),
2024-08-08 18:17:43 +00:00
path(
"purchase/list",
purchaseviews.list_purchases,
name="list_purchases",
),
2024-06-03 16:18:58 +00:00
path(
"purchase/related-purchase-by-edition",
2024-08-12 19:42:34 +00:00
purchaseviews.related_purchase_by_edition,
2024-06-03 16:18:58 +00:00
name="related_purchase_by_edition",
),
path(
"purchase/add/for-edition/<int:edition_id>",
2024-08-12 19:42:34 +00:00
purchaseviews.add_purchase,
2024-06-03 16:18:58 +00:00
name="add_purchase_for_edition",
),
2024-08-12 19:42:34 +00:00
path("session/add", sessionviews.add_session, name="add_session"),
2023-11-09 20:01:01 +00:00
path(
2024-06-03 16:04:49 +00:00
"session/add/for-purchase/<int:purchase_id>",
2024-08-12 19:42:34 +00:00
sessionviews.add_session,
2023-11-09 20:01:01 +00:00
name="add_session_for_purchase",
),
path(
2024-06-03 16:04:49 +00:00
"session/add/from-game/<int:session_id>",
2024-08-12 19:42:34 +00:00
sessionviews.new_session_from_existing_session,
{"template": "view_game.html#session-info"},
name="view_game_start_session_from_session",
),
path(
2024-06-03 16:04:49 +00:00
"session/add/from-list/<int:session_id>",
2024-08-12 19:42:34 +00:00
sessionviews.new_session_from_existing_session,
{"template": "list_sessions.html#session-row"},
name="list_sessions_start_session_from_session",
),
2024-08-12 19:42:34 +00:00
path(
"session/<int:session_id>/edit", sessionviews.edit_session, name="edit_session"
),
2024-06-03 16:18:58 +00:00
path(
"session/<int:session_id>/delete",
2024-08-12 19:42:34 +00:00
sessionviews.delete_session,
2024-06-03 16:18:58 +00:00
name="delete_session",
),
path(
"session/end/from-game/<int:session_id>",
2024-08-12 19:42:34 +00:00
sessionviews.end_session,
{"template": "view_game.html#session-info"},
name="view_game_end_session",
),
path(
"session/end/from-list/<int:session_id>",
2024-08-12 19:42:34 +00:00
sessionviews.end_session,
{"template": "list_sessions.html#session-row"},
name="list_sessions_end_session",
),
2024-08-11 15:22:58 +00:00
path("session/list", sessionviews.list_sessions, name="list_sessions"),
2024-06-03 16:07:10 +00:00
path(
2024-06-03 16:04:49 +00:00
"session/list/by-purchase/<int:purchase_id>",
2024-08-12 19:42:34 +00:00
sessionviews.list_sessions,
{"filter": "purchase"},
name="list_sessions_by_purchase",
),
path(
2024-06-03 16:04:49 +00:00
"session/list/by-platform/<int:platform_id>",
2024-08-12 19:42:34 +00:00
sessionviews.list_sessions,
{"filter": "platform"},
name="list_sessions_by_platform",
),
path(
2024-06-03 16:04:49 +00:00
"session/list/by-game/<int:game_id>",
2024-08-12 19:42:34 +00:00
sessionviews.list_sessions,
{"filter": "game"},
name="list_sessions_by_game",
),
path(
2024-06-03 16:04:49 +00:00
"session/list/by-edition/<int:edition_id>",
2024-08-12 19:42:34 +00:00
sessionviews.list_sessions,
2023-02-18 19:49:46 +00:00
{"filter": "edition"},
name="list_sessions_by_edition",
2023-01-03 18:03:30 +00:00
),
path(
2024-06-03 16:04:49 +00:00
"session/list/by-ownership/<str:ownership_type>",
2024-08-12 19:42:34 +00:00
sessionviews.list_sessions,
{"filter": "ownership_type"},
name="list_sessions_by_ownership_type",
),
2024-08-04 20:40:37 +00:00
path("stats/", views.stats_alltime, name="stats_alltime"),
2023-11-01 19:18:39 +00:00
path(
"stats/<int:year>",
views.stats,
name="stats_by_year",
),
2022-12-31 13:18:27 +00:00
]