# HG changeset patch # User Madhusudan.C.S # Date 1249842991 -19800 # Node ID 7257b66a6766187ba5de412f4d88856f97ae453f # Parent 91cf6872d8535b83c93ada9c11ab7217b315e309 Purr implemented for submit form. diff -r 91cf6872d853 -r 7257b66a6766 app/projrev/models.py --- a/app/projrev/models.py Sun Aug 09 23:24:48 2009 +0530 +++ b/app/projrev/models.py Mon Aug 10 00:06:31 2009 +0530 @@ -678,25 +678,31 @@ # Field containing the Line Item to which the project belongs to. line_item = models.CharField(max_length=256, choices=sort_dict(LINE_ITEM_CHOICES)) - line_item.help_text = "Select from one of the Line Items." + line_item.help_text = 'Select from one of the Line Items.' # Field containing the name of the institution working on the # project. institution = models.CharField(max_length=256) + institution.help_text = 'Give the full name of your institution.' # Field containing the state to which the institution belongs to. state = models.CharField( max_length=256, choices=sorted(STATE_CHOICES.items(), key=lambda (k,v): (v,k))) + state.help_text = 'Select the state in which this project is taken up.' # Field containing the district to which the institution belongs # to in the state of India. district = models.CharField(max_length=256, choices=sort_dict(DISTRICT_CHOICES)) + 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.' fax_num = models.CharField(max_length=20, null=True, blank=True) + fax_num.help_text = 'Enter your fax number with the code.' # Field containing the autogenerated MICR code for the project. micr_code = models.CharField(max_length=15, unique=True) @@ -773,6 +779,7 @@ #: Field containing the Line Item to which the project belongs to. document = models.FileField(upload_to='proposals/%Y/%m/%d') + document.help_text = 'Select the document path from your local file system.' #: Field containing the date on which the document was submitted submitted_on = models.DateTimeField(auto_now_add=True) diff -r 91cf6872d853 -r 7257b66a6766 app/projrev/views/helpers/forms.py --- a/app/projrev/views/helpers/forms.py Sun Aug 09 23:24:48 2009 +0530 +++ b/app/projrev/views/helpers/forms.py Mon Aug 10 00:06:31 2009 +0530 @@ -16,7 +16,7 @@ """Creates a form for the project. """ - document = forms.FileField(required=False) + document = forms.FileField(required=False, help_text='Select the document path from your local file system.') class Meta: # We store most of the data in Project model. So even though the diff -r 91cf6872d853 -r 7257b66a6766 app/site-content/css/jquery-purr.css --- a/app/site-content/css/jquery-purr.css Sun Aug 09 23:24:48 2009 +0530 +++ b/app/site-content/css/jquery-purr.css Mon Aug 10 00:06:31 2009 +0530 @@ -19,13 +19,13 @@ width: 18px; height: 17px; text-indent: -9999px; - background: url('/soc/content/images/purrClose.png') no-repeat 0 10px; + background: url('/site-content/images/purrClose.png') no-repeat 0 10px; } .tooltip-body { min-height: 50px; padding: 22px 22px 0 22px; - background: url('/soc/content/images/purrTop.png') no-repeat left top; + background: url('/site-content/images/purrTop.png') no-repeat left top; color: #f9f9f9; } @@ -37,16 +37,18 @@ .tooltip-body h3 { margin: 0; - font-size: 1.1em; + font-size: 2em; + text-align: left; } .tooltip-body p { margin: 5px 0 0 60px; - font-size: 0.8em; + font-size: 1em; + text-align: left; line-height: 1.4em; } .tooltip-bottom { height: 22px; - background: url('/soc/content/images/purrBottom.png') no-repeat left top; + background: url('/site-content/images/purrBottom.png') no-repeat left top; } \ No newline at end of file diff -r 91cf6872d853 -r 7257b66a6766 app/templates/projrev/proposal/submit.html --- a/app/templates/projrev/proposal/submit.html Sun Aug 09 23:24:48 2009 +0530 +++ b/app/templates/projrev/proposal/submit.html Mon Aug 10 00:06:31 2009 +0530 @@ -38,47 +38,48 @@ var tooltip = [ "
", "
", - " ", + " ", "

Info

", "

", " {% autoescape off %}", - " {{ help_text|linebreaksbr|escapejs }}", + " {{ field.help_text|linebreaksbr|escapejs }}", " {% endautoescape %}", "

", "
", "
", "
" - ].join(""); - var tooltip_object=null; - var documented = $("#{{ field_id }}"); - var not_fieldset = documented.attr('tagName') !== 'FIELDSET'; - if (not_fieldset) { - documented.focus(function() { - if (tooltip_object==null) { - tooltip_object = $(tooltip).purr({usingTransparentPNG: true,removeTimer: 10000}); - } - }); - documented.blur(function() { - if (tooltip_object!==null) { - tooltip_object.remove(); - tooltip_object=null; - } - }); - } - else { - documented.find("input").hover(function() { - if (tooltip_object==null) { - tooltip_object = $(tooltip).purr({usingTransparentPNG: true,removeTimer: 10000}); - } - }, - function() { - if (tooltip_object!==null) { - tooltip_object.remove(); - tooltip_object=null; - } - }); - } - }); + ].join(""); + + var tooltip_object=null; + var documented = $("#id_{{ field.name }}"); + var not_fieldset = documented.attr('tagName') !== 'FIELDSET'; + if (not_fieldset) { + documented.focus(function() { + if (tooltip_object==null) { + tooltip_object = $(tooltip).purr({usingTransparentPNG: true,removeTimer: 10000}); + } + }); + documented.blur(function() { + if (tooltip_object!==null) { + tooltip_object.remove(); + tooltip_object=null; + } + }); + } + else { + documented.find("input").hover(function() { + if (tooltip_object==null) { + tooltip_object = $(tooltip).purr({usingTransparentPNG: true,removeTimer: 10000}); + } + }, + function() { + if (tooltip_object!==null) { + tooltip_object.remove(); + tooltip_object=null; + } + }); + } + }); {% endif %} {{ field.errors }}