#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2010-2014 Étienne Loks # 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 . # See the file COPYING for details. from django.conf import settings from django.conf.urls.defaults import * from django.conf.urls.static import static from menus import menu from ishtar_common import views urlpatterns, actions = [], [] # forms urlpatterns = patterns('', # internationalization url(r'^i18n/', include('django.conf.urls.i18n')), # General url(r'person_creation/(?P.+)?$', views.person_creation_wizard, name='person_creation'), url(r'person_modification/(?P.+)?$', views.person_modification_wizard, name='person_modification'), url(r'person_deletion/(?P.+)?$', views.person_deletion_wizard, name='person_deletion'), url(r'organization_creation/(?P.+)?$', views.organization_creation_wizard, name='organization_creation'), url(r'organization_modification/(?P.+)?$', views.organization_modification_wizard, name='organization_modification'), url(r'organization_deletion/(?P.+)?$', views.organization_deletion_wizard, name='organization_deletion'), url(r'account_management/(?P.+)?$', 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'dashboard-main/(?P[a-z-]+)/$', 'dashboard_main_detail', name='dashboard-main-detail'), url(r'update-current-item/$', 'update_current_item', name='update-current-item'), url(r'new-person/(?:(?P[^/]+)/)?(?:(?P[^/]+)/)?$', 'new_person', name='new-person'), url(r'autocomplete-person(?:/([0-9_]+))?/(user)?$', 'autocomplete_person', name='autocomplete-person'), url(r'get-person/(?P.+)?$', 'get_person', name='get-person'), url(r'show-person(?:/(?P.+))?/(?P.+)?$', 'show_person', name='show-person'), url(r'autocomplete-town/?$', 'autocomplete_town', name='autocomplete-town'), url(r'autocomplete-department/?$', 'autocomplete_department', name='autocomplete-department'), url(r'new-author/(?:(?P[^/]+)/)?(?:(?P[^/]+)/)?$', 'new_author', name='new-author'), url(r'autocomplete-author/$', 'autocomplete_author', name='autocomplete-author'), url(r'new-organization/(?:(?P[^/]+)/)?(?:(?P[^/]+)/)?$', 'new_organization', name='new-organization'), url(r'get-organization/(?P.+)?$', 'get_organization', name='get-organization'), url(r'show-organization(?:/(?P.+))?/(?P.+)?$', 'show_organization', name='show-organization'), url(r'autocomplete-organization/([0-9_]+)?$', 'autocomplete_organization', name='autocomplete-organization'), url(r'admin-globalvar/', views.GlobalVarEdit.as_view(), name='admin-globalvar'), url(r'person_merge/(?:(?P\d+)/)?$', 'person_merge', name='person_merge'), url(r'organization_merge/(?:(?P\d+)/)?$', 'organization_merge', name='organization_merge'), url(r'(?P' + actions + r')/$', 'action', name='action'), ) if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)