from django.conf.urls.defaults import patterns, url, include

urlpatterns = patterns('docbow_project.docbow.views',
    url(r'^$', 'homepage'),
    url(r'^profile/$', 'profile', name='profile'),

    # inbox

    url(r'^inbox/$', 'inbox_view', name='inbox'),
    url(r'^inbox_by_document/(?P<document_id>\d+)/$', 'inbox_by_document',
        name='inbox-by-document-message'),
    url(r'^inbox/(?P<mailbox_id>\d+)/$', 'message', name='inbox-message',
        kwargs={'back': 'inbox'}),
    url(r'^inbox/(?P<mailbox_id>\d+)/delete/$', 'delete',
        name='inbox-message-delete'),
    url(r'^inbox/(?P<mailbox_id>\d+)/(?P<attached_file>\d+)/.*$',
        'message_attached_file', name='inbox-message-attached-file'),
    url(r'^inbox/csv$', 'inbox_csv', name='inbox-csv'),
    url(r'^inbox/ods$', 'inbox_ods', name='inbox-ods'),

    # outbox

    url(r'^outbox/$', 'outbox_view', name='outbox'),
    url(r'^outbox/(?P<mailbox_id>\d+)/$', 'message', name='outbox-message',
        kwargs={'back': 'outbox'}),
    url(r'^outbox/(?P<mailbox_id>\d+)/delete/$', 'delete',
        name='outbox-message-delete', kwargs={'back': 'outbox'}),
    url(r'^outbox/(?P<mailbox_id>\d+)/(?P<attached_file>\d+)/.*$',
        'message_attached_file', name='outbox-message-attached-file', kwargs={'back': 'outbox'}),
    url(r'^outbox_by_document/(?P<document_id>\d+)/$', 'outbox_by_document',
        name='outbox-by-document-message'),
    url(r'^outbox/csv$', 'outbox_csv', name='outbox-csv'),
    url(r'^outbox/ods$', 'outbox_ods', name='outbox-ods'),


    url(r'^send_file/$', 'send_file_selector', name='send-file-selector'),
    url(r'^send_file/(?P<file_type_id>\d+)/$', 'send_file', name='send-file'),
    url(r'^help/$', 'help', name='help'),
    url(r'^help/(?P<pagename>[a-zA-Z0-9-/\.]+)$', 'help', name='help'),
    url(r'^contact/$', 'contact', name='contact'),
    url(r'^logout/$', 'logout', name='logout'),
    url(r'^delegate/$', 'delegate', name='delegate'),
    (r'^upload/', include('docbow_project.docbow.upload_urls')),
    url(r'^su/(?P<username>.*)/$', 'su', {'redirect_url': '/'}),
    url(r'^mailing-lists/', 'mailing_lists', name='mailing-lists'),
)
