from django.conf.urls.defaults import *
from django.conf import settings
from django.contrib import admin
import amnesia
admin.autodiscover()

admin.site.register(amnesia.ts.models.Ticket)
admin.site.register(amnesia.ts.models.Queue)

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

urlpatterns = patterns('',
    (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),

    (r'^$', 'amnesia.ts.views.index'),
    (r'^ts/$', 'amnesia.ts.views.index'),
    (r'^ts/login/', 'amnesia.ts.views.login_user'),
    (r'^ts/logout/', 'amnesia.ts.views.logout_user'),
    (r'^ts/index/', 'amnesia.ts.views.index'),
    (r'^ts/new/', 'amnesia.ts.views.new_ticket'),
    (r'^ts/detail/(\d+)/$', 'amnesia.ts.views.detail'),
    (r'^ts/edit/(\d+)/$', 'amnesia.ts.views.edit'),
    (r'^ts/subscribe/(\d+)/$', 'amnesia.ts.views.subscribe'),
    (r'^ts/unsubscribe/(\d+)/$', 'amnesia.ts.views.subscribe'),
    (r'^ts/take/(\d+)/$', 'amnesia.ts.views.take_ticket'),
    (r'^ts/untake/(\d+)/$', 'amnesia.ts.views.take_ticket'),
    (r'^ts/status/(\d+)/(.+)$', 'amnesia.ts.views.set_status'),
    (r'^ts/search/$', 'amnesia.ts.views.search'),
    (r'^ts/profile/$', 'amnesia.ts.views.change_userdata'),
    (r'^ts/filter/$', 'amnesia.ts.views.filter'),
    (r'^admin/(.*)', admin.site.root),

)
