diff options
author | root | 2012-04-11 17:24:19 +0530 |
---|---|---|
committer | root | 2012-04-11 17:24:19 +0530 |
commit | 87dbdb6ee3739704e6170e13a931e8747cc3faf8 (patch) | |
tree | 252f7407164b947936db5e5105a4989b9182d22f | |
parent | c671a7c3af9236f39ef08f7bfed79270b28f9c65 (diff) | |
parent | 8006931d66ebf5f2ca678b66cf1cbbd2ac3fd344 (diff) | |
download | aloha-87dbdb6ee3739704e6170e13a931e8747cc3faf8.tar.gz aloha-87dbdb6ee3739704e6170e13a931e8747cc3faf8.tar.bz2 aloha-87dbdb6ee3739704e6170e13a931e8747cc3faf8.zip |
Merge branch 'master' of https://github.com/FOSSEE/aloha
-rw-r--r-- | aloha/allotter/forms.py | 56 | ||||
-rw-r--r-- | aloha/allotter/management/commands/loadusers.py | 7 | ||||
-rw-r--r-- | aloha/allotter/models.py | 8 | ||||
-rw-r--r-- | aloha/allotter/views.py | 7 | ||||
-rw-r--r-- | aloha/settings.py | 2 | ||||
-rw-r--r-- | aloha/static/js/browser-check.js | 4 | ||||
-rw-r--r-- | aloha/template/allotter/apply.html | 29 | ||||
-rw-r--r-- | aloha/template/allotter/complete.html | 28 | ||||
-rw-r--r-- | aloha/template/allotter/details.html | 9 | ||||
-rw-r--r-- | aloha/template/base.html | 2 |
10 files changed, 90 insertions, 62 deletions
diff --git a/aloha/allotter/forms.py b/aloha/allotter/forms.py index cd79b0e..5639325 100644 --- a/aloha/allotter/forms.py +++ b/aloha/allotter/forms.py @@ -1,6 +1,7 @@ from django import forms from allotter.models import Profile from django.forms.extras.widgets import SelectDateWidget +from django.forms.widgets import RadioSelect from django.utils.encoding import * @@ -10,9 +11,13 @@ from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from string import digits, uppercase +import settings BIRTH_YEAR_CHOICES = tuple(range(1960, 1994, 1)) DD_YEAR_CHOICES = (2012,) +CATEGORY_CHOICES = [('GEN','General'), ('OBC-NCL', 'OBC-NCL'), ('OBC-NCL-M', 'OBC-NCL(Minorities)'), + ('SC', 'SC'), ('ST', 'ST')] +PD_CHOICES = [('Y', 'Yes'), ('N', 'No')] class UserLoginForm(forms.Form): @@ -22,8 +27,8 @@ class UserLoginForm(forms.Form): help_text="As on your Examination Admit Card") ##Application number as password - password = forms.CharField(label = "Application Number", - max_length=10, help_text="As on your Examination Admit Card") + #password = forms.CharField(label = "Application Number", + # max_length=10, help_text="As on your Examination Admit Card") dob = forms.DateField(label="Date of Birth", widget=SelectDateWidget(years=BIRTH_YEAR_CHOICES, attrs={"class":"span1"}), @@ -60,22 +65,23 @@ class UserLoginForm(forms.Form): except User.DoesNotExist: raise forms.ValidationError("Entered Registration Number haven't appeared for JAM Exam.") - def clean_password(self): - - pwd = self.cleaned_data['password'] - +# def clean_password(self): +# +# pwd = self.cleaned_data['password'] +# ##Verifying the length of application number and whether it contains ##only digits. - if str(pwd).strip(digits) and len(pwd) != 5: - msg = "Not a valid Application Number" - raise forms.ValidationError(msg) - - return pwd +# if str(pwd).strip(digits) and len(pwd) != 5: +# msg = "Not a valid Application Number" +# raise forms.ValidationError(msg) +# +# return pwd def clean(self): super(UserLoginForm, self).clean() - u_name, pwd = self.cleaned_data.get('username'), self.cleaned_data.get('password') + u_name = self.cleaned_data.get('username') + pwd = settings.DEFAULT_PASSWORD dob = self.cleaned_data["dob"] dd_no = self.cleaned_data.get("dd_no") dd_date = self.cleaned_data.get("dd_date") @@ -131,9 +137,18 @@ class UserDetailsForm(forms.Form): email = forms.EmailField(label="Email Address", widget=forms.TextInput(attrs={"placeholder":"john@example.com",}), help_text="Enter a valid email id where you will able to receive correspondence from JAM 2012.") - phone_number = forms.CharField(label="Phone number", max_length=15, widget=forms.TextInput(attrs={"placeholder":"9876543210",}), help_text="Phone number with code. For example 02225722545 (with neither spaces nor dashes)") - cat_check = forms.BooleanField(required=False, initial=False, label="Check this if you belong to SEBC-M Category") + phone_number = forms.CharField(label="Phone number", max_length=15, + widget=forms.TextInput(attrs={"placeholder":"9876543210",}), + help_text="Phone number with code. For example 02225722545 (with neither spaces nor dashes)") + + category = forms.ChoiceField(widget=forms.Select(attrs={'class':'selector'}), + label="Category", choices=CATEGORY_CHOICES, + help_text="The category you select is normally the one you have specified at the time of applying for the JAM 2012 examination. The category verification is only after submitting the relevantdocuments and scrutiny by the JAM 2012 committee and the institute for which you are applying. Candidates applying under the new category OBC-M should have specified OBC at the time of applying for the JAM 2012 and would now have to supply the additional relevant documents for this category.") + + pd = forms.ChoiceField(label="Physical Disability", widget=RadioSelect, choices=PD_CHOICES) + + def clean_phone_number(self): pno = self.cleaned_data['phone_number'] @@ -147,15 +162,18 @@ class UserDetailsForm(forms.Form): email = self.cleaned_data['email'] phone_number = self.cleaned_data['phone_number'] - cat_check = self.cleaned_data['cat_check'] + category = self.cleaned_data['category'] + pd_status = self.cleaned_data['pd'] if email and phone_number: user_profile.secondary_email = email - user_profile.phone_number = phone_number + user_profile.phone_number = phone_number else: raise forms.ValidationError("Make sure that you have entered all the details.") - if cat_check: - user_profile.cat_status = True - + + user_application = user_profile.application + user_application.cgy = category + user_application.pd_status = pd_status + user_application.save() user_profile.save() diff --git a/aloha/allotter/management/commands/loadusers.py b/aloha/allotter/management/commands/loadusers.py index 99fd075..172aa95 100644 --- a/aloha/allotter/management/commands/loadusers.py +++ b/aloha/allotter/management/commands/loadusers.py @@ -3,6 +3,7 @@ from datetime import datetime from csv import DictReader from django.core.management.base import BaseCommand from allotter.models import Exam, Application, User, Profile +from settings import DEFAULT_PASSWORD class Command(BaseCommand): option_list = BaseCommand.option_list + ( @@ -38,9 +39,8 @@ def load_users(options): for data in userReader: - appno = data['AppNo.'] regno = data['Reg.No.'] - new_user = User.objects.create_user(regno, password=appno, email="") + new_user = User.objects.create_user(regno, password=DEFAULT_PASSWORD, email="") application = Application(user=new_user) application.np = int(data['NP']) if data['P1'].strip(): @@ -56,10 +56,9 @@ def load_users(options): application.nat = data['Nat'] application.gender = data['Gdr'] application.cent = data['Cent'] - application.cgy = data['Cgy'] application.save() dob = datetime.strptime(data['DOB'], "%d/%m/%y") new_profile = Profile(user=new_user, application=application) new_profile.dob = dob new_profile.save() - print "Added user with {0} and {1} with dob as {2}".format(appno,regno,dob)
\ No newline at end of file + print "Added user with {0} with dob as {1}".format(regno,dob) diff --git a/aloha/allotter/models.py b/aloha/allotter/models.py index 3be370f..4d3ac3e 100644 --- a/aloha/allotter/models.py +++ b/aloha/allotter/models.py @@ -102,7 +102,9 @@ class Application(models.Model): cent = models.IntegerField(max_length=10, verbose_name="Center Code") cgy = models.CharField(max_length=10, verbose_name="Category") - + + pd_status = models.CharField(max_length=1, verbose_name="Physical Disability", + help_text="Y for Yes, N for No", blank=True, default="N") submitted = models.BooleanField(verbose_name="Submission Status", default=False) @@ -125,9 +127,7 @@ class Profile(models.Model): help_text=u"Phone number read from user after authentication") dd_no = models.CharField(max_length=15, verbose_name="Demand Draft Number", blank=True, null=True) - - cat_status = models.BooleanField(help_text="Whether belongs to Category SBOBC", default=False) - + #Application for the Profile application = models.ForeignKey(Application) diff --git a/aloha/allotter/views.py b/aloha/allotter/views.py index a91b5e5..344669f 100644 --- a/aloha/allotter/views.py +++ b/aloha/allotter/views.py @@ -61,10 +61,7 @@ def submit_details(request): Get the secondary email address, phone number and save it to the Profile. """ user = request.user - category = user.get_profile().application.cgy #Getting the Category information - #Flag set based on OBC Check - if category == "B": cat_flag = True - else: cat_flag = False + if request.method == "POST": form = UserDetailsForm(user, request.POST) if form.is_valid(): @@ -76,7 +73,7 @@ def submit_details(request): else: form = UserDetailsForm(request.user) - context = {"form": form, "cat_flag": cat_flag} + context = {"form": form} return render(request, 'allotter/details.html', context) def get_details(user, error_message = ""): diff --git a/aloha/settings.py b/aloha/settings.py index e75064b..8efb057 100644 --- a/aloha/settings.py +++ b/aloha/settings.py @@ -185,3 +185,5 @@ APPLICATION_PDF = "application.pdf" AUTO_LOGOUT_DELAY = 15 +DEFAULT_PASSWORD = "JamPassword" + diff --git a/aloha/static/js/browser-check.js b/aloha/static/js/browser-check.js index 17bda46..3f1bfcf 100644 --- a/aloha/static/js/browser-check.js +++ b/aloha/static/js/browser-check.js @@ -1,8 +1,8 @@ $(document).ready(function(){ - if(($.browser.msie) && ($.browser.version <8)){ + if(($.browser.msie) && ($.browser.version <=7)){ window.location="/browser-version" } - if(($.browser.mozilla) && (parseInt($.browser.version) <=5)){ + if(($.browser.mozilla) && (parseInt($.browser.version) <3)){ window.location="/browser-version" } if(($.browser.webkit) && (parseInt($.browser.version <=530))){ diff --git a/aloha/template/allotter/apply.html b/aloha/template/allotter/apply.html index c204c50..92771bd 100644 --- a/aloha/template/allotter/apply.html +++ b/aloha/template/allotter/apply.html @@ -53,7 +53,7 @@ $(document).ready(function(){ <hr/> -<h4>You are eligible for programmes on the basis of <b>{{first_paper}} ({{first_paper_code}}) </b> +<h3>You are eligible for programmes on the basis of <b>{{first_paper}} ({{first_paper_code}}) </b> {% comment %} Checking if there is second paper and displaying its name. @@ -65,7 +65,7 @@ and <b>{{second_paper}} ({{second_paper_code}})</b> {% endif %} -</h4> +</h3> <br/> @@ -73,15 +73,26 @@ and <b>{{second_paper}} ({{second_paper_code}})</b> qualified in JAM 2012. If you have qualified in more than one paper you are eligible for programmes covered by both papers. Mention the order of preference (1, 2, 3, etc) in the last column. In the 'Order of Preference' column, mark <b>None</b> against the programmes -that you are NOT interested in. <br/> <b>Please note:</b> The order of Preference plays an important role in +that you are NOT interested in. </p> + +<p><b>Please note:</b> The order of Preference plays an important role in the admission process.</p> -<p> -<b>Note: </b>If you have qualified in two papers in JAM 2012 and would like to choose programmes eligible +<div class="alert alert-info"> +<h3 class="alert-heading">Note</h3> +<b>If you have qualified in two papers in JAM 2012 and would like to choose programmes eligible under both the papers, the order of preferences should be combined. For example: a candidate qualifying both BT and CY can have an order of preference such as 1 under BT, 2 under CY, 3 -under BT and so on. -</p> +under BT and so on.</b> +</div> + +<div class="alert alert-info"> +<h3 class="alert-heading">Warning!</h3> +<b>Candidates should ensure that the choices specified by them +are distinct for each programme of their interest and are in the +ascending order of their preference - i.e. their most preferred +programme is selected as 1, etc.</b> +</div> @@ -115,7 +126,7 @@ Listing the options for first test paper. <td><p> {{option.opt_location }} </p></td> <td><select class="{{option.opt_code}}" name="{{option.opt_code}}"> {% for i in options_range %} - <option value="{{i}}" selected="selected">Preference {{i}}</option> + <option value="{{i}}" >Preference {{i}}</option> {% endfor %} <option value="0" selected="selected">None</option> </select> @@ -145,7 +156,7 @@ Listing the options for first test paper. <td><p> {{option.opt_location }} </p></td> <td><select class="{{option.opt_code}}" name="{{option.opt_code}}"> {% for i in options_range %} - <option value="{{i}}" selected="selected">Preference {{i}}</option> + <option value="{{i}}">Preference {{i}}</option> {% endfor %} <option value="0" selected="selected">None</option> </select> diff --git a/aloha/template/allotter/complete.html b/aloha/template/allotter/complete.html index 19aa102..7961db4 100644 --- a/aloha/template/allotter/complete.html +++ b/aloha/template/allotter/complete.html @@ -17,9 +17,10 @@ $(document).ready(function(){ {% block content %} -<h2> The following options have been saved. Please verify them before logging out.</h2> - -<h3> Please keep in mind that, the next time you login you will be redirected to this page straightaway.</h3> +<h3>Please ensure that the choices listed below are those that you +intend to submit finally and only then go ahead to the rest of the +procedure. If there is an error, please use the edit button to go back +and re-do your choices</h3> {% if options_chosen %} <table class="table table-bordered table-striped"> @@ -50,21 +51,27 @@ An email with the list of options has been sent to {{ email }} for reference. {% else %} -<h3> No Options were chosen, click <b>Edit Options</b> to go back and select -options otherwise click <b>Quit Allotment</b> to exit the allotment process </h3> +<p><h4> No Options were chosen, click <b>Edit Options</b> to go back and select +options otherwise click <b>Quit Allotment</b> to exit the allotment process </h4></p> {% endif %} <br/> <br/> +<hr /> <p>You may edit your options by clicking <b>Edit Options</b>. <i>Please keep in mind that your previous options will be deleted.</i></p> <form id="apply" action="/allotter/apply/" method="post"> {% csrf_token %} <input type="submit" name="apply" value="Edit Options" class="btn" /> </form> - -<p>Click on the button <b>Download Application PDF</b> to download a PDF of the application form.</p> +<hr /> +<p>Click on the button <b>Download Application PDF</b> to download +a PDF of the application form. <br/> <br/> +Candidates are advised +to read the JAM 2012 brochure and JAM 2012 website carefully +regarding Minimum Educational Qualification and Aggregate Marks +requirements and other details before sending in their application</p> <a href="http://www.iitb.ac.in/~pge/2k12/jam/adm_form.pdf" class="btn" >Download Application PDF</a> @@ -80,11 +87,14 @@ your completed application form to the Organizing chairman </p> <form id="logout" action="/allotter/logout/" method="post"> {% csrf_token %} -<div class="alert"> +<div class="alert alert-error"> <p><input type="checkbox" name="check" id="check"/><label for="check">I have downloaded 2 PDF's that together consitute my application.</label> </p> -<input type="submit" name="logout" value="Log out" class="btn" id="checkButton" disabled="disabled" /> +<input type="submit" name="logout" value="Quit Admission Application" class="btn" id="checkButton" disabled="disabled" /> +<p><b>This will finish the application procedure and the choices +you have given will be taken as final after that.</b></p> + </div> </form> diff --git a/aloha/template/allotter/details.html b/aloha/template/allotter/details.html index 4cfe1a2..bedcf90 100644 --- a/aloha/template/allotter/details.html +++ b/aloha/template/allotter/details.html @@ -1,15 +1,6 @@ {% extends "base.html" %} {% block title %}Details form {% endblock %} -{% block scripts %} -<script> -$(document).ready(function(){ - if("{{ cat_flag}}" =="False"){ - $("#div_id_cat_check").hide() - } -}); -</script> -{% endblock scripts %} {% block content %} <h2>Please provide the following details.</h2> <div class="alert alert-block"> diff --git a/aloha/template/base.html b/aloha/template/base.html index 63863eb..9185e11 100644 --- a/aloha/template/base.html +++ b/aloha/template/base.html @@ -81,7 +81,7 @@ <li class="nav-header"><h2>Notes</h2></li> <li><hr></li> <li><span class="label label-important pull-right">Important</span></li> - <li>Supported Browsers : <br />Google chrome >= 12<br /> Mozilla Firefox >= 5<br /> Microsoft Internet Explorer >= 9 <br />Opera >=11.0</li> + <li>Supported Browsers : <br />Google chrome >= 12<br /> Mozilla Firefox >= 3<br /> Microsoft Internet Explorer >= 8 <br />Opera >=11.0</li> <li><hr></li> <li><span class="label label-info pull-right">Info</span></li> <li>JAM 2012 allotment online form filling starts from : 12-4-2012.</li> |