# HG changeset patch # User Madhusudan.C.S # Date 1249942131 -19800 # Node ID e7880a8f7e0437c97408037da43f3dd215108778 # Parent 3cb38edbe05f899f29d4310892aa31af7252a86a Changes to the data model for including blank districts. diff -r 3cb38edbe05f -r e7880a8f7e04 app/projrev/models.py --- a/app/projrev/models.py Mon Aug 10 19:38:53 2009 +0530 +++ b/app/projrev/models.py Tue Aug 11 03:38:51 2009 +0530 @@ -718,12 +718,13 @@ # to in the state of India. district = models.CharField(max_length=256, choices=sort_dict(DISTRICT_CHOICES), - null=True) + null=True, blank=True) district.help_text = ('First select the state before selecting the district. ' 'Select the district of the state where this project is taken up.') - mobile_num = models.CharField(max_length=20) - mobile_num.help_text = 'Enter your mobile number.' + phone_num = models.CharField(max_length=20) + phone_num.verbose_name = 'Phone Number' + phone_num.help_text = 'Enter your mobile number.' fax_num = models.CharField(max_length=20, null=True, blank=True) fax_num.help_text = 'Enter your fax number with the code.' @@ -785,7 +786,10 @@ """Get the District name from its code. """ - return cls.DISTRICT_CHOICES[code] + if code in cls.DISTRICT_CHOICES: + return cls.DISTRICT_CHOICES[code] + else: + return None @classmethod def getDistrictCode(cls, name): @@ -871,6 +875,7 @@ #: Field containing the comment entered along with the review. comment = models.TextField() + comment.verbose_name = 'Overall Comment' comment.help_text = "Enter your review comment about this proposal." #: Field representing the reference to the person who @@ -886,41 +891,77 @@ attribute1.verbose_name = ('Feasibility of the proposed activity and the ' 'appropriateness of the time frame.') + comment_a1 = models.TextField(blank=True) + comment_a1.verbose_name = 'Comment' + comment_a1.help_text = "Comment for this attribute." + attribute2 = models.PositiveSmallIntegerField( choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) attribute2.verbose_name = ('Uniqueness/novelty/innovation of the said ' 'proposal') + comment_a2 = models.TextField(blank=True) + comment_a2.verbose_name = 'Comment' + comment_a2.help_text = "Comment for this attribute." + attribute3 = models.PositiveSmallIntegerField( choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) attribute3.verbose_name = ('Scope for inter-institutional collaboration and ' 'development.') + comment_a3 = models.TextField(blank=True) + comment_a3.verbose_name = 'Comment' + comment_a3.help_text = "Comment for this attribute." + attribute4 = models.PositiveSmallIntegerField( choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) attribute4.verbose_name = ('The organisation of the programme to be carried ' 'out.') + comment_a4 = models.TextField(blank=True) + comment_a4.verbose_name = 'Comment' + comment_a4.help_text = "Comment for this attribute." + attribute5 = models.PositiveSmallIntegerField( choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) attribute5.verbose_name = ('The details of the work as the outlined by the ' 'principal investigator(PI).') + comment_a5 = models.TextField(blank=True) + comment_a5.verbose_name = 'Comment' + comment_a5.help_text = "Comment for this attribute." + attribute6 = models.PositiveSmallIntegerField( choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) attribute6.verbose_name = ('Sufficiency of funds as requested by the PI.') + comment_a6 = models.TextField(blank=True) + comment_a6.verbose_name = 'Comment' + comment_a6.help_text = "Comment for this attribute." + attribute7 = models.PositiveSmallIntegerField( choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) attribute7.verbose_name = ('Social impact/reach/spread of the outcome of the ' 'proposal.') + comment_a7 = models.TextField(blank=True) + comment_a7.verbose_name = 'Comment' + comment_a7.help_text = "Comment for this attribute." + attribute8 = models.PositiveSmallIntegerField( choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) attribute8.verbose_name = ('Contribution of the proposal to minimizing the ' 'digital divide in our country.') + comment_a8 = models.TextField(blank=True) + comment_a8.verbose_name = 'Comment' + comment_a8.help_text = "Comment for this attribute." + attribute9 = models.PositiveSmallIntegerField( choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) attribute9.verbose_name = ('Any other matter which is likely to affect the ' 'execution of the project(max 600 characters).') + + comment_a9 = models.TextField(blank=True) + comment_a9.verbose_name = 'Comment' + comment_a9.help_text = "Comment for this attribute." diff -r 3cb38edbe05f -r e7880a8f7e04 app/projrev/views/helpers/forms.py --- a/app/projrev/views/helpers/forms.py Mon Aug 10 19:38:53 2009 +0530 +++ b/app/projrev/views/helpers/forms.py Tue Aug 11 03:38:51 2009 +0530 @@ -28,7 +28,7 @@ # fields in the Project that must not appear in the form, but have # be automatically generated. fields = ('title', 'line_item', 'institution', 'address', 'city', - 'pin_code', 'state', 'district', 'mobile_num', 'fax_num') + 'pin_code', 'state', 'district', 'phone_num', 'fax_num') class ReviewForm(forms.ModelForm): diff -r 3cb38edbe05f -r e7880a8f7e04 app/projrev/views/proposal.py --- a/app/projrev/views/proposal.py Mon Aug 10 19:38:53 2009 +0530 +++ b/app/projrev/views/proposal.py Tue Aug 11 03:38:51 2009 +0530 @@ -97,9 +97,14 @@ project.district = Project.getDistrict(cleaned_data['district']) else: # Generate MICR code - cleaned_data['micr_code'] = '%s%s%d' % ( - cleaned_data['district'], cleaned_data['line_item'], - int(time.time() * 1000) % 1000000000) + if cleaned_data['district']: + cleaned_data['micr_code'] = '%s%s%d' % ( + cleaned_data['district'], cleaned_data['line_item'], + int(time.time() * 1000) % 1000000000) + else: + cleaned_data['micr_code'] = '%s%s%s%d' % ( + cleaned_data['state'], 'NN', cleaned_data['line_item'], + int(time.time() * 1000) % 1000000000) cleaned_data['line_item'] = Project.getLineItem(cleaned_data['line_item']) cleaned_data['state'] = Project.getState(cleaned_data['state']) @@ -279,16 +284,18 @@ context['form'] = rev_form context['project'] = project - proposal = project.proposal_set.all().order_by('-submitted_on')[0] - - if proposal: - proposal_path = str(proposal.document) + proposals = project.proposal_set.all().order_by('-submitted_on') + if proposals: + proposal = proposals[0] - proposal_name = proposal_path.split('/')[-1] + if proposal: + proposal_path = str(proposal.document) - context['proposal_path'] = proposal_path - context['proposal_name'] = proposal_name - context['last_submitted'] = proposal.submitted_on + proposal_name = proposal_path.split('/')[-1] + + context['proposal_path'] = proposal_path + context['proposal_name'] = proposal_name + context['last_submitted'] = proposal.submitted_on reviews = project.review_set.all().order_by('reviewed_on') if reviews: @@ -318,16 +325,18 @@ project = Project.objects.get(micr_code=micr_code) - proposal = project.proposal_set.all().order_by('-submitted_on')[0] - - if proposal: - proposal_path = str(proposal.document) + proposals = project.proposal_set.all().order_by('-submitted_on') + if proposals: + proposal = proposals[0] - proposal_name = proposal_path.split('/')[-1] + if proposal: + proposal_path = str(proposal.document) - context['proposal_path'] = proposal_path - context['proposal_name'] = proposal_name - context['last_submitted'] = proposal.submitted_on + proposal_name = proposal_path.split('/')[-1] + + context['proposal_path'] = proposal_path + context['proposal_name'] = proposal_name + context['last_submitted'] = proposal.submitted_on # Get all the reviews and put them to context. reviews = project.review_set.all().order_by('reviewed_on') diff -r 3cb38edbe05f -r e7880a8f7e04 app/site-content/css/jquery.rating.css --- a/app/site-content/css/jquery.rating.css Mon Aug 10 19:38:53 2009 +0530 +++ b/app/site-content/css/jquery.rating.css Tue Aug 11 03:38:51 2009 +0530 @@ -56,14 +56,3 @@ overflow:hidden!important } /* END jQuery.Rating Plugin CSS */ - -label { - float: left; - width: 40%; - position: relative; - top: -5px; - font-weight:bold; - margin:5px 0; - margin-right: 1em; - text-align: right; -} \ No newline at end of file diff -r 3cb38edbe05f -r e7880a8f7e04 app/site-content/css/projrev.css --- a/app/site-content/css/projrev.css Mon Aug 10 19:38:53 2009 +0530 +++ b/app/site-content/css/projrev.css Tue Aug 11 03:38:51 2009 +0530 @@ -495,3 +495,23 @@ font: normal 1em "Trebuchet MS", Tahoma, sans-serif; color:#f00; } + +label#id_comment { + float: left; + width: 12%; + font-weight:bold; + margin:5px 0; + margin-right: 1em; + text-align: right; +} + +textarea#id_comment_a1, textarea#id_comment_a2, textarea#id_comment_a3, textarea#id_comment_a4, textarea#id_comment_a5, textarea#id_comment_a6, textarea#id_comment_a7, textarea#id_comment_a8, textarea#id_comment_a9, textarea#id_comment { + width:70%; + margin-left: 3%; + padding:3px; + font: normal 1em "Trebuchet MS", Tahoma, sans-serif; + border:1px solid #eee; + height:100px; + display:inline; + color:#777; +} \ No newline at end of file diff -r 3cb38edbe05f -r e7880a8f7e04 app/templates/projrev/proposal/list.html --- a/app/templates/projrev/proposal/list.html Mon Aug 10 19:38:53 2009 +0530 +++ b/app/templates/projrev/proposal/list.html Tue Aug 11 03:38:51 2009 +0530 @@ -5,6 +5,7 @@ + @@ -13,6 +14,7 @@ {% for project in projects %} + diff -r 3cb38edbe05f -r e7880a8f7e04 app/templates/projrev/proposal/rank.html --- a/app/templates/projrev/proposal/rank.html Mon Aug 10 19:38:53 2009 +0530 +++ b/app/templates/projrev/proposal/rank.html Tue Aug 11 03:38:51 2009 +0530 @@ -11,6 +11,13 @@
+ Title: +
+
+ {{ project.title }} +
+
+
Project MICR Code:
@@ -32,6 +39,27 @@

+ Address: +
+
+ {{ project.address }} +
+
+
+ City: +
+
+ {{ project.city }} +
+
+
+ PIN Code: +
+
+ {{ project.pin_code }} +
+
+
State:
@@ -51,6 +79,7 @@ +
+

+ {{ form.attribute1.errors }} + {{ form.attribute1.label }}
+ + + + + + {% if form.attribute1.field.required %}  (required){% endif %} +

+

+ {{ form.comment_a1.errors }} + {{ form.comment_a1 }} +

+

+ {{ form.attribute2.errors }} + {{ form.attribute2.label }}
+ + + + + + {% if form.attribute2.field.required %}  (required){% endif %} +

+

+ {{ form.comment_a2.errors }} + {{ form.comment_a2 }} +

+

+ {{ form.attribute3.errors }} + {{ form.attribute3.label }}
+ + + + + + {% if form.attribute3.field.required %}  (required){% endif %} +

+

+ {{ form.comment_a3.errors }} + {{ form.comment_a3 }} +

+

+ {{ form.attribute4.errors }} + {{ form.attribute4.label }}
+ + + + + + {% if form.attribute4.field.required %}  (required){% endif %} +

+

+ {{ form.comment_a4.errors }} + {{ form.comment_a4 }} +

+

+ {{ form.attribute5.errors }} + {{ form.attribute5.label }}
+ + + + + + {% if form.attribute5.field.required %}  (required){% endif %} +

+

+ {{ form.comment_a5.errors }} + {{ form.comment_a5 }} +

+

+ {{ form.attribute6.errors }} + {{ form.attribute6.label }}
+ + + + + + {% if form.attribute6.field.required %}  (required){% endif %} +

+

+ {{ form.comment_a6.errors }} + {{ form.comment_a6 }} +

+

+ {{ form.attribute7.errors }} + {{ form.attribute7.label }}
+ + + + + + {% if form.attribute7.field.required %}  (required){% endif %} +

+

+ {{ form.comment_a7.errors }} + {{ form.comment_a7 }} +

+

+ {{ form.attribute8.errors }} + {{ form.attribute8.label }}
+ + + + + + {% if form.attribute8.field.required %}  (required){% endif %} +

+

+ {{ form.comment_a8.errors }} + {{ form.comment_a8 }} +

+

+ {{ form.attribute9.errors }} + {{ form.attribute9.label }}
+ + + + + + {% if form.attribute9.field.required %}  (required){% endif %} +

+

+ {{ form.comment_a9.errors }} + {{ form.comment_a9 }} +

+

+

{% if form.comment.help_text %} {% endif %} {{ form.comment.errors }} - {{ form.comment.label_tag }}{{ form.comment }}{% if form.comment.field.required %}  (required){% endif %} -

-

- {{ form.attribute1.errors }} - {{ form.attribute1.label_tag }} - - - - - - {% if form.attribute1.field.required %}  (required){% endif %} -

-

- {{ form.attribute2.errors }} - {{ form.attribute2.label_tag }} - - - - - - {% if form.attribute2.field.required %}  (required){% endif %} -

-

- {{ form.attribute3.errors }} - {{ form.attribute3.label_tag }} - - - - - - {% if form.attribute3.field.required %}  (required){% endif %} -

-

- {{ form.attribute4.errors }} - {{ form.attribute4.label_tag }} - - - - - - {% if form.attribute4.field.required %}  (required){% endif %} -

-

- {{ form.attribute5.errors }} - {{ form.attribute5.label_tag }} - - - - - - {% if form.attribute5.field.required %}  (required){% endif %} -

-

- {{ form.attribute6.errors }} - {{ form.attribute6.label_tag }} - - - - - - {% if form.attribute6.field.required %}  (required){% endif %} -

-

- {{ form.attribute7.errors }} - {{ form.attribute7.label_tag }} - - - - - - {% if form.attribute7.field.required %}  (required){% endif %} -

-

- {{ form.attribute8.errors }} - {{ form.attribute8.label_tag }} - - - - - - {% if form.attribute8.field.required %}  (required){% endif %} -

-

- {{ form.attribute9.errors }} - {{ form.attribute9.label_tag }} - - - - - - {% if form.attribute9.field.required %}  (required){% endif %} + {{ form.comment }}{% if form.comment.field.required %}  (required){% endif %}


MICR CodeTitle Line Item Institution State
{{ project.micr_code }}{{ project.title }} {{ project.line_item }} {{ project.institution }} {{ project.state }}