"""
URL configuration for fnpss project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
from django.urls import path, include
from src import views
from .views import (home, ProjectTypeListView, ProjectListView, 
    ProjectDetailView, DonateView, CreateProjectView,
    UpdateProjectView, donation_payment_handler, yenu, PaymentSuccessView, PaymentFailedView, PaymentCancelView, UserProfileView, stripe_webhook, flutterwave_callback, cinetpay_callback, cinetpay_webhook, flutterwave_webhook
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.homepage, name='home-page'),
    path('contact', views.contactUs, name='contact-us'),
    path('footer', views.footer, name='footer'),
    path('causes', views.ourcauses, name='our-causes'),
    path('events', views.events, name='events'),
    path('Volunteer', views.volunteer, name='volunteer'),
    path('donate', views.donate_us, name='donate-us'),
    path('TVbvbBGgFgghJHUmnSl/', views.event_details, name='event-details'),
    path('89/wSttvbga24yutsmnSl/', views.about_us, name='about-us'),
    path('contact/', views.contact_view, name='contact_form'),
    path('staff/', views.staffdash, name='staff_dash'),
    path('add-news/', views.staffdash, name='add_actualite_news'),
    path('Hyvvc45wd6yt5m/<int:id>/vdt76', views.news_detail, name='news_detail'),
    path('GTbn54Mvsd8tFdS80/<int:id>/nNmbTSkl854g43W', views.past_newsdetail, name='past_newsdetail'),
    path('logout/', views.logout_view, name='logout'),
    path('Team/vWce589kNmTds/', views.team, name='team'),
    path('Member/vWce58/<int:id>/9kNmTds/', views.member_detail, name='teammember'),
    path('FNPSSPortal/vWce58/9kNmTds/', views.user_dash, name='userdash'),
    path('FNPSSPortal/vWce58/MXND2T67A/', views.searchany, name='searchany'),
    path('subscribe-newsletter/', views.subscribe_newsletter, name='subscribe_newsletter'),

    #payments urls
    path('', home, name='home'),
    path('projects/', ProjectListView.as_view(), name='project_list'),
    path('projects/', yenu.as_view(), name='yenu'),
    path('projects/categories/', ProjectTypeListView.as_view(), name='project_types'),
    path('projects/<int:pk>/', ProjectDetailView.as_view(), name='project_detail'),
    path('projects/<int:project_id>/donate/', DonateView.as_view(), name='donate'),
    path('projects/create/', CreateProjectView.as_view(), name='project_create'),
    path('projects/<int:pk>/update/', UpdateProjectView.as_view(), name='project_update'),
    path('donate/<int:donation_id>/process/', donation_payment_handler, name='process_payment'),
    path('payment/success/<int:donation_id>/', PaymentSuccessView.as_view(), name='payment_success'),
    path('payment/failed/<int:donation_id>/', PaymentFailedView.as_view(), name='payment_failed'),
    path('payment/cancel/<int:donation_id>/', PaymentCancelView.as_view(), name='payment_cancel'),
    path('stripe/webhook/', stripe_webhook, name='stripe_webhook'),
    path('flutterwave/callback/<int:donation_id>/', flutterwave_callback, name='flutterwave_callback'),
    path('flutterwave/webhook/', flutterwave_webhook, name='flutterwave_webhook'),
    path('cinetpay/callback/<int:donation_id>/', cinetpay_callback, name='cinetpay_callback'),
    path('cinetpay/webhook/', cinetpay_webhook, name='cinetpay_webhook'),
    path('profile/', UserProfileView.as_view(), name='profile'),
    path('accounts/', include('allauth.urls')),


    path('FNPSS-Accomplished-Projects/', views.project_accom, name='project_accom'),
    path('delete-event/<int:id>/', views.delete_event, name='delete_event'),
    path('delete-todo/<int:id>/', views.delete_todo, name='delete_todo'),
    path('update-todo/<int:id>/', views.update_todo_both, name='update_todo_both'),
    path('update-role-Admin/<int:id>/', views.update_admin_role, name='update_admin_role'),
    
    
    
] 
if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
