kpsul/kfet/urls.py

215 lines
7 KiB
Python
Raw Normal View History

2016-09-01 00:45:44 +02:00
# -*- coding: utf-8 -*-
2016-08-02 10:40:46 +02:00
from django.conf.urls import url
from django.contrib.auth.decorators import permission_required
2016-08-02 10:40:46 +02:00
from kfet import views
from kfet import autocomplete
from kfet.decorators import teamkfet_required
2016-08-02 10:40:46 +02:00
urlpatterns = [
url(r'^$', views.home,
2017-01-19 04:06:09 +01:00
name='kfet.home'),
url(r'^login/genericteam$', views.login_genericteam,
2017-01-19 04:06:09 +01:00
name='kfet.login.genericteam'),
url(r'^history$', views.history,
2017-01-19 04:06:09 +01:00
name='kfet.history'),
# -----
# Account urls
# -----
# Account - General
2016-08-11 15:14:23 +02:00
url(r'^accounts/$', views.account,
2017-01-19 04:06:09 +01:00
name='kfet.account'),
2016-08-11 15:14:23 +02:00
url(r'^accounts/is_validandfree$', views.account_is_validandfree_ajax,
2017-01-19 04:06:09 +01:00
name='kfet.account.is_validandfree.ajax'),
# Account - Create
2016-08-11 15:14:23 +02:00
url(r'^accounts/new$', views.account_create,
2017-01-19 04:06:09 +01:00
name='kfet.account.create'),
url(r'^accounts/new_special$', views.account_create_special,
2017-01-19 04:06:09 +01:00
name='kfet.account.create_special'),
2016-08-11 15:14:23 +02:00
url(r'^accounts/new/user/(?P<username>.+)$', views.account_create_ajax,
2017-01-19 04:06:09 +01:00
name='kfet.account.create.fromuser'),
url(r'^accounts/new/clipper/(?P<login_clipper>.+)$',
views.account_create_ajax,
name='kfet.account.create.fromclipper'),
2016-08-11 15:14:23 +02:00
url(r'^accounts/new/empty$', views.account_create_ajax,
2017-01-19 04:06:09 +01:00
name='kfet.account.create.empty'),
url(r'^autocomplete/account_new$', autocomplete.account_create,
2017-01-19 04:06:09 +01:00
name='kfet.account.create.autocomplete'),
# Account - Search
url(r'^autocomplete/account_search$', autocomplete.account_search,
name='kfet.account.search.autocomplete'),
# Account - Read
2016-08-11 15:14:23 +02:00
url(r'^accounts/(?P<trigramme>.{3})$', views.account_read,
2017-01-19 04:06:09 +01:00
name='kfet.account.read'),
# Account - Update
2016-08-11 15:14:23 +02:00
url(r'^accounts/(?P<trigramme>.{3})/edit$', views.account_update,
2017-01-19 04:06:09 +01:00
name='kfet.account.update'),
# Account - Groups
url(r'^accounts/groups$', views.account_group,
2017-01-19 04:06:09 +01:00
name='kfet.account.group'),
url(r'^accounts/groups/new$',
2017-01-19 04:06:09 +01:00
permission_required('kfet.manage_perms')
(views.AccountGroupCreate.as_view()),
name='kfet.account.group.create'),
url(r'^accounts/groups/(?P<pk>\d+)/edit$',
2017-01-19 04:06:09 +01:00
permission_required('kfet.manage_perms')
(views.AccountGroupUpdate.as_view()),
name='kfet.account.group.update'),
url(r'^accounts/negatives$',
2017-01-19 04:06:09 +01:00
permission_required('kfet.view_negs')
(views.AccountNegativeList.as_view()),
name='kfet.account.negative'),
# -----
# Checkout urls
# -----
# Checkout - General
2016-08-11 15:14:23 +02:00
url('^checkouts/$',
teamkfet_required(views.CheckoutList.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.checkout'),
# Checkout - Create
2016-08-11 15:14:23 +02:00
url('^checkouts/new$',
teamkfet_required(views.CheckoutCreate.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.checkout.create'),
# Checkout - Read
2016-08-11 15:14:23 +02:00
url('^checkouts/(?P<pk>\d+)$',
teamkfet_required(views.CheckoutRead.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.checkout.read'),
# Checkout - Update
2016-08-11 15:14:23 +02:00
url('^checkouts/(?P<pk>\d+)/edit$',
teamkfet_required(views.CheckoutUpdate.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.checkout.update'),
2017-01-19 04:06:09 +01:00
# -----
# Checkout Statement urls
# -----
2016-08-11 15:14:23 +02:00
# Checkout Statement - General
url('^checkouts/statements/$',
teamkfet_required(views.CheckoutStatementList.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.checkoutstatement'),
2016-08-11 15:14:23 +02:00
# Checkout Statement - Create
url('^checkouts/(?P<pk_checkout>\d+)/statements/add',
teamkfet_required(views.CheckoutStatementCreate.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.checkoutstatement.create'),
# Checkout Statement - Update
url('^checkouts/(?P<pk_checkout>\d+)/statements/(?P<pk>\d+)/edit',
teamkfet_required(views.CheckoutStatementUpdate.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.checkoutstatement.update'),
2016-08-11 15:14:23 +02:00
# -----
# Article urls
# -----
# Article - General
2016-08-11 15:14:23 +02:00
url('^articles/$',
teamkfet_required(views.ArticleList.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.article'),
# Article - Create
2016-08-11 15:14:23 +02:00
url('^articles/new$',
teamkfet_required(views.ArticleCreate.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.article.create'),
# Article - Read
2016-08-11 15:14:23 +02:00
url('^articles/(?P<pk>\d+)$',
teamkfet_required(views.ArticleRead.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.article.read'),
# Article - Update
2016-08-11 15:14:23 +02:00
url('^articles/(?P<pk>\d+)/edit$',
teamkfet_required(views.ArticleUpdate.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.article.update'),
# -----
# K-Psul urls
# -----
2017-01-19 04:06:09 +01:00
url('^k-psul/$', views.kpsul, name='kfet.kpsul'),
url('^k-psul/checkout_data$', views.kpsul_checkout_data,
2017-01-19 04:06:09 +01:00
name='kfet.kpsul.checkout_data'),
url('^k-psul/perform_operations$', views.kpsul_perform_operations,
2017-01-19 04:06:09 +01:00
name='kfet.kpsul.perform_operations'),
2016-08-09 11:02:26 +02:00
url('^k-psul/cancel_operations$', views.kpsul_cancel_operations,
2017-01-19 04:06:09 +01:00
name='kfet.kpsul.cancel_operations'),
url('^k-psul/articles_data', views.kpsul_articles_data,
2017-01-19 04:06:09 +01:00
name='kfet.kpsul.articles_data'),
url('^k-psul/update_addcost$', views.kpsul_update_addcost,
2017-01-19 04:06:09 +01:00
name='kfet.kpsul.update_addcost'),
url('^k-psul/get_settings$', views.kpsul_get_settings,
2017-01-19 04:06:09 +01:00
name='kfet.kpsul.get_settings'),
# -----
# JSON urls
# -----
2016-08-26 15:30:40 +02:00
url(r'^history.json$', views.history_json,
2017-01-19 04:06:09 +01:00
name='kfet.history.json'),
2016-08-26 15:30:40 +02:00
url(r'^accounts/read.json$', views.account_read_json,
2017-01-19 04:06:09 +01:00
name='kfet.account.read.json'),
2016-08-26 15:30:40 +02:00
# -----
# Settings urls
# -----
2016-08-26 15:30:40 +02:00
url(r'^settings/$',
2017-01-19 04:06:09 +01:00
permission_required('kfet.change_settings')
(views.SettingsList.as_view()),
name='kfet.settings'),
2016-08-26 15:30:40 +02:00
url(r'^settings/(?P<pk>\d+)/edit$',
2017-01-19 04:06:09 +01:00
permission_required('kfet.change_settings')
(views.SettingsUpdate.as_view()),
name='kfet.settings.update'),
2016-08-26 15:30:40 +02:00
# -----
# Transfers urls
# -----
2016-08-26 20:14:00 +02:00
url(r'^transfers/$', views.transfers,
2017-01-19 04:06:09 +01:00
name='kfet.transfers'),
2016-08-26 20:14:00 +02:00
url(r'^transfers/new$', views.transfers_create,
2017-01-19 04:06:09 +01:00
name='kfet.transfers.create'),
2016-08-26 15:30:40 +02:00
url(r'^transfers/perform$', views.perform_transfers,
2017-01-19 04:06:09 +01:00
name='kfet.transfers.perform'),
url(r'^transfers/cancel$', views.cancel_transfers,
2017-01-19 04:06:09 +01:00
name='kfet.transfers.cancel'),
# -----
# Inventories urls
# -----
url(r'^inventaires/$',
teamkfet_required(views.InventoryList.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.inventory'),
url(r'^inventaires/new$', views.inventory_create,
2017-01-19 04:06:09 +01:00
name='kfet.inventory.create'),
2016-08-30 23:32:54 +02:00
url(r'^inventaires/(?P<pk>\d+)$',
teamkfet_required(views.InventoryRead.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.inventory.read'),
# -----
# Order urls
# -----
url(r'^orders/$',
teamkfet_required(views.OrderList.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.order'),
url(r'^orders/(?P<pk>\d+)$',
teamkfet_required(views.OrderRead.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.order.read'),
url(r'^orders/suppliers/(?P<pk>\d+)/edit$',
teamkfet_required(views.SupplierUpdate.as_view()),
2017-01-19 04:06:09 +01:00
name='kfet.order.supplier.update'),
url(r'^orders/suppliers/(?P<pk>\d+)/new-order$', views.order_create,
2017-01-19 04:06:09 +01:00
name='kfet.order.new'),
url(r'^orders/(?P<pk>\d+)/to_inventory$', views.order_to_inventory,
2017-01-19 04:06:09 +01:00
name='kfet.order.to_inventory'),
2016-08-02 10:40:46 +02:00
]