""" This module contains urls for the ``metaplans`` app. """

from django.conf.urls import url

from . import views


urlpatterns = [

    # Create MetaplanTemplate
    url(r'^training/(?P<training_id>[-\w]+)/create_template/$',
        views.MetaplanTemplateCreateView.as_view(),
        name='template-create'),

    # Detail MetaplanTemplate
    url(r'^/template/(?P<template_uuid>[-\w]+)/$',
        views.MetaplanTemplateDetailView.as_view(),
        name='template-detail'),

    # Edit MetaplanTemplate
    url(r'^/template/(?P<template_uuid>[-\w]+)/update/$',
        views.MetaplanTemplateUpdateView.as_view(),
        name='template-update'),

    # Delete MetaplanTemplate
    url(r'^training/(?P<training_id>[-\w]+)/delete_template/(?P<pk>[-\w]+)$',
        views.MetaplanTemplateDeleteView.as_view(),
        name='template-delete'),

    # List Metaplans by session
    url(r'^session/(?P<session_id>[-\w]+)/$',
        views.MetaplanSessionListView.as_view(),
        name='list_by_session'),

    # Create Metaplan
    url(r'^session/(?P<session_id>[-\w]+)/create/$',
        views.MetaplanCreateView.as_view(),
        name='create'),

    # Update Metaplan
    url(r'^(?P<pk>[-\w]+)/update/$',
        views.MetaplanUpdateView.as_view(),
        name='update'),

    # Delete Metaplan
    url(r'^(?P<pk>[-\w]+)/delete/$',
        views.MetaplanDeleteView.as_view(),
        name='delete'),

    # Detail Metaplan
    url(r'^(?P<pk>[-\w]+)/$', views.
        MetaplanDetailView.as_view(),
        name='detail'),

    # Export Metaplan
    url(r'^(?P<pk>[-\w]+)/export$',
        views.MetaplanExportView.as_view(),
        name='export'),

    # Create MetaplanProposition
    url(r'(?P<metaplan_id>[-\w]+)/proposition/create$',
        views.MetaplanPropositionCreateView.as_view(),
        name='create_proposition'),

    # Import/Export Metaplan Template
    url(
        r'^template/(?P<metaplan_template_uuid>[-\w]+)/export_xls$',
        views.XLSMetaplanTemplateExportView.as_view(),
        name='export-xls'
    ),
    url(
        r'^trainings/(?P<training_uuid>[-\w]+)/import_xls$',
        views.XLSMetaplanTemplateImportView.as_view(),
        name='import-xls'
    )
]
