la-chariotte/la_chariotte/urls.py

156 lines
5 KiB
Python

"""la_chariotte URL Configuration
"""
from django.contrib import admin
from django.contrib.auth.views import (
PasswordResetCompleteView,
PasswordResetConfirmView,
PasswordResetDoneView,
)
from django.urls import include, path
from django.views.generic.base import TemplateView
from la_chariotte import settings
from la_chariotte.order.views import JoinGroupedOrderView
from la_chariotte.views import accounts, orders
urlpatterns = [
path("admin/", admin.site.urls),
path(
"commande/",
[
path("", orders.IndexView.as_view(), name="index"),
path(
"<str:code>/",
orders.GroupedOrderDetailView.as_view(),
name="grouped_order_detail",
),
path(
"<str:code>/ics/",
orders.GroupedOrderEventView.as_view(),
name="grouped_order_event",
),
path(
"<str:code>/gerer",
orders.GroupedOrderOverview.as_view(),
name="grouped_order_overview",
),
path("<str:code>/commander/", orders.place_order, name="order"),
path(
"<str:code>/<int:pk>/confirmation/",
orders.OrderDetailView.as_view(),
name="order_confirm",
),
path(
"<str:code>/gerer/<int:pk>/supprimer",
orders.OrderDeleteView.as_view(),
name="order_delete",
),
path(
"creer",
orders.GroupedOrderCreateView.as_view(),
name="create_grouped_order",
),
path(
"<str:code>/gerer-produits",
orders.GroupedOrderAddItemsView.as_view(),
name="manage_items",
),
path(
"<str:code>/modifier",
orders.GroupedOrderUpdateView.as_view(),
name="update_grouped_order",
),
path(
"<str:code>/supprimer",
orders.GroupedOrderDeleteView.as_view(),
name="delete_grouped_order",
),
path(
"<str:code>/dupliquer",
orders.GroupedOrderDuplicateView.as_view(),
name="duplicate_grouped_order",
),
path(
"<str:code>/gerer-produits/nouveau",
orders.ItemCreateView.as_view(),
name="item_create",
),
path(
"<str:code>/gerer-produits/<int:pk>/supprimer",
orders.ItemDeleteView.as_view(),
name="item_delete",
),
path(
"<str:code>/gerer/imprimer",
orders.DownloadGroupedordersheetView.as_view(),
name="grouped_order_sheet",
),
path(
"<str:code>/gerer/liste-mails",
orders.ExportGroupOrderEmailAdressesToDownloadView.as_view(),
name="email_list",
),
path(
"<str:code>/gerer/csv",
orders.ExportGroupedOrderToCSVView.as_view(),
name="grouped_order_csv_export",
),
],
),
path("comptes/", include("django.contrib.auth.urls")),
path("comptes/inscription/", accounts.SignUpView.as_view(), name="signup"),
# Some paths for accounts are easier to leave here
# - PasswordResetView sends the mail
# - PasswordResetDoneView shows a success message for the above
# - PasswordResetConfirmView checks the link the user clicked and
# prompts for a new password
# - PasswordResetCompleteView shows a success message for the above
path(
"comptes/reinitialisation/<uidb64>/<token>/",
PasswordResetConfirmView.as_view(),
name="password_reset_confirm",
),
path(
"comptes/reinitialisation/mail-envoyé/",
PasswordResetDoneView.as_view(),
name="password_reset_done",
),
path(
"comptes/reinitialisation/terminé/",
PasswordResetCompleteView.as_view(),
name="password_reset_complete",
),
path(
"",
JoinGroupedOrderView.as_view(template_name="dashboard.html"),
name="dashboard",
),
path(
"mode-d-emploi",
TemplateView.as_view(template_name="help/notice.html"),
name="notice",
),
path(
"mentions-legales",
TemplateView.as_view(
template_name="help/legal_notice.html",
extra_context={
"gitlab": settings.GITLAB_LINK,
"mail": settings.CONTACT_MAIL,
},
),
name="legal_notice",
),
path(
"la-chariotte-c-est-quoi",
TemplateView.as_view(
template_name="help/about_chariotte.html",
extra_context={
"gitlab": settings.GITLAB_LINK,
"mail": settings.CONTACT_MAIL,
},
),
name="about_chariotte",
),
]