Project

General

Profile

Download (3.98 KB) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / agenda / urls.py @ 3a38fa86

1
from django.conf.urls import url, patterns, include
2

    
3
from calebasse.cbv import TemplateView
4
from django.views.decorators.csrf import csrf_exempt
5

    
6
from calebasse.decorators import validator_only
7

    
8
from views import (redirect_today, AgendaHomepageView, NewAppointmentView,
9
        NewEventView, AgendaServiceActivityView, UpdateAppointmentView,
10
        UpdateEventView, AgendaServiceActValidationView, AutomatedValidationView,
11
        UnlockAllView, AgendasTherapeutesView, JoursNonVerrouillesView,
12
        AjaxWorkerTabView, AjaxRessourceTabView, AjaxDisponibilityColumnView,
13
        DeleteOccurrenceView, DeleteEventView, UpdatePeriodicEventView,
14
        UpdatePeriodicAppointmentView, PeriodicEventsView)
15

    
16
agenda_patterns = patterns('',
17
            url(r'^$',
18
                AgendaHomepageView.as_view(
19
                    template_name='agenda/index.html'),
20
                name='agenda'),
21
            url(r'^nouveau-rdv/$',
22
                NewAppointmentView.as_view(),
23
                name='nouveau-rdv'),
24
            url(r'^update-rdv/(?P<pk>\d+)$',
25
                UpdateAppointmentView.as_view(),
26
                name='update-rdv'),
27
            url(r'^update-periodic-rdv/(?P<pk>\d+)$',
28
                UpdatePeriodicAppointmentView.as_view(),
29
                name='update-periodic-rdv'),
30
            url(r'^new-event/$',
31
                NewEventView.as_view(),
32
                name='new-event'),
33
            url(r'^update-event/(?P<pk>\d+)$',
34
                UpdateEventView.as_view(),
35
                name='update-event'),
36
            url(r'^update-periodic-event/(?P<pk>\d+)$',
37
                UpdatePeriodicEventView.as_view(),
38
                name='update-periodic-event'),
39
            url(r'^delete-occurrence/(?P<pk>\d+)$',
40
                csrf_exempt(DeleteOccurrenceView.as_view()),
41
                name='delete-occurrence'),
42
            url(r'^delete-event/(?P<pk>\d+)$',
43
                csrf_exempt(DeleteEventView.as_view()),
44
                name='delete-event'),
45
            url(r'^activite-du-service/$',
46
                AgendaServiceActivityView.as_view(
47
                    template_name='agenda/service-activity.html'),
48
                name='activite-du-service'),
49
            url(r'^validation-des-actes/$',
50
                validator_only(AgendaServiceActValidationView.as_view(
51
                    template_name='agenda/act-validation.html')),
52
                name='validation-des-actes'),
53
            url(r'^validation-des-actes/validation-all/$',
54
                validator_only(AutomatedValidationView.as_view()),
55
                name='validation-all'),
56
            url(r'^validation-des-actes/unlock-all/$',
57
                validator_only(UnlockAllView.as_view()),
58
                name='unlock-all'),
59
            url(r'^agendas-therapeutes/$',
60
                AgendasTherapeutesView.as_view(
61
                    template_name='agenda/agendas-therapeutes.html'),
62
                name='agendas-therapeutes'),
63
            url(r'^jours-non-verrouilles/$',
64
                validator_only(JoursNonVerrouillesView.as_view(
65
                    template_name='agenda/days-not-locked.html')),
66
                name='days-not-locked'),
67
            url(r'^ajax-worker-tab/(?P<worker_id>\d+)$',
68
                AjaxWorkerTabView.as_view(),
69
                name='ajax-worker-tab'),
70
            url(r'^ajax-ressource-tab/(?P<ressource_id>\d+)$',
71
                AjaxRessourceTabView.as_view(),
72
                name='ajax-ressource-tab'),
73
            url(r'^disponibility/(?P<ressource_type>\w+)-(?P<ressource_id>\d+)$',
74
                AjaxDisponibilityColumnView.as_view(),
75
                name='ajax-disponibility-column'),
76
            url(r'^rendez-vous-periodiques/$',
77
                PeriodicEventsView.as_view(),
78
                name='periodic-events'),
79
            url(r'^rendez-vous-periodiques/(?P<worker_id>\d+)/$',
80
                PeriodicEventsView.as_view(),
81
                name='periodic-events-for-worker'),
82
            )
83

    
84
urlpatterns = patterns('',
85
        url(r'^$', redirect_today),
86
        url(r'^(?P<date>[^/]*)/', include(agenda_patterns)))
(9-9/10)