forked from DemocracyClub/WhoCanIVoteFor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
urls.py
102 lines (100 loc) · 2.92 KB
/
urls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
from core.views import TranslatedTemplateView
from django.urls import re_path
from elections.views.postcode_view import (
DummyPostcodeiCalView,
DummyPostcodeView,
)
from .helpers import ElectionIDSwitcher
from .views import (
ElectionsView,
ElectionView,
PartyListVew,
PostcodeiCalView,
PostcodeView,
PostView,
RedirectPostView,
)
urlpatterns = [
re_path(r"^$", ElectionsView.as_view(), name="elections_view"),
re_path(
r"^(?P<election_id>[a-z0-9\.\-]+)/post-(?P<post_id>.*)/(?P<ignored_slug>[^/]+)$",
RedirectPostView.as_view(),
name="redirect_post_view",
),
re_path(
r"^(?P<election>[201[05]+)/(?P<ignored_slug>[^/]+)/$",
ElectionView.as_view(),
name="redirect_election_view",
),
re_path(
r"^(?P<election>[a-z\-]+\.[^/]+)/(?P<party_id>(joint-party|party|minor-party|ynmp-party):[0-9\-]+)/$",
PartyListVew.as_view(),
name="party_list_view",
),
#
re_path(
"^(?P<election>[a-z\-]+\.[^/]+)(?:/(?P<ignored_slug>[^/]+))?/$",
ElectionIDSwitcher(election_view=ElectionView, ballot_view=PostView),
name="election_view",
),
re_path(
r"^TE1 1ST/$",
DummyPostcodeView.as_view(postcode="TE1 1ST"),
name="dummy_postcode_view",
),
re_path(
r"^voting_system/fptp/",
TranslatedTemplateView.as_view(
template_name="elections/fptp.html",
extra_context={"voting_system": "First-past-the-post"},
),
name="fptp_voting_system_view",
),
re_path(
r"^voting_system/ams/",
TranslatedTemplateView.as_view(
template_name="elections/ams.html",
extra_context={"voting_sytem": "Additional Member System"},
),
name="ams_voting_system_view",
),
re_path(
r"^voting_system/sv/",
TranslatedTemplateView.as_view(
template_name="elections/sv.html",
extra_context={"voting_sytem": "Supplementary Vote"},
),
name="sv_voting_system_view",
),
re_path(
r"^voting_system/STV/",
TranslatedTemplateView.as_view(
template_name="elections/stv.html",
extra_context={"voting_sytem": "Single Transferable Vote"},
),
name="stv_voting_system_view",
),
re_path(
r"^TE1 1ST.ics$",
DummyPostcodeiCalView.as_view(),
name="dummy_postcode_ical_view",
),
re_path(
r"^(?P<postcode>[^/]+)/(?P<uprn>[^/]+)/$",
PostcodeView.as_view(),
name="uprn_view",
),
re_path(
r"^(?P<postcode>[^/]+).ics$",
PostcodeiCalView.as_view(),
name="postcode_ical_view",
),
re_path(
r"^(?P<postcode>[^/]+)/(?P<uprn>[^/]+).ics$",
PostcodeiCalView.as_view(),
name="uprn_ical_view",
),
re_path(
r"^(?P<postcode>[^/]+)/$", PostcodeView.as_view(), name="postcode_view"
),
]