from django.conf.urls.defaults import *
from ldt.management import test_ldt

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('ldt.ldt',
    url(r'^searchInit/(?P<field>.*)/(?P<query>.*)$', 'views.searchInit'),
    url(r'^searchForm/$', 'views.searchForm'),
    url(r'^search/$', 'views.searchIndex'),
    url(r'^search/(?P<field>.*)/(?P<query>.*)$', 'views.searchIndexGet'),
    url(r'^searchLdt/(?P<field>.*)/(?P<query>.*)$', 'views.searchLdt'),
    url(r'^searchSeg/(?P<field>.*)/(?P<query>.*)$', 'views.searchSegments'),
    url(r'^index/(?P<url>.*)$', 'views.index'),
    url(r'^init/(?P<method>.*)/(?P<url>.*)$', 'views.init'),
    url(r'^ldt/(?P<url>.*)$', 'views.ldt'),
    url(r'^search/loading/$', 'views.loading'),
    url(r'^create/(?P<iri_id>.*)$', 'views.create_project'),
    url(r'^copy/(?P<ldt_id>.*)$', 'views.copy_project'),
)

if test_ldt():
    urlpatterns += patterns('ldt.ldt',
        url(r'^space/ldt/$', 'views.list_ldt'),
        url(r'^space/ldt/indexproject/(?P<id>.*)$', 'views.indexProject'),
        url(r'^space/ldt/init/(?P<method>.*)/(?P<url>.+)$', 'views.init'),
        url(r'^space/ldt/project/(?P<id>.*)$', 'views.ldtProject'),
        url(r'^space/ldt/create/$', 'views.create_ldt_view'),
        url(r'^space/ldt/created_done/$', 'views.created_ldt'),
        url(r'^space/ldt/save/$', 'views.save_ldtProject'),
        url(r'^space/ldt/publish/(?P<id>.*)$', 'views.publish'),
        url(r'^space/ldt/unpublish/(?P<id>.*)$', 'views.unpublish'),

)
