from django.conf.urls import patterns, url

from .views import PanelistsListView, PanelistDetailView, PanelPerformanceView, LabHistoryView
from .views import PanelistCreateView, PanelistUpdateView, PanelistHistoryView, PanelistHistoryPrintView
from .models import Panelist


urlpatterns = patterns('',

                       url(regex=r'^$',
                           view=PanelistsListView.as_view(),
                           name=Panelist.overview_url),

                       url(regex=r'^(?P<pk>\d+)/$',
                           view=PanelistDetailView.as_view(),
                           name=Panelist.detail_url),

                       url(regex=r'^create/$',
                           view=PanelistCreateView.as_view(),
                           name=Panelist.create_url),

                       url(regex=r'^update/(?P<pk>\d+)/$',
                           view=PanelistUpdateView.as_view(),
                           name=Panelist.update_url),

                       url(regex=r'^history/(?P<pk>\d+)/$',
                           view=PanelistHistoryView.as_view(),
                           name='panelist_history'),

                       # groups panel by their performance regarding
                       # reference materials (wished for feature)
                       url(regex=r'^panel_performance/$',
                           view=PanelPerformanceView.as_view(),
                           name='panel_performance'),

                       url(regex=r'^panel_perf_print/(?P<pk>\d+)/$',
                           view=PanelistHistoryPrintView.as_view(),
                           name='panelist_history_print'),

                       url(regex=r'^lab$',
                           view=LabHistoryView.as_view(template_name='panelists/lab_history.html'),
                           name='labhistory'),

                       url(regex=r'^lab_print$',
                           view=LabHistoryView.as_view(template_name='panelists/lab_history_print.html'),
                           name='lab_history_print'),
                       )
