"""This module holds the urls for the ``evaluations`` app

The following views are defined:

- /evaluations/add/ : named "evaluation-create", used to create an evaluation
- /evaluations/:uuid/ : named "evaluation-detail", used to view the detail of an evaluation
- /evaluations/:uuid/update : named "evaluation-update", used to update an evaluation
- /evaluations/:uuid/delete/ : named "evaluation-delete", used to delete an evaluation,
with a confirmation step

- /evaluations/:uuid/exercise/create/: named "exercise-create", used to create a new exercise
for the given evaluation
- /evaluations/:uuid/exercise/sort/: named "exercises-sort", used to sort the exercises related
to the given evaluation
- /evaluations/:uuid/exercise/:exercise_uuid/: named "exercise-edit", used to update an exercise
- /evaluations/:uuid/exercise/:exercise_uuid/delete/: named "exercise-delete", used to delete
an exercise

- /evaluations/evaluation_uuid/exercise/:exercise_uuid/criterion/create/:
named "criterion-create", used to create a criterion
- /evaluations/evaluation_uuid/exercise/:exercise_uuid/criterion/:criterion_uuid/:
named "criterion-update", used to update a criterion
- /evaluations/evaluation_uuid/exercise/:exercise_uuid/criterion/:criterion_uuid/delete/:
named "criterion-delete", used to delete a criterion

Notes
-----
We use ``django-macros-url`` to ease the use of parameters in urls, for example UUIDs:
``:uuid`` is more readable than
``(?P<uuid>[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12})``

"""

from macrosurl import url

from . import views

urlpatterns = [
    url(
        r'^:evaluation_uuid/$',
        views.EvaluationDetail.as_view(),
        name='evaluation-detail'
    ),
    url(
        r'^:evaluation_uuid/update/$',
        views.EvaluationUpdate.as_view(),
        name='evaluation-update'
    ),
    url(
        r'^:evaluation_uuid/exercise/create/$',
        views.ExerciseCreate.as_view(),
        name='exercise-create'
    ),
    url(
        r'^:evaluation_uuid/exercises/sort/$',
        views.ExercisesSort.as_view(),
        name='exercises-sort'
    ),
    url(
        r'^:evaluation_uuid/exercise/:exercise_uuid/$',
        views.ExerciseUpdate.as_view(),
        name='exercise-update'
    ),
    url(
        r'^:evaluation_uuid/exercise/:exercise_uuid/delete/$',
        views.ExerciseDelete.as_view(),
        name='exercise-delete'
    ),
    url(
        r'^:evaluation_uuid/exercise/:exercise_uuid/criterion/create/$',
        views.CriterionCreate.as_view(),
        name='criterion-create'
    ),
    url(
        r'^:evaluation_uuid/exercise/:exercise_uuid/criteria/sort/$',
        views.CriteriaSort.as_view(),
        name='criteria-sort'
    ),
    url(
        r'^:evaluation_uuid/exercise/:exercise_uuid/criterion/:criterion_uuid/$',
        views.CriterionUpdate.as_view(),
        name='criterion-update'
    ),
    url(
        r'^:evaluation_uuid/exercise/:exercise_uuid/criterion/:criterion_uuid/delete/$',
        views.CriterionDelete.as_view(),
        name='criterion-delete'
    ),
    url(
        r'^:session_uuid/export_statistics',
        views.ExportEvaluationsSessionStats.as_view(),
        name='export-statistics'
    ),

    # Export XLS Brainstormer Template
    url(r'^:evaluation_uuid/export_xls$',
        views.XLSEvaluationExportView.as_view(),
        name='evaluation-export-xls'),

    # Import XLS Brainstormer Template
    url(r'^trainings/:training_uuid/import_xls$',
        views.XLSEvaluationImportView.as_view(),
        name='evaluation-import-xls'),
]
