summaryrefslogtreecommitdiff
path: root/ishtar/furnitures/urls.py
blob: 75759c9aac5b216d8f482d255ef30a39d5c6ce1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2010  Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# See the file COPYING for details.

from django.conf.urls.defaults import *

from ishtar.urls import BASE_URL
from menus import menu
from forms import file_creation_wizard, file_modification_wizard,\
                  operation_creation_wizard, operation_modification_wizard,\
                  person_creation_wizard

urlpatterns, actions = [], []

urlpatterns = patterns('',
         url(BASE_URL + r'person_creation/(?P<step>.+)$',
                        person_creation_wizard, name='person_creation'),
         url(BASE_URL + r'file_creation/(?P<step>.+)$', file_creation_wizard,
                                             name='file_creation'),
         url(BASE_URL + r'file_modification/(?P<step>.+)$',
                    file_modification_wizard, name='file_modification'),
         url(BASE_URL + r'operation_creation/(?P<step>.+)$',
                    operation_creation_wizard, name='operation_creation'),
         url(BASE_URL + r'operation_modification/(?P<step>.+)$',
                  operation_modification_wizard, name='operation_modification'),
         )
for section in menu.childs:
    for menu_item in section.childs:
        actions.append(menu_item.idx)
actions = r"|".join(actions)

urlpatterns += patterns('ishtar.furnitures.views',
     url(BASE_URL + r'(?P<action_slug>' + actions + r')/$', 'action',
         name='action'),
     url(BASE_URL + r'autocomplete-persone/([0-9_]+)?$', 'autocomplete_person',
                                      name='autocomplete-person'),
     url(BASE_URL + r'autocomplete-town/$', 'autocomplete_town',
                                      name='autocomplete-town'),
     url(BASE_URL + r'autocomplete-organization/$', 'autocomplete_organization',
                                      name='autocomplete-organization'),
     url(BASE_URL + r'autocomplete-file/$', 'autocomplete_file',
                                      name='autocomplete-file'),
     url(BASE_URL + r'autocomplete-operation/$', 'autocomplete_operation',
                                      name='autocomplete-operation'),
     url(BASE_URL + r'update-current-item/$', 'update_current_item',
                                      name='update-current-item'),
)