urls.py 4.49 KB
Newer Older
Patrick Colmant's avatar
Patrick Colmant committed
1 2 3
from django.conf.urls import patterns, url
from repanier import views
from django.contrib.auth.decorators import login_required
4 5
from django.views.decorators.cache import cache_page, never_cache
from views import OrderView, PreOrderView
Patrick's avatar
Patrick committed
6 7
from views import CustomerInvoiceView
from views import ProducerInvoiceView
Patrick's avatar
Patrick committed
8
from views import PermanenceView
Patrick Colmant's avatar
Patrick Colmant committed
9
from picture.views import ajax_picture
10 11
from django.contrib.auth import views as auth_views
from repanier.forms import AuthRepanierPasswordResetForm, AuthRepanierSetPasswordForm
Patrick Colmant's avatar
Patrick Colmant committed
12

Patrick Colmant's avatar
Patrick Colmant committed
13
urlpatterns = patterns('',
Patrick's avatar
Patrick committed
14 15
    url(r'^go_repanier/$', views.login, name='login_form'),
    url(r'^leave_repanier/$', views.logout, name='logout_form'),
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
    url(r'^coordi/password_reset/$', auth_views.password_reset,
        {
            'post_reset_redirect': 'done/',
            'password_reset_form': AuthRepanierPasswordResetForm,
            'template_name': 'repanier/registration/password_reset_form.html'
        },
        name='admin_password_reset'),
    url(r'^coordi/password_reset/done/$', auth_views.password_reset_done,
        {
            'template_name': 'repanier/registration/password_reset_done.html'
        },
        name='password_reset_done'),
    url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$', auth_views.password_reset_confirm,
        {
            'set_password_form': AuthRepanierSetPasswordForm,
            'template_name': 'repanier/registration/password_reset_confirm.html'
        },
        name='password_reset_confirm'),
    url(r'^reset/done/$', auth_views.password_reset_complete,
        {
            'template_name': 'repanier/registration/password_reset_complete.html'
        },
        name='password_reset_complete'),
Patrick's avatar
Patrick committed
39

40 41
    url(r'^order/(?P<permanence_id>\d+)/$', OrderView.as_view(), name='order_view'),
    url(r'^basket/(?P<permanence_id>\d+)/$', never_cache(OrderView.as_view()), {'basket': True}, name='order_view_wo_cache'),
Patrick's avatar
Patrick committed
42 43 44 45 46 47 48 49 50

    url(r'^ajax/order/$', views.order_form_ajax, name='order_form_ajax'),
    url(r'^ajax/my-balance/$', views.my_balance_ajax, name='my_balance'),
    url(r'^ajax/order-name/$', views.customer_name_ajax, name='order_name'),
    url(r'^ajax/pre-order-name/(?P<offer_uuid>[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/$',
        views.producer_name_ajax, name='pre_order_name_ajax'),
    url(r'^ajax/order-init/$', views.order_init_ajax, name='order_init_ajax'),
    url(r'^ajax/order-select/$', views.order_select_ajax, name='order_select_ajax'),
    url(r'^ajax/permanence/$', views.permanence_form_ajax, name='permanence_form_ajax'),
51
    url(r'^ajax/basket-message/(?P<customer_id>\d+)/$', views.basket_message_form_ajax, name='basket_message_form_ajax'),
Patrick's avatar
Patrick committed
52
    url(r'^ajax/customer-product-description/$', views.customer_product_description_ajax, name='customer_product_description_ajax'),
53 54 55 56 57 58 59
    url(r'^ajax/pre-order-create-product/(?P<offer_uuid>[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/(?P<permanence_id>\d+)/$',
        views.pre_order_create_product_ajax, name='pre_order_create_product_ajax'),
    url(r'^ajax/pre-order-update-product/(?P<offer_uuid>[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/$',
        views.pre_order_update_product_ajax, name='pre_order_update_product_ajax'),
    url(r'^ajax/pre-order-update-product/(?P<offer_uuid>[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/(?P<offer_item_id>\d+)/$',
        views.pre_order_update_product_ajax, name='pre_order_update_product_ajax'),
    url('^ajax/upload-picture/(?P<upload_to>.*)/(?P<size>\d+)/$', ajax_picture, name='ajax_picture'),
Patrick's avatar
Patrick committed
60 61 62 63 64 65

    url(r'^permanence/$', login_required(PermanenceView.as_view()), name='permanence_view'),
    url(r'^customer-invoice/(?P<pk>\d+)/$', login_required(CustomerInvoiceView.as_view()), name='customer_invoice_view'),
    url(r'^producer-invoice/(?P<pk>\d+)/$', login_required(ProducerInvoiceView.as_view()), name='producer_invoice_view'),
    url(r'^producer-invoice/(?P<pk>\d+)/(?P<uuid>[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/$',
        ProducerInvoiceView.as_view(), name='producer_invoice_uuid_view'),
66 67
    url(r'^pre-order/(?P<offer_uuid>[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/$',
        never_cache(PreOrderView.as_view()), name='pre_order_uuid_view'),
Patrick's avatar
Patrick committed
68 69 70 71 72

    url(r'^coordinators/$', views.send_mail_to_coordinators, name='send_mail_to_coordinators_view'),
    url(r'^members/$', views.send_mail_to_all_members, name='send_mail_to_all_members_view'),
    url(r'^who/$', views.who_is_who, name='who_is_who_view'),
    url(r'^me/$', views.me, name='me_view'),
Patrick Colmant's avatar
Patrick Colmant committed
73
)