from django.urls import path
from .views import   AddCropTranslationView, CropTranslationDetailsView, CropTranslationMatrixView, DeleteCropTranslationView, UpdateCropTranslationView, UpdateCropView, CropDetailsView, AddCropView, ViewCropTranslationView, ViewCropView, DeleteCropView
from django.views.decorators.csrf import csrf_protect
from django.contrib.auth.decorators import login_required

urlpatterns = [
    path('add-crop', login_required(csrf_protect(AddCropView.as_view())), name='add-crop'),
    path('view-crop/<int:id>', login_required(ViewCropView.as_view()), name='view-crop'),
    path('update-crop/<int:id>', login_required(UpdateCropView.as_view()), name='update-crop'),
    path('update-crop', login_required(csrf_protect(UpdateCropView.as_view())), name='update-crop'),
    path('crop-details', login_required(CropDetailsView.as_view()), name='crop-details'),
    path('delete-crop', login_required(csrf_protect(DeleteCropView.as_view())), name='delete-crop'),
    path('add-crop-translation', login_required(csrf_protect(AddCropTranslationView.as_view())), name='add-crop-translation'),
    path('view-crop-translation/<int:id>', login_required(ViewCropTranslationView.as_view()), name='view-crop-translation'),
    path('update-crop-translation/<int:id>', login_required(csrf_protect(UpdateCropTranslationView.as_view())), name='update-crop-translation'),
    path('crop-translation-details', login_required(CropTranslationDetailsView.as_view()), name='crop-translation-details'),
    path('delete-crop-translation', login_required(csrf_protect(DeleteCropTranslationView.as_view())), name='delete-crop-translation'),
    path("crop-translation-matrix/",login_required(csrf_protect(CropTranslationMatrixView.as_view())), name="crop-translation-matrix"),
]