summaryrefslogtreecommitdiff
path: root/ishtar_common/urls.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/urls.py')
-rw-r--r--ishtar_common/urls.py223
1 files changed, 223 insertions, 0 deletions
diff --git a/ishtar_common/urls.py b/ishtar_common/urls.py
new file mode 100644
index 000000000..437a6bbb4
--- /dev/null
+++ b/ishtar_common/urls.py
@@ -0,0 +1,223 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (C) 2010-2011 É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 forms_main as ishtar_forms
+
+import views
+
+urlpatterns, actions = [], []
+
+
+# forms
+urlpatterns = patterns('',
+ # General
+ url(r'person_creation/(?P<step>.+)$',
+ views.person_creation_wizard, name='person_creation_step'),
+ url(r'person_creation/$',
+ views.person_creation_wizard, name='person_creation'),
+ )
+"""
+ url(r'person_modification/(?P<step>.+)$',
+ ishtar_forms.person_modification_wizard, name='person_modification'),
+ url(r'account_management/(?P<step>.+)$',
+ ishtar_forms.account_management_wizard, name='account_management'),
+ # Archaelogical files
+ url(r'file_search/(?P<step>.+)$',
+ ishtar_forms.file_search_wizard, name='file_search'),
+ url(r'file_creation/(?P<step>.+)$',
+ ishtar_forms.file_creation_wizard, name='file_creation'),
+ url(r'file_modification/(?P<step>.+)$',
+ ishtar_forms.file_modification_wizard, name='file_modification'),
+ url(r'file_closing/(?P<step>.+)$',
+ ishtar_forms.file_closing_wizard, name='file_closing'),
+ url(r'file_deletion/(?P<step>.+)$',
+ ishtar_forms.file_deletion_wizard, name='file_deletion'),
+ url(r'file_administrativeactfile/(?P<step>.+)$',
+ ishtar_forms.file_administrativeactfile_wizard,
+ name='file_administrativeactfile'),
+ url(r'file_administrativeactfile_modification/(?P<step>.+)$',
+ ishtar_forms.file_administrativeactfile_modification_wizard,
+ name='file_administrativeactfile_modification'),
+ url(r'file_administrativeactfile_deletion/(?P<step>.+)$',
+ ishtar_forms.file_administrativeactfile_deletion_wizard,
+ name='file_administrativeactfile_deletion'),
+ # Operations
+ url(r'operation_search/(?P<step>.+)$',
+ ishtar_forms.operation_search_wizard, name='operation_search'),
+ url(r'operation_creation/(?P<step>.+)$',
+ ishtar_forms.operation_creation_wizard, name='operation_creation'),
+ url(r'operation_modification/(?P<step>.+)$',
+ ishtar_forms.operation_modification_wizard,
+ name='operation_modification'),
+ url(r'operation_closing/(?P<step>.+)$',
+ ishtar_forms.operation_closing_wizard, name='operation_closing'),
+ url(r'operation_deletion/(?P<step>.+)$',
+ ishtar_forms.operation_deletion_wizard, name='operation_deletion'),
+ url(r'operation_administrativeactop/(?P<step>.+)$',
+ ishtar_forms.operation_administrativeactop_wizard,
+ name='operation_administrativeactop'),
+ url(r'operation_administrativeactop_modification/(?P<step>.+)$',
+ ishtar_forms.operation_administrativeactop_modification_wizard,
+ name='operation_administrativeactop_modification'),
+ url(r'operation_administrativeactop_deletion/(?P<step>.+)$',
+ ishtar_forms.operation_administrativeactop_deletion_wizard,
+ name='operation_administrativeactop_deletion'),
+ url(r'operation_source_creation/(?P<step>.+)$',
+ ishtar_forms.operation_source_creation_wizard,
+ name='operation_source_creation'),
+ url(r'operation_source_modification/(?P<step>.+)$',
+ ishtar_forms.operation_source_modification_wizard,
+ name='operation_source_modification'),
+ url(r'operation_source_deletion/(?P<step>.+)$',
+ ishtar_forms.operation_source_deletion_wizard,
+ name='operation_source_deletion'),
+ # Context records
+ url(r'record_search/(?P<step>.+)$',
+ ishtar_forms.record_search_wizard, name='record_search'),
+ url(r'record_creation/(?P<step>.+)$',
+ ishtar_forms.record_creation_wizard, name='record_creation'),
+ url(r'record_modification/(?P<step>.+)$',
+ ishtar_forms.record_modification_wizard, name='record_modification'),
+ url(r'record_deletion/(?P<step>.+)$',
+ ishtar_forms.record_deletion_wizard, name='record_deletion'),
+ url(r'record_source_creation/(?P<step>.+)$',
+ ishtar_forms.record_source_creation_wizard,
+ name='record_source_creation'),
+ url(r'record_source_modification/(?P<step>.+)$',
+ ishtar_forms.record_source_modification_wizard,
+ name='record_source_modification'),
+ url(r'record_source_deletion/(?P<step>.+)$',
+ ishtar_forms.record_source_deletion_wizard,
+ name='record_source_deletion'),
+ # Finds
+ url(r'item_search/(?P<step>.+)$',
+ ishtar_forms.item_search_wizard, name='item_search'),
+ url(r'item_creation/(?P<step>.+)$',
+ ishtar_forms.item_creation_wizard, name='item_creation'),
+ url(r'item_modification/(?P<step>.+)$',
+ ishtar_forms.item_modification_wizard, name='item_modification'),
+ url(r'item_source_creation/(?P<step>.+)$',
+ ishtar_forms.item_source_creation_wizard,
+ name='item_source_creation'),
+ url(r'item_source_modification/(?P<step>.+)$',
+ ishtar_forms.item_source_modification_wizard,
+ name='item_source_modification'),
+ url(r'item_source_deletion/(?P<step>.+)$',
+ ishtar_forms.item_source_deletion_wizard,
+ name='item_source_deletion'),
+ # Treatments
+ url(r'treatment_creation/(?P<step>.+)$',
+ ishtar_forms.treatment_creation_wizard, name='treatment_creation'),
+ url(r'warehouse_packaging/(?P<step>.+)$',
+ 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<action_slug>' + actions + r')/$', 'action',
+ name='action'),
+ 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'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'autocomplete-organization/([0-9_]+)?$',
+ 'autocomplete_organization', name='autocomplete-organization'),
+ url(r'new-warehouse/(?P<parent_name>.+)?/$',
+ '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<type>.+)?$', 'get_file',
+ name='get-file'),
+ url(r'get-file-full/(?P<type>.+)?$', 'get_file',
+ name='get-file-full', kwargs={'full':True}),
+ url(r'get-administrativeactfile/(?P<type>.+)?$',
+ 'get_administrativeactfile', name='get-administrativeactfile'),
+ url(r'show-file/(?P<pk>.+)?/(?P<type>.+)?$', 'show_file',
+ name='show-file'),
+ url(r'show-historized-file/(?P<pk>.+)?/(?P<date>.+)?$',
+ 'show_file', name='show-historized-file'),
+ url(r'revert-file/(?P<pk>.+)/(?P<date>.+)$',
+ 'revert_file', name='revert-file'),
+ # Operations
+ url(r'autocomplete-operation/$', 'autocomplete_operation',
+ name='autocomplete-operation'),
+ url(r'get-operation/(?P<type>.+)?$', 'get_operation',
+ name='get-operation'),
+ url(r'get-operation-full/(?P<type>.+)?$', 'get_operation',
+ name='get-operation-full', kwargs={'full':True}),
+ url(r'get-available-operation-code/(?P<year>.+)?$',
+ 'get_available_operation_code', name='get_available_operation_code'),
+ url(r'revert-operation/(?P<pk>.+)/(?P<date>.+)$',
+ 'revert_operation', name='revert-operation'),
+ url(r'show-operation/(?P<pk>.+)?/(?P<type>.+)?$',
+ 'show_operation', name='show-operation'),
+ url(r'get-administrativeactop/(?P<type>.+)?$',
+ 'get_administrativeactop', name='get-administrativeactop'),
+ url(r'get-operationsource/(?P<type>.+)?$',
+ 'get_operationsource', name='get-operationsource'),
+ # Context records
+ url(r'show-contextrecord/(?P<pk>.+)?/(?P<type>.+)?$',
+ 'show_contextrecord', name='show-contextrecord'),
+ url(r'get-contextrecord/(?P<type>.+)?$', 'get_contextrecord',
+ name='get-contextrecord'),
+ url(r'get-contextrecord-full/(?P<type>.+)?$',
+ 'get_contextrecord', name='get-contextrecord-full',
+ kwargs={'full':True}),
+ url(r'get-contexrecordsource/(?P<type>.+)?$',
+ 'get_contextrecordsource', name='get-contextrecordsource'),
+ # Finds
+ url(r'update-current-item/$', 'update_current_item',
+ name='update-current-item'),
+ url(r'get-item/(?P<type>.+)?$', 'get_archaeologicalitem',
+ name='get-item'),
+ url(r'get-item-full/(?P<type>.+)?$', 'get_archaeologicalitem',
+ name='get-item-full', kwargs={'full':True}),
+ url(r'get-itemsource/(?P<type>.+)?$',
+ '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<parent_name>.+)?/$',
+ 'new_container', name='new-container'),
+)