#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2010-2011 É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.urls.defaults import * from menus import menu #import forms_main as ishtar_forms import views urlpatterns, actions = [], [] # forms urlpatterns = patterns('', # 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'account_management/(?P.+)?$', views.account_management_wizard, name='account_management'), ) """ # Archaelogical files url(r'file_search/(?P.+)$', ishtar_forms.file_search_wizard, name='file_search'), url(r'file_creation/(?P.+)$', ishtar_forms.file_creation_wizard, name='file_creation'), url(r'file_modification/(?P.+)$', ishtar_forms.file_modification_wizard, name='file_modification'), url(r'file_closing/(?P.+)$', ishtar_forms.file_closing_wizard, name='file_closing'), url(r'file_deletion/(?P.+)$', ishtar_forms.file_deletion_wizard, name='file_deletion'), url(r'file_administrativeactfile/(?P.+)$', ishtar_forms.file_administrativeactfile_wizard, name='file_administrativeactfile'), url(r'file_administrativeactfile_modification/(?P.+)$', ishtar_forms.file_administrativeactfile_modification_wizard, name='file_administrativeactfile_modification'), url(r'file_administrativeactfile_deletion/(?P.+)$', ishtar_forms.file_administrativeactfile_deletion_wizard, name='file_administrativeactfile_deletion'), # Operations url(r'operation_search/(?P.+)$', ishtar_forms.operation_search_wizard, name='operation_search'), url(r'operation_creation/(?P.+)$', ishtar_forms.operation_creation_wizard, name='operation_creation'), url(r'operation_modification/(?P.+)$', ishtar_forms.operation_modification_wizard, name='operation_modification'), url(r'operation_closing/(?P.+)$', ishtar_forms.operation_closing_wizard, name='operation_closing'), url(r'operation_deletion/(?P.+)$', ishtar_forms.operation_deletion_wizard, name='operation_deletion'), url(r'operation_administrativeactop/(?P.+)$', ishtar_forms.operation_administrativeactop_wizard, name='operation_administrativeactop'), url(r'operation_administrativeactop_modification/(?P.+)$', ishtar_forms.operation_administrativeactop_modification_wizard, name='operation_administrativeactop_modification'), url(r'operation_administrativeactop_deletion/(?P.+)$', ishtar_forms.operation_administrativeactop_deletion_wizard, name='operation_administrativeactop_deletion'), url(r'operation_source_creation/(?P.+)$', ishtar_forms.operation_source_creation_wizard, name='operation_source_creation'), url(r'operation_source_modification/(?P.+)$', ishtar_forms.operation_source_modification_wizard, name='operation_source_modification'), url(r'operation_source_deletion/(?P.+)$', ishtar_forms.operation_source_deletion_wizard, name='operation_source_deletion'), # Context records url(r'record_search/(?P.+)$', ishtar_forms.record_search_wizard, name='record_search'), url(r'record_creation/(?P.+)$', ishtar_forms.record_creation_wizard, name='record_creation'), url(r'record_modification/(?P.+)$', ishtar_forms.record_modification_wizard, name='record_modification'), url(r'record_deletion/(?P.+)$', ishtar_forms.record_deletion_wizard, name='record_deletion'), url(r'record_source_creation/(?P.+)$', ishtar_forms.record_source_creation_wizard, name='record_source_creation'), url(r'record_source_modification/(?P.+)$', ishtar_forms.record_source_modification_wizard, name='record_source_modification'), url(r'record_source_deletion/(?P.+)$', ishtar_forms.record_source_deletion_wizard, name='record_source_deletion'), # Finds url(r'item_search/(?P.+)$', ishtar_forms.item_search_wizard, name='item_search'), url(r'item_creation/(?P.+)$', ishtar_forms.item_creation_wizard, name='item_creation'), url(r'item_modification/(?P.+)$', ishtar_forms.item_modification_wizard, name='item_modification'), url(r'item_source_creation/(?P.+)$', ishtar_forms.item_source_creation_wizard, name='item_source_creation'), url(r'item_source_modification/(?P.+)$', ishtar_forms.item_source_modification_wizard, name='item_source_modification'), url(r'item_source_deletion/(?P.+)$', ishtar_forms.item_source_deletion_wizard, name='item_source_deletion'), # Treatments url(r'treatment_creation/(?P.+)$', ishtar_forms.treatment_creation_wizard, name='treatment_creation'), url(r'warehouse_packaging/(?P.+)$', ishtar_forms.warehouse_packaging_wizard, name='warehouse_packaging'), )""" 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'(?P' + actions + r')/$', 'action', name='action'), url(r'new-person/(?P.+)?/$', 'new_person', name='new-person'), url(r'autocomplete-person/([0-9_]+)?$', 'autocomplete_person', name='autocomplete-person'), url(r'autocomplete-town/$', 'autocomplete_town', name='autocomplete-town'), url(r'new-author/(?P.+)?/$', 'new_author', name='new-author'), url(r'autocomplete-author/$', 'autocomplete_author', name='autocomplete-author'), url(r'new-organization/(?P.+)?/$', 'new_organization', name='new-organization'), url(r'autocomplete-organization/([0-9_]+)?$', 'autocomplete_organization', name='autocomplete-organization'), url(r'new-warehouse/(?P.+)?/$', 'new_warehouse', name='new-warehouse'), url(r'autocomplete-warehouse/$', 'autocomplete_warehouse', name='autocomplete-warehouse'), # Archaelogical files url(r'autocomplete-file/$', 'autocomplete_file', name='autocomplete-file'), url(r'get-file/(?P.+)?$', 'get_file', name='get-file'), url(r'get-file-full/(?P.+)?$', 'get_file', name='get-file-full', kwargs={'full':True}), url(r'get-administrativeactfile/(?P.+)?$', 'get_administrativeactfile', name='get-administrativeactfile'), url(r'show-file/(?P.+)?/(?P.+)?$', 'show_file', name='show-file'), url(r'show-historized-file/(?P.+)?/(?P.+)?$', 'show_file', name='show-historized-file'), url(r'revert-file/(?P.+)/(?P.+)$', 'revert_file', name='revert-file'), # Operations url(r'autocomplete-operation/$', 'autocomplete_operation', name='autocomplete-operation'), url(r'get-operation/(?P.+)?$', 'get_operation', name='get-operation'), url(r'get-operation-full/(?P.+)?$', 'get_operation', name='get-operation-full', kwargs={'full':True}), url(r'get-available-operation-code/(?P.+)?$', 'get_available_operation_code', name='get_available_operation_code'), url(r'revert-operation/(?P.+)/(?P.+)$', 'revert_operation', name='revert-operation'), url(r'show-operation/(?P.+)?/(?P.+)?$', 'show_operation', name='show-operation'), url(r'get-administrativeactop/(?P.+)?$', 'get_administrativeactop', name='get-administrativeactop'), url(r'get-operationsource/(?P.+)?$', 'get_operationsource', name='get-operationsource'), # Context records url(r'show-contextrecord/(?P.+)?/(?P.+)?$', 'show_contextrecord', name='show-contextrecord'), url(r'get-contextrecord/(?P.+)?$', 'get_contextrecord', name='get-contextrecord'), url(r'get-contextrecord-full/(?P.+)?$', 'get_contextrecord', name='get-contextrecord-full', kwargs={'full':True}), url(r'get-contexrecordsource/(?P.+)?$', 'get_contextrecordsource', name='get-contextrecordsource'), # Finds url(r'update-current-item/$', 'update_current_item', name='update-current-item'), url(r'get-item/(?P.+)?$', 'get_archaeologicalitem', name='get-item'), url(r'get-item-full/(?P.+)?$', 'get_archaeologicalitem', name='get-item-full', kwargs={'full':True}), url(r'get-itemsource/(?P.+)?$', 'get_itemsource', name='get-itemsource'), url(r'get-container/$', 'get_container', name='get-container'), # Treatments url(r'autocomplete-container/?$', 'autocomplete_container', name='autocomplete-container'), url(r'new-container/(?P.+)?/$', 'new_container', name='new-container'), )