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

from django.conf.urls import  url

from .views import *

urlpatterns = [

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

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

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

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

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

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

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

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

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

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

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

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