2016-09-01 00:45:44 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
from __future__ import (absolute_import, division,
|
|
|
|
print_function, unicode_literals)
|
|
|
|
from builtins import *
|
|
|
|
|
2016-08-02 10:40:46 +02:00
|
|
|
from django.conf.urls import url
|
2016-08-04 05:21:04 +02:00
|
|
|
from django.contrib.auth.decorators import permission_required
|
2016-08-02 10:40:46 +02:00
|
|
|
from kfet import views
|
|
|
|
from kfet import autocomplete
|
2016-08-31 02:52:13 +02:00
|
|
|
from kfet.decorators import teamkfet_required
|
2016-08-02 10:40:46 +02:00
|
|
|
|
|
|
|
urlpatterns = [
|
2016-08-03 04:38:54 +02:00
|
|
|
url(r'^$', views.home,
|
|
|
|
name = 'kfet.home'),
|
2016-08-20 19:35:45 +02:00
|
|
|
url(r'^login/genericteam$', views.login_genericteam,
|
|
|
|
name = 'kfet.login.genericteam'),
|
2016-08-24 19:52:07 +02:00
|
|
|
url(r'^history$', views.history,
|
|
|
|
name = 'kfet.history'),
|
2016-08-03 04:38:54 +02:00
|
|
|
|
|
|
|
# -----
|
2016-08-04 05:21:04 +02:00
|
|
|
# Account urls
|
2016-08-03 04:38:54 +02:00
|
|
|
# -----
|
|
|
|
|
2016-08-04 05:21:04 +02:00
|
|
|
# Account - General
|
2016-08-11 15:14:23 +02:00
|
|
|
url(r'^accounts/$', views.account,
|
2016-08-03 06:33:27 +02:00
|
|
|
name = 'kfet.account'),
|
2016-08-11 15:14:23 +02:00
|
|
|
url(r'^accounts/is_validandfree$', views.account_is_validandfree_ajax,
|
2016-08-03 04:38:54 +02:00
|
|
|
name = 'kfet.account.is_validandfree.ajax'),
|
|
|
|
|
|
|
|
# Account - Create
|
2016-08-11 15:14:23 +02:00
|
|
|
url(r'^accounts/new$', views.account_create,
|
2016-08-03 04:38:54 +02:00
|
|
|
name = 'kfet.account.create'),
|
2016-09-05 07:31:54 +02:00
|
|
|
url(r'^accounts/new_special$', views.account_create_special,
|
|
|
|
name = 'kfet.account.create_special'),
|
2016-08-11 15:14:23 +02:00
|
|
|
url(r'^accounts/new/user/(?P<username>.+)$', views.account_create_ajax,
|
2016-08-03 04:38:54 +02:00
|
|
|
name = 'kfet.account.create.fromuser'),
|
2016-08-11 15:14:23 +02:00
|
|
|
url(r'^accounts/new/clipper/(?P<login_clipper>.+)$', views.account_create_ajax,
|
2016-08-03 04:38:54 +02:00
|
|
|
name = 'kfet.account.create.fromclipper'),
|
2016-08-11 15:14:23 +02:00
|
|
|
url(r'^accounts/new/empty$', views.account_create_ajax,
|
2016-08-03 04:38:54 +02:00
|
|
|
name = 'kfet.account.create.empty'),
|
|
|
|
url(r'^autocomplete/account_new$', autocomplete.account_create,
|
|
|
|
name = 'kfet.account.create.autocomplete'),
|
|
|
|
|
|
|
|
# Account - Read
|
2016-08-11 15:14:23 +02:00
|
|
|
url(r'^accounts/(?P<trigramme>.{3})$', views.account_read,
|
2016-08-03 04:38:54 +02: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,
|
2016-08-04 05:21:04 +02:00
|
|
|
name = 'kfet.account.update'),
|
|
|
|
|
2016-08-21 02:53:35 +02:00
|
|
|
# Account - Groups
|
|
|
|
url(r'^accounts/groups$', views.account_group,
|
|
|
|
name = 'kfet.account.group'),
|
2016-08-21 05:51:55 +02:00
|
|
|
url(r'^accounts/groups/new$',
|
|
|
|
permission_required('kfet.manage_perms')(views.AccountGroupCreate.as_view()),
|
|
|
|
name = 'kfet.account.group.create'),
|
|
|
|
url(r'^accounts/groups/(?P<pk>\d+)/edit$',
|
|
|
|
permission_required('kfet.manage_perms')(views.AccountGroupUpdate.as_view()),
|
|
|
|
name = 'kfet.account.group.update'),
|
2016-08-21 02:53:35 +02:00
|
|
|
|
2016-08-23 20:31:31 +02:00
|
|
|
url(r'^accounts/negatives$',
|
|
|
|
permission_required('kfet.view_negs')(views.AccountNegativeList.as_view()),
|
|
|
|
name = 'kfet.account.negative'),
|
|
|
|
|
2016-12-20 22:46:38 +01:00
|
|
|
# Account - Statistics
|
|
|
|
url('^accounts/(?P<trigramme>.{3})/stat/last/$',
|
|
|
|
views.AccountStatLastAll.as_view(),
|
|
|
|
name = 'kfet.account.stat.last'),
|
|
|
|
url('^accounts/(?P<trigramme>.{3})/stat/last/month/$',
|
|
|
|
views.AccountStatLastMonth.as_view(),
|
|
|
|
name = 'kfet.account.stat.last.month'),
|
|
|
|
url('^accounts/(?P<trigramme>.{3})/stat/last/week/$',
|
|
|
|
views.AccountStatLastWeek.as_view(),
|
|
|
|
name = 'kfet.account.stat.last.week'),
|
|
|
|
url('^accounts/(?P<trigramme>.{3})/stat/last/day/$',
|
|
|
|
views.AccountStatLastDay.as_view(),
|
|
|
|
name = 'kfet.account.stat.last.day'),
|
|
|
|
|
2016-12-21 11:51:08 +01:00
|
|
|
url('^accounts/(?P<trigramme>.{3})/stat/balance/$',
|
|
|
|
views.AccountStatBalanceAll.as_view(),
|
|
|
|
name = 'kfet.account.stat.balance'),
|
2017-01-24 16:54:02 +01:00
|
|
|
url('^accounts/(?P<trigramme>.{3})/stat/balance/d/(?P<nb_date>\d*)/$',
|
|
|
|
views.AccountStatBalance.as_view(),
|
|
|
|
name = 'kfet.account.stat.balance.days'),
|
2016-12-21 11:51:08 +01:00
|
|
|
url('^accounts/(?P<trigramme>.{3})/stat/balance/anytime/$',
|
2017-01-24 16:54:02 +01:00
|
|
|
views.AccountStatBalance.as_view(),
|
2016-12-21 11:51:08 +01:00
|
|
|
name = 'kfet.account.stat.balance.anytime'),
|
|
|
|
|
2016-08-04 05:21:04 +02:00
|
|
|
# -----
|
|
|
|
# Checkout urls
|
|
|
|
# -----
|
|
|
|
|
|
|
|
# Checkout - General
|
2016-08-11 15:14:23 +02:00
|
|
|
url('^checkouts/$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutList.as_view()),
|
2016-08-04 05:21:04 +02:00
|
|
|
name = 'kfet.checkout'),
|
|
|
|
# Checkout - Create
|
2016-08-11 15:14:23 +02:00
|
|
|
url('^checkouts/new$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutCreate.as_view()),
|
2016-08-04 05:21:04 +02:00
|
|
|
name = 'kfet.checkout.create'),
|
|
|
|
# Checkout - Read
|
2016-08-11 15:14:23 +02:00
|
|
|
url('^checkouts/(?P<pk>\d+)$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutRead.as_view()),
|
2016-08-04 05:21:04 +02:00
|
|
|
name = 'kfet.checkout.read'),
|
|
|
|
# Checkout - Update
|
2016-08-11 15:14:23 +02:00
|
|
|
url('^checkouts/(?P<pk>\d+)/edit$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutUpdate.as_view()),
|
2016-08-04 05:21:04 +02:00
|
|
|
name = 'kfet.checkout.update'),
|
2016-08-04 08:23:34 +02:00
|
|
|
|
2016-08-11 15:14:23 +02:00
|
|
|
### Checkout Statements urls
|
|
|
|
|
|
|
|
# Checkout Statement - General
|
|
|
|
url('^checkouts/statements/$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutStatementList.as_view()),
|
2016-08-11 15:14:23 +02:00
|
|
|
name = 'kfet.checkoutstatement'),
|
|
|
|
# Checkout Statement - Create
|
|
|
|
url('^checkouts/(?P<pk_checkout>\d+)/statements/add',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutStatementCreate.as_view()),
|
2016-08-11 15:14:23 +02:00
|
|
|
name = 'kfet.checkoutstatement.create'),
|
2016-08-23 00:15:17 +02:00
|
|
|
# Checkout Statement - Update
|
|
|
|
url('^checkouts/(?P<pk_checkout>\d+)/statements/(?P<pk>\d+)/edit',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.CheckoutStatementUpdate.as_view()),
|
2016-08-23 00:15:17 +02:00
|
|
|
name = 'kfet.checkoutstatement.update'),
|
2016-08-11 15:14:23 +02:00
|
|
|
|
2016-08-04 08:23:34 +02:00
|
|
|
# -----
|
|
|
|
# Article urls
|
|
|
|
# -----
|
|
|
|
|
|
|
|
# Article - General
|
2016-08-11 15:14:23 +02:00
|
|
|
url('^articles/$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.ArticleList.as_view()),
|
2016-08-04 08:23:34 +02:00
|
|
|
name = 'kfet.article'),
|
|
|
|
# Article - Create
|
2016-08-11 15:14:23 +02:00
|
|
|
url('^articles/new$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.ArticleCreate.as_view()),
|
2016-08-04 08:23:34 +02:00
|
|
|
name = 'kfet.article.create'),
|
|
|
|
# Article - Read
|
2016-08-11 15:14:23 +02:00
|
|
|
url('^articles/(?P<pk>\d+)$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.ArticleRead.as_view()),
|
2016-08-04 08:23:34 +02:00
|
|
|
name = 'kfet.article.read'),
|
|
|
|
# Article - Update
|
2016-08-11 15:14:23 +02:00
|
|
|
url('^articles/(?P<pk>\d+)/edit$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.ArticleUpdate.as_view()),
|
2016-08-04 08:23:34 +02:00
|
|
|
name = 'kfet.article.update'),
|
2016-12-09 21:45:34 +01:00
|
|
|
# Article - Statistics
|
2016-12-19 16:36:23 +01:00
|
|
|
url('^articles/(?P<pk>\d+)/stat/last/$',
|
2016-12-10 17:33:24 +01:00
|
|
|
views.ArticleStatLastAll.as_view(),
|
|
|
|
name = 'kfet.article.stat.last'),
|
2016-12-20 22:46:38 +01:00
|
|
|
url('^articles/(?P<pk>\d+)/stat/last/month/$',
|
|
|
|
views.ArticleStatLastMonth.as_view(),
|
|
|
|
name = 'kfet.article.stat.last.month'),
|
2016-12-19 16:36:23 +01:00
|
|
|
url('^articles/(?P<pk>\d+)/stat/last/week/$',
|
2016-12-10 17:33:24 +01:00
|
|
|
views.ArticleStatLastWeek.as_view(),
|
|
|
|
name = 'kfet.article.stat.last.week'),
|
2016-12-19 16:36:23 +01:00
|
|
|
url('^articles/(?P<pk>\d+)/stat/last/day/$',
|
2016-12-10 17:33:24 +01:00
|
|
|
views.ArticleStatLastDay.as_view(),
|
|
|
|
name = 'kfet.article.stat.last.day'),
|
2016-12-09 21:45:34 +01:00
|
|
|
|
2016-08-06 22:19:52 +02:00
|
|
|
# -----
|
|
|
|
# K-Psul urls
|
|
|
|
# -----
|
|
|
|
|
|
|
|
url('^k-psul/$', views.kpsul, name = 'kfet.kpsul'),
|
|
|
|
url('^k-psul/checkout_data$', views.kpsul_checkout_data,
|
|
|
|
name = 'kfet.kpsul.checkout_data'),
|
|
|
|
url('^k-psul/perform_operations$', views.kpsul_perform_operations,
|
|
|
|
name = 'kfet.kpsul.perform_operations'),
|
2016-08-09 11:02:26 +02:00
|
|
|
url('^k-psul/cancel_operations$', views.kpsul_cancel_operations,
|
|
|
|
name = 'kfet.kpsul.cancel_operations'),
|
2016-08-14 23:37:05 +02:00
|
|
|
url('^k-psul/articles_data', views.kpsul_articles_data,
|
2016-08-22 03:57:13 +02:00
|
|
|
name = 'kfet.kpsul.articles_data'),
|
2016-08-22 05:41:31 +02:00
|
|
|
url('^k-psul/update_addcost$', views.kpsul_update_addcost,
|
|
|
|
name = 'kfet.kpsul.update_addcost'),
|
2016-08-22 16:08:21 +02:00
|
|
|
url('^k-psul/get_settings$', views.kpsul_get_settings,
|
|
|
|
name = 'kfet.kpsul.get_settings'),
|
2016-08-22 03:57:13 +02:00
|
|
|
|
2016-08-24 02:05:05 +02:00
|
|
|
# -----
|
|
|
|
# JSON urls
|
|
|
|
# -----
|
|
|
|
|
2016-08-26 15:30:40 +02:00
|
|
|
url(r'^history.json$', views.history_json,
|
2016-08-24 02:05:05 +02:00
|
|
|
name = 'kfet.history.json'),
|
2016-08-26 15:30:40 +02:00
|
|
|
url(r'^accounts/read.json$', views.account_read_json,
|
|
|
|
name = 'kfet.account.read.json'),
|
|
|
|
|
2016-08-24 02:05:05 +02:00
|
|
|
|
2016-08-22 03:57:13 +02:00
|
|
|
# -----
|
|
|
|
# Settings urls
|
2016-08-24 02:05:05 +02:00
|
|
|
# -----
|
2016-08-22 03:57:13 +02:00
|
|
|
|
2016-08-26 15:30:40 +02:00
|
|
|
url(r'^settings/$',
|
2016-08-22 03:57:13 +02: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$',
|
2016-08-22 03:57:13 +02: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,
|
2016-08-26 15:30:40 +02:00
|
|
|
name = 'kfet.transfers'),
|
2016-08-26 20:14:00 +02:00
|
|
|
url(r'^transfers/new$', views.transfers_create,
|
2016-08-26 15:30:40 +02:00
|
|
|
name = 'kfet.transfers.create'),
|
|
|
|
url(r'^transfers/perform$', views.perform_transfers,
|
|
|
|
name = 'kfet.transfers.perform'),
|
2016-09-24 14:18:26 +02:00
|
|
|
url(r'^transfers/cancel$', views.cancel_transfers,
|
|
|
|
name = 'kfet.transfers.cancel'),
|
2016-08-27 14:12:01 +02:00
|
|
|
|
|
|
|
# -----
|
|
|
|
# Inventories urls
|
2016-08-27 22:55:31 +02:00
|
|
|
# -----
|
2016-08-27 14:12:01 +02:00
|
|
|
|
|
|
|
url(r'^inventaires/$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.InventoryList.as_view()),
|
2016-08-27 14:12:01 +02:00
|
|
|
name = 'kfet.inventory'),
|
|
|
|
url(r'^inventaires/new$', views.inventory_create,
|
|
|
|
name = 'kfet.inventory.create'),
|
2016-08-30 23:32:54 +02:00
|
|
|
url(r'^inventaires/(?P<pk>\d+)$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.InventoryRead.as_view()),
|
2016-08-30 23:32:54 +02:00
|
|
|
name = 'kfet.inventory.read'),
|
2016-08-27 22:55:31 +02:00
|
|
|
|
|
|
|
# -----
|
|
|
|
# Order urls
|
|
|
|
# -----
|
|
|
|
|
|
|
|
url(r'^orders/$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.OrderList.as_view()),
|
2016-08-27 22:55:31 +02:00
|
|
|
name = 'kfet.order'),
|
2016-08-30 15:35:30 +02:00
|
|
|
url(r'^orders/(?P<pk>\d+)$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.OrderRead.as_view()),
|
2016-08-28 05:39:34 +02:00
|
|
|
name = 'kfet.order.read'),
|
2016-08-27 22:55:31 +02:00
|
|
|
url(r'^orders/suppliers/(?P<pk>\d+)/edit$',
|
2016-08-31 02:52:13 +02:00
|
|
|
teamkfet_required(views.SupplierUpdate.as_view()),
|
2016-08-27 22:55:31 +02:00
|
|
|
name = 'kfet.order.supplier.update'),
|
2016-08-28 05:39:34 +02:00
|
|
|
url(r'^orders/suppliers/(?P<pk>\d+)/new-order$', views.order_create,
|
|
|
|
name = 'kfet.order.new'),
|
2016-08-30 15:35:30 +02:00
|
|
|
url(r'^orders/(?P<pk>\d+)/to_inventory$', views.order_to_inventory,
|
|
|
|
name = 'kfet.order.to_inventory'),
|
2016-08-02 10:40:46 +02:00
|
|
|
]
|