from django.urls import path

from . import views

app_name = 'library'

urlpatterns = [
    path('browse/', views.browse, name='browse'),
    path('packs/my/', views.my_projects, name='my_projects'),
    path('packs/create/', views.project_create_new, name='project_create_new'),
    path('packs/create/<uuid:uuid>/', views.project_create, name='project_create'),
    path('packs/create/<uuid:uuid>/delete/', views.project_draft_delete, name='project_draft_delete'),
    path('packs/<slug:slug>/', views.project_detail, name='project_detail'),
    path('packs/<slug:slug>/edit/', views.project_edit, name='project_edit'),
    path('packs/<slug:slug>/edit/regenerate/', views.regenerate_metadata, name='regenerate_metadata'),
    path('packs/<slug:slug>/delete/', views.project_delete, name='project_delete'),
    path('packs/<slug:slug>/versions/upload/', views.version_upload, name='version_upload'),
    path('packs/<slug:slug>/versions/<int:version_id>/download/', views.version_download, name='version_download'),
    path('packs/<slug:slug>/versions/<int:version_id>/files/<uuid:file_uuid>/download/', views.version_file_download, name='version_file_download'),
    path('packs/<slug:slug>/versions/<int:version_id>/asset/<path:asset_path>', views.pack_asset, name='pack_asset'),
    path('packs/<slug:slug>/guide/<int:version_id>/<uuid:file_uuid>/', views.guide_doc, name='guide_doc'),
    path('packs/<slug:slug>/guide/zip/<int:version_id>/<path:asset_path>', views.guide_zip_doc, name='guide_zip_doc'),
    path('packs/<slug:slug>/gallery/upload/', views.asset_upload, name='asset_upload'),
    path('packs/<slug:slug>/gallery/<int:asset_id>/thumb/', views.asset_thumbnail, name='asset_thumbnail'),
    path('packs/<slug:slug>/gallery/<int:asset_id>/delete/', views.asset_delete, name='asset_delete'),
    path('packs/<slug:slug>/contributors/', views.contributors, name='contributors'),
    path('packs/<slug:slug>/rate/', views.rate_project, name='rate_project'),
    path('packs/<slug:slug>/comments/add/', views.add_comment, name='add_comment'),
    path('packs/<slug:slug>/comments/<int:comment_id>/edit/', views.edit_comment, name='edit_comment'),
    path('packs/<slug:slug>/comments/<int:comment_id>/delete/', views.delete_comment, name='delete_comment'),
    path('api/files/<uuid:file_id>/', views.file_request, name='file_request'),
    path('api/uploads/', views.api_upload_temp, name='api_upload_temp'),
    path('api/uploads/<uuid:upload_uuid>/delete/', views.api_delete_temp, name='api_delete_temp'),
    path('api/draft/', views.api_draft, name='api_draft'),
    path('api/tags/autocomplete/', views.api_tags_autocomplete, name='api_tags_autocomplete'),
    path('api/packs/<str:namespace>/<str:pack_id>/latest', views.api_packs_latest, name='api_packs_latest'),
    path('api/users/autocomplete/', views.api_users_autocomplete, name='api_users_autocomplete'),
]
