# polls routes or urls


from django.urls import path
from . import views

urlpatterns = [
    path('', views.home, name='home'),
    
    # polls urls
    # path('polls/create', views.create_polls, name='polls.create'),
    path('polls/store', views.store_polls, name='polls.store'),
    path('polls/<int:id>/edit', views.edit_polls, name='polls.edit'),
    path('polls/<int:id>/delete', views.delete_polls, name='polls.delete'),
    path('polls/<int:id>/questions',views.manage_questions, name='polls.questions.manage'), # questions managment url
    path('polls/<int:id>/questions/save',views.save_questions, name='polls.questions.save'), # questions managment url    
    path('polls/<int:id>/questions/<int:qid>/edit',views.edit_question, name='polls.questions.edit'), # edit question url
    path('polls/<int:id>/questions/<int:qid>/delete',views.delete_question, name='polls.questions.delete'), # delete question url
    path('possibilities',views.possibilities, name='possibilities'), #  possibilities url
    path('polls', views.polls, name='polls.index'),
    path('polls/<int:id>/edit', views.edit_polls, name='polls.edit'),
    path('polls/<int:id>/delete', views.delete_polls, name='polls.delete'),

    
    # participants urls
    path('participants', views.participants, name='participants.index'), 
    path('participants/<int:id>/delete', views.participant_delete, name='participants.delete'),
    
    # share urls
    path('polls/<int:id>/share', views.share_poll, name='polls.share'),    
    # responses urls
    path('r/<uuid:token>/<uuid:key>', views.respond_poll, name='polls.respond'),
    path('r/<uuid:token>/<uuid:key>/responses/store', views.save_one, name='polls.responses.save'),
    path('r/q/<uuid:token>/<uuid:key>', views.respond_polll, name='pollls.respond'),
    path('responses/store/<int:qid>/<uuid:token>/<uuid:key>', views.save_question_htmx, name='poll.response.question.store'),
    
    # statistics urls
    path('statistics', views.stats, name='statistics'),
    path('polls/<int:id>/statistics/data', views.stats_data, name='poll.statistics')
]