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

The following views are defined:

- /workshops/:uuid/ : named "workshop-detail"
   => used to see details of a workshop
- /workshops/:uuid/update : named "workshop-update"
   => used to update a workshop
- /workshops/:uuid/delete/ : named "workshop-delete"
   => used to delete a workshop, with a confirmation step

- /workshops/:uuid/step/sort/: named "steps-sort"
   => used to sort the steps related to the given workshop
- /steps/delete/: named "steps-delete"
   => used to soft-delete a list of steps of the given workshop

- /workshops/:uuid/steps/questions/create/: named "step-question-create"
   => used to create a new question step for the given workshop
- /workshops/:uuid/steps/step/questions/:step_uuid/: named "step-question-update"
   => used to create a new question step for the given workshop

- /workshops/:uuid/steps/images/create/: named "step-create"
   => used to create a new image step for the given workshop
- /workshops/:uuid/steps/images/:step_uuid: named "step-update"
   => used to edit an image step for the given workshop

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


app_name = 'workshops'

urlpatterns = [
    url(
        r'^:workshop_uuid/$',
        views.WorkshopDetail.as_view(),
        name='workshop-detail'
    ),
    url(
        r'^:workshop_uuid/update$',
        views.WorkshopUpdate.as_view(),
        name='workshop-update'
    ),
    url(
        r'^:workshop_uuid/delete/$',
        views.WorkshopDelete.as_view(),
        name='workshop-delete'
    ),
    url(
        r'^:workshop_uuid/steps/sort/',
        views.WorkshopStepSort.as_view(),
        name='steps-sort'
    ),
    url(
        r'^:workshop_uuid/steps/delete/',
        views.WorkshopStepsDelete.as_view(),
        name='steps-delete'
    ),
    url(
        r'^:workshop_uuid/steps/questions/create/$',
        views.WorkshopStepQuestionCreate.as_view(),
        name='step-question-create'
    ),
    url(
        r'^:workshop_uuid/steps/questions/:step_uuid/',
        views.WorkshopStepQuestionUpdate.as_view(),
        name='step-question-update'
    ),
    url(
        r'^:workshop_uuid/steps/images/create/',
        views.WorkshopStepImageCreate.as_view(),
        name='step-image-create'
    ),
    url(
        r'^:workshop_uuid/steps/images/:step_uuid/',
        views.WorkshopStepImageUpdate.as_view(),
        name='step-image-update'
    ),
    # Import/Export XLS
    url(
        r'^trainings/:training_uuid/import_xls$',
        views.XLSQuizImportView.as_view(),
        name='import-xls'
    ),
    url(
        r'^:workshop_uuid/export_xls$',
        views.XLSQuizExportView.as_view(),
        name='export-xls'
    ),
]
