Allow grabbing library information via json.
[htsworkflow.git] / htsworkflow / frontend / urls.py
1 from django.conf.urls.defaults import *
2 from django.contrib import admin
3 import django
4 admin.autodiscover()
5
6 # Databrowser:
7 #from django.contrib import databrowse
8 #from htsworkflow.frontend.samples.models import Library
9 #databrowse.site.register(Library)
10 #databrowse.site.register(FlowCell)
11
12 from htsworkflow.frontend import settings
13
14
15 urlpatterns = patterns('',
16     ('^accounts/login/$', 'django.contrib.auth.views.login'),
17     ('^accounts/logout/$', 'django.contrib.auth.views.logout'),
18     ('^accounts/logout_then_login/$', 'django.contrib.auth.views.logout_then_login'),
19     ('^accounts/pwchange/$', 'django.contrib.auth.views.password_change'),
20     ('^accounts/pwchange_done/$', 'django.contrib.auth.views.password_change_done'),
21     ('^accounts/profile/$', 'htsworkflow.frontend.samples.views.user_profile'),
22     # Base:
23     (r'^eland_config/', include('htsworkflow.frontend.eland_config.urls')),
24     ### MOVED Admin from here ###
25     #(r'^admin/(.*)', admin.site.root),
26     # Experiments:
27     (r'^experiments/', include('htsworkflow.frontend.experiments.urls')),
28     # AnalysTrack:
29     #(r'^analysis/', include('htsworkflow.frontend.analysis.urls')),
30     # Inventory urls
31     (r'^inventory/', include('htsworkflow.frontend.inventory.urls')),
32     # Report Views:
33     (r'^reports/', include('htsworkflow.frontend.reports.urls')),
34     # Library browser
35     (r'^library/$', 'htsworkflow.frontend.samples.views.library'),
36     (r'^library/(?P<lib_id>\w+)/$', 
37       'htsworkflow.frontend.samples.views.library_to_flowcells'),
38     # library id to admin url
39     (r'^library_id_to_admin_url/(?P<lib_id>\w+)/$',
40      'htsworkflow.frontend.samples.views.library_id_to_admin_url'),
41     # sample / library information
42     (r'^samples/', include('htsworkflow.frontend.samples.urls')),                   
43     # Raw result files
44     (r'^results/(?P<flowcell_id>\w+)/(?P<cnm>C[1-9]-[0-9]+)/summary/',
45       'htsworkflow.frontend.samples.views.summaryhtm_fc_cnm'),
46     (r'^results/(?P<flowcell_id>\w+)/(?P<cnm>C[1-9]-[0-9]+)/eland_result/(?P<lane>[1-8])',
47       'htsworkflow.frontend.samples.views.result_fc_cnm_eland_lane'),
48     (r'^results/(?P<fc_id>\w+)/(?P<cnm>C[1-9]-[0-9]+)/bedfile/(?P<lane>[1-8])/ucsc',
49       'htsworkflow.frontend.samples.views.bedfile_fc_cnm_eland_lane_ucsc'),
50     (r'^results/(?P<fc_id>\w+)/(?P<cnm>C[1-9]-[0-9]+)/bedfile/(?P<lane>[1-8])',
51       'htsworkflow.frontend.samples.views.bedfile_fc_cnm_eland_lane'),
52     (r'^bcmagic/', include('htsworkflow.frontend.bcmagic.urls')),
53     
54     # databrowser
55     #(r'^databrowse/(.*)', databrowse.site.root)
56 )
57
58 # Allow admin
59 if hasattr(admin.site, 'urls'):
60   urlpatterns += patterns('', (r'^admin/', include(admin.site.urls)))
61 else:                          
62   urlpatterns += patterns('', (r'^admin/(.*)', admin.site.root))
63
64 if settings.DEBUG:
65   urlpatterns += patterns('',
66       (r'^static/(?P<path>.*)$', 'django.views.static.serve', 
67         {'document_root': settings.MEDIA_ROOT}),
68   )