From 9e3883ae5772cacfdaefcfe1b23844347dac4d25 Mon Sep 17 00:00:00 2001 From: parth Date: Tue, 27 Mar 2012 11:00:57 +0530 Subject: added bootstrap to details form --- allotter/forms.py | 10 ++++++++-- allotter/views.py | 1 - template/allotter/details.html | 19 ++++++++++--------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/allotter/forms.py b/allotter/forms.py index 54210cc..b3a9039 100644 --- a/allotter/forms.py +++ b/allotter/forms.py @@ -94,11 +94,17 @@ class UserDetailsForm(forms.Form): def __init__(self, user, *args, **kwargs): self.user = user + self.helper = FormHelper() + self.helper.form_id = 'id-detailsform' + self.helper.form_method = 'post' + self.helper.form_class = 'form-horizontal' + self.helper.form_action = "/allotter/details/" + self.helper.add_input(Submit('submit', 'Submit')) super(UserDetailsForm, self).__init__(*args, **kwargs) - email = forms.EmailField(label="Email Address", + email = forms.EmailField(label="Email Address", widget=forms.TextInput(attrs={"placeholder":"john@example.com",}), help_text="Enter a valid email id if you have any.") - phone_number = forms.IntegerField(label="Phone number", + phone_number = forms.IntegerField(label="Phone number", widget=forms.TextInput(attrs={"placeholder":"9876543210",}), help_text="10 digit number with code") diff --git a/allotter/views.py b/allotter/views.py index c8a44a8..f4c83e5 100644 --- a/allotter/views.py +++ b/allotter/views.py @@ -125,7 +125,6 @@ def user_logout(request): #TODO: Extensive Testing @login_required ->>>>>>> master def submit_options(request, reg_no): """ Gets the Options and their preference number through the POST object and diff --git a/template/allotter/details.html b/template/allotter/details.html index 5beeb85..4d83a39 100644 --- a/template/allotter/details.html +++ b/template/allotter/details.html @@ -3,17 +3,18 @@ {% block title %}Details form {% endblock %} {% block content %} -Please provide the following details. -
{% endblock content %} -- cgit