from django.conf.urls.defaults import patterns, include
from django.contrib import admin
from ldt.text import VERSION_STR


# Uncomment the next two lines to enable the admin:
admin.autodiscover()


urlpatterns = patterns('',
    # Example:
    # (r'^blinkster/', include('blinkster.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
    (r'^ldt/', include('ldt.ldt_utils.urls')),
    (r'^user/', include('ldt.user.urls')),
    (r'^api/', include('ldt.api.urls')),
    (r'^api/' + VERSION_STR + '/text/', include('ldt.text.urls')),

    (r'^accounts/', include('registration.backends.simple.urls')),
    (r'^oauth/', include('oauth_provider.urls')),

#    (r'^admin/import/form$', 'blinkster.ldt.views.importFile'),
#    (r'^admin/import/upload/$', 'blinkster.ldt.views.uploadFile'),
#    (r'^admin/export/form$', 'blinkster.ldt.views.exportForm'),
#    (r'^admin/export/ldt/$', 'blinkster.ldt.views.downloadLdt'),
#    (r'^admin/reindex/$', 'blinkster.ldt.views.reindex'),
#    (r'^admin/import/projectForm$', 'blinkster.ldt.views.importProjectFile'),
#    (r'^admin/import/uploadProject/$', 'blinkster.ldt.views.uploadProjectFile'),
    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
    
    
    #(r'^.*(?P<content>flvplayer|mp3player|ClearExternalAllBlue)\.swf$','django.views.generic.simple.redirect_to', {'url':blinkster.settings.BASE_URL+'/static/swf/ldt/pkg/%(content)s.swf'}),
    (r'^roi/list/$', 'blinkster.views.roi_list'),
    (r'^poi/list/(?P<roi_sid>.*)/$', 'blinkster.views.poi_list'),
    (r'^blinkster/segment/detail/(?P<project_id>.*)/(?P<iri_id>.*)/(?P<ensemble_id>.*)/(?P<cutting_id>.*)/(?P<element_id>.*)/$', 'blinkster.views.segment_detail'),
    (r'^blinkster/segment/playlist/(?P<project_id>.*)/(?P<iri_id>.*)/(?P<ensemble_id>.*)/(?P<cutting_id>.*)/(?P<element_id>.*)/$', 'blinkster.views.segment_ts_playlist'),
    (r'^blinkster/segment/search/$', 'blinkster.views.segment_search_post'),
    (r'^blinkster/segment/search/(?P<field>tags|title|abstract|all)/(?P<operator>or|and)/(?P<query>.*)/$', 'blinkster.views.segment_search_get'),
    (r'^photologue/', include('photologue.urls')),
    
)
