1 # -*- coding: utf-8 -*-
3 # Copyright (c) 2013 Clione Software
4 # Copyright (c) 2010-2013 Cidadania S. Coop. Galega
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 from django
.conf
.urls
import *
19 from django
.conf
import settings
20 from django
.conf
.urls
.i18n
import i18n_patterns
21 from django
.contrib
import admin
22 from django
.contrib
.staticfiles
.urls
import staticfiles_urlpatterns
23 from apps
.ecidadania
.voting
.views
.polls
import ViewPoll
, DeletePoll
, \
24 ListPolls
, ViewPollResults
25 from apps
.ecidadania
.voting
.views
.voting
import ViewVoting
, ListVotings
, \
26 AddVoting
, EditVoting
, DeleteVoting
27 from apps
.ecidadania
.voting
.url_names
import *
30 urlpatterns
= patterns('apps.ecidadania.voting.views',
32 url(r
'^$', ListVotings
.as_view(), name
=LIST_VOTING
),
34 url(r
'^poll/$', ListPolls
.as_view(), name
=LIST_POLL
),
36 url(r
'^add/$', AddVoting
.as_view(), name
=ADD_VOTING
),
38 url(r
'^add/poll/$', 'polls.add_poll', name
=ADD_POLL
),
40 url(r
'^poll/(?P<poll_id>\d+)/edit/$', 'polls.edit_poll', name
=EDIT_POLL
),
42 url(r
'^(?P<voting_id>\d+)/edit/$', EditVoting
.as_view(),
45 url(r
'^poll/(?P<poll_id>\d+)/delete/$', DeletePoll
.as_view(),
48 url(r
'^(?P<voting_id>\d+)/delete/$', DeleteVoting
.as_view(),
51 url(r
'^poll/(?P<pk>\d+)/$', ViewPoll
.as_view(), name
=VIEW_POLL
),
53 url(r
'^poll/(?P<pk>\d+)/results/$', ViewPollResults
.as_view(),
56 url(r
'^(?P<voting_id>\d+)/$', ViewVoting
.as_view(), name
=VIEW_VOTING
),
58 url(r
'^vote/poll/(?P<poll_id>\d+)/$', 'polls.vote_poll', name
=VOTE_POLL
),
60 url(r
'^vote/voting/$', 'voting.vote_voting', name
=VOTE_VOTING
),
62 url(r
'^vote/validate/(?P<token>\w+)/$', 'voting.validate_voting',