summaryrefslogtreecommitdiff
path: root/ishtar_common/urls.py
blob: 63c0d55f840b5e016a0f0cfa6b361a70e1642458 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2013 É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 Affero 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 Affero General Public License for more details.

# You should have received a copy of the GNU Affero 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 menus import menu

import views

urlpatterns, actions = [], []


# forms
urlpatterns = patterns('',
       # internationalization
       url(r'^i18n/', include('django.conf.urls.i18n')),
       # General
       url(r'person_creation/(?P<step>.+)?$',
           views.person_creation_wizard, name='person_creation'),
       url(r'person_modification/(?P<step>.+)?$',
           views.person_modification_wizard, name='person_modification'),
       url(r'organization_creation/(?P<step>.+)?$',
           views.organization_creation_wizard, name='organization_creation'),
       url(r'organization_modification/(?P<step>.+)?$',
           views.organization_modification_wizard,
           name='organization_modification'),
       url(r'account_management/(?P<step>.+)?$',
           views.account_management_wizard, name='account_management'),
       )
for section in menu.childs:
    for menu_item in section.childs:
        if hasattr(menu_item, 'childs'):
            for menu_subitem in menu_item.childs:
                actions.append(menu_subitem.idx)
        else:
            actions.append(menu_item.idx)
actions = r"|".join(actions)

# other views
urlpatterns += patterns('ishtar_common.views',
     # General
     url(r'dashboard-main/$', 'dashboard_main',
           name='dashboard-main'),
     url(r'update-current-item/$', 'update_current_item',
           name='update-current-item'),
     url(r'new-person/(?P<parent_name>.+)?/$',
           'new_person', name='new-person'),
     url(r'autocomplete-person/([0-9_]+)?$', 'autocomplete_person',
           name='autocomplete-person'),
     url(r'get-person/(?P<type>.+)?$', 'get_person',
           name='get-person'),
     url(r'show-person(?:/(?P<pk>.+))?/(?P<type>.+)?$',
           'show_person', name='show-person'),
     url(r'autocomplete-town/?$', 'autocomplete_town',
           name='autocomplete-town'),
     url(r'new-author/(?P<parent_name>.+)?/$',
           'new_author', name='new-author'),
     url(r'autocomplete-author/$', 'autocomplete_author',
           name='autocomplete-author'),
     url(r'new-organization/(?P<parent_name>.+)?/$',
           'new_organization', name='new-organization'),
     url(r'get-organization/(?P<type>.+)?$', 'get_organization',
           name='get-organization'),
     url(r'show-organization(?:/(?P<pk>.+))?/(?P<type>.+)?$',
           'show_organization', name='show-organization'),
     url(r'autocomplete-organization/([0-9_]+)?$',
           'autocomplete_organization', name='autocomplete-organization'),
     url(r'(?P<action_slug>' + actions + r')/$', 'action',
           name='action'),
)