From f568059d6da5de36908377893d8f64c880698afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Nov=C3=BD?= <github-lnovy@krtek.net> Date: Tue, 7 Jul 2015 05:21:04 +0000 Subject: [PATCH] Allow to restrict election by time --- helios/forms.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/helios/forms.py b/helios/forms.py index ab6ce42..2ab1f3e 100644 --- a/helios/forms.py +++ b/helios/forms.py @@ -4,8 +4,8 @@ Forms for Helios from django import forms from models import Election -from widgets import * -from fields import * +#from widgets import * +#from fields import * from django.conf import settings @@ -19,6 +19,10 @@ class ElectionForm(forms.Form): randomize_answer_order = forms.BooleanField(required=False, initial=False, help_text='enable this if you want the answers to questions to appear in random order for each voter') private_p = forms.BooleanField(required=False, initial=False, label="Private?", help_text='A private election is only visible to registered voters.') help_email = forms.CharField(required=False, initial="", label="Help Email Address", help_text='An email address voters should contact if they need help.') + voting_starts_at = forms.SplitDateTimeField(help_text = 'UTC date and time when voting begins', + widget=forms.SplitDateTimeWidget, required=False) + voting_ends_at = forms.SplitDateTimeField(help_text = 'UTC date and time when voting ends', + widget=forms.SplitDateTimeWidget, required=False) if settings.ALLOW_ELECTION_INFO_URL: election_info_url = forms.CharField(required=False, initial="", label="Election Info Download URL", help_text="the URL of a PDF document that contains extra election information, e.g. candidate bios and statements") @@ -26,10 +30,11 @@ class ElectionForm(forms.Form): class ElectionTimesForm(forms.Form): # times - voting_starts_at = SplitDateTimeField(help_text = 'UTC date and time when voting begins', - widget=SplitSelectDateTimeWidget) - voting_ends_at = SplitDateTimeField(help_text = 'UTC date and time when voting ends', - widget=SplitSelectDateTimeWidget) +# voting_starts_at = forms.SplitDateTimeField(help_text = 'UTC date and time when voting begins', +# widget=SplitSelectDateTimeWidget) +# voting_ends_at = forms.SplitDateTimeField(help_text = 'UTC date and time when voting ends', +# widget=SplitSelectDateTimeWidget) + pass class EmailVotersForm(forms.Form): -- GitLab