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-06-10 21:13:48 +02:00
|
|
|
path(
|
|
|
|
"results/<int:pk>",
|
|
|
|
views.DownloadResultsView.as_view(),
|
|
|
|
name="election.download-results",
|
|
|
|
),
|
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",
|
|
|
|
),
|
2021-06-17 11:53:09 +02:00
|
|
|
path(
|
|
|
|
"visible/<int:pk>",
|
|
|
|
views.ElectionSetVisibleView.as_view(),
|
|
|
|
name="election.set-visible",
|
|
|
|
),
|
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>",
|
2021-08-21 22:58:01 +02:00
|
|
|
views.CreateQuestionView.as_view(),
|
2020-12-20 02:32:26 +01:00
|
|
|
name="election.add-question",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"mod-question/<int:pk>",
|
2021-08-21 22:58:01 +02:00
|
|
|
views.UpdateQuestionView.as_view(),
|
2020-12-20 02:32:26 +01:00
|
|
|
name="election.mod-question",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"del-question/<int:pk>",
|
2021-08-21 22:58:01 +02:00
|
|
|
views.DeleteQuestionView.as_view(),
|
2020-12-20 02:32:26 +01:00
|
|
|
name="election.del-question",
|
|
|
|
),
|
|
|
|
# Option views
|
|
|
|
path(
|
|
|
|
"add-option/<int:pk>",
|
2021-08-21 22:58:01 +02:00
|
|
|
views.CreateOptionView.as_view(),
|
2020-12-20 02:32:26 +01:00
|
|
|
name="election.add-option",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"mod-option/<int:pk>",
|
2021-08-21 22:58:01 +02:00
|
|
|
views.UpdateOptionView.as_view(),
|
2020-12-20 02:32:26 +01:00
|
|
|
name="election.mod-option",
|
|
|
|
),
|
|
|
|
path(
|
|
|
|
"del-option/<int:pk>",
|
2021-08-21 22:58:01 +02:00
|
|
|
views.DeleteOptionView.as_view(),
|
2020-12-20 02:32:26 +01:00
|
|
|
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",
|
|
|
|
),
|
2021-04-17 00:23:33 +02:00
|
|
|
path(
|
|
|
|
"view/<int:pk>/ballots",
|
|
|
|
views.ElectionBallotsView.as_view(),
|
|
|
|
name="election.ballots",
|
|
|
|
),
|
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
|
|
|
]
|