2020-11-20 17:46:53 +01:00
|
|
|
from django.urls import path
|
2020-12-18 00:19:18 +01:00
|
|
|
|
2020-11-20 17:46:53 +01:00
|
|
|
from . import views
|
|
|
|
|
|
|
|
urlpatterns = [
|
2020-12-20 02:32:26 +01:00
|
|
|
# Admin views
|
2020-11-20 17:46:53 +01:00
|
|
|
path("create/", views.ElectionCreateView.as_view(), name="election.create"),
|
2020-12-19 15:04:04 +01:00
|
|
|
path("admin/<int:pk>", views.ElectionAdminView.as_view(), name="election.admin"),
|
2020-12-24 00:41:29 +01:00
|
|
|
path(
|
|
|
|
"mail-voters/<int:pk>",
|
|
|
|
views.ElectionMailVotersView.as_view(),
|
|
|
|
name="election.mail-voters",
|
|
|
|
),
|
2020-12-22 01:17:38 +01:00
|
|
|
path(
|
|
|
|
"upload-voters/<int:pk>",
|
|
|
|
views.ElectionUploadVotersView.as_view(),
|
|
|
|
name="election.upload-voters",
|
|
|
|
),
|
2021-04-15 23:00:10 +02:00
|
|
|
path(
|
|
|
|
"export-voters/<int:pk>",
|
|
|
|
views.ExportVotersView.as_view(),
|
|
|
|
name="election.export-voters",
|
|
|
|
),
|
2021-03-31 13:16:10 +02:00
|
|
|
path(
|
|
|
|
"delete-vote/<int:pk>/<int:user_pk>/<int:anchor>",
|
|
|
|
views.DeleteVoteView.as_view(),
|
|
|
|
name="election.delete-vote",
|
|
|
|
),
|
2020-11-20 17:46:53 +01:00
|
|
|
path("update/<int:pk>", views.ElectionUpdateView.as_view(), name="election.update"),
|
2020-12-19 16:57:28 +01:00
|
|
|
path("tally/<int:pk>", views.ElectionTallyView.as_view(), name="election.tally"),
|
|
|
|
path(
|
2020-12-19 18:26:25 +01:00
|
|
|
"publish/<int:pk>",
|
|
|
|
views.ElectionChangePublicationView.as_view(),
|
|
|
|
name="election.publish",
|
2020-12-19 16:57:28 +01:00
|
|
|
),
|
|
|
|
path(
|
|
|
|
"archive/<int:pk>", views.ElectionArchiveView.as_view(), name="election.archive"
|
|
|
|
),
|
2020-12-20 02:32:26 +01:00
|
|
|
# Question views
|
|
|
|
path(
|
|
|
|
"add-question/<int:pk>",
|
|
|
|
views.AddQuestionView.as_view(),
|
|
|
|
name="election.add-question",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"mod-question/<int:pk>",
|
|
|
|
views.ModQuestionView.as_view(),
|
|
|
|
name="election.mod-question",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"del-question/<int:pk>",
|
|
|
|
views.DelQuestionView.as_view(),
|
|
|
|
name="election.del-question",
|
|
|
|
),
|
|
|
|
# Option views
|
|
|
|
path(
|
|
|
|
"add-option/<int:pk>",
|
|
|
|
views.AddOptionView.as_view(),
|
|
|
|
name="election.add-option",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"mod-option/<int:pk>",
|
|
|
|
views.ModOptionView.as_view(),
|
|
|
|
name="election.mod-option",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"del-option/<int:pk>",
|
|
|
|
views.DelOptionView.as_view(),
|
|
|
|
name="election.del-option",
|
|
|
|
),
|
|
|
|
# Common views
|
2021-03-25 09:31:18 +01:00
|
|
|
path("", views.ElectionListView.as_view(), name="election.list"),
|
2020-11-20 17:46:53 +01:00
|
|
|
path("view/<int:pk>", views.ElectionView.as_view(), name="election.view"),
|
2021-03-20 12:09:37 +01:00
|
|
|
path(
|
|
|
|
"view/<int:pk>/voters",
|
|
|
|
views.ElectionVotersView.as_view(),
|
|
|
|
name="election.voters",
|
|
|
|
),
|
2020-12-18 00:19:18 +01:00
|
|
|
path("vote/<int:pk>", views.VoteView.as_view(), name="election.vote"),
|
2020-11-20 17:46:53 +01:00
|
|
|
]
|