Review form changes.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Wed, 12 Aug 2009 19:30:12 +0530
changeset 42 4cf4c1f0e5bb
parent 41 64249ebaf65a
child 43 55e650bb9dbe
Review form changes.
app/projrev/views/helpers/templatetags/review_helpers.py
app/templates/projrev/proposal/review.html
app/templates/projrev/templatetags/_as_review.html
--- a/app/projrev/views/helpers/templatetags/review_helpers.py	Tue Aug 11 04:34:01 2009 +0530
+++ b/app/projrev/views/helpers/templatetags/review_helpers.py	Wed Aug 12 19:30:12 2009 +0530
@@ -72,4 +72,11 @@
     if proposal:
       return str(proposal.id)
 
-  return 'NA'
\ No newline at end of file
+  return 'NA'
+
+@register.filter()
+def splitline(comment):
+  """Split into a line
+  """
+
+  return str(comment.split('\n')[0])
\ No newline at end of file
--- a/app/templates/projrev/proposal/review.html	Tue Aug 11 04:34:01 2009 +0530
+++ b/app/templates/projrev/proposal/review.html	Wed Aug 12 19:30:12 2009 +0530
@@ -5,9 +5,8 @@
 {{ block.super }}
 <script type="text/javascript">
 $(document).ready(function () {
-  $('#attribute1').html();
-  
-}
+  alert($('#attribute1[value=1]').attr('checked', 'checked'));
+});
 </script>
 {% endblock scripts %}
 
@@ -98,11 +97,11 @@
       <p>
         {{ form.attribute1.errors }}
         <strong>{{ form.attribute1.label }}</strong><br />
-        <input id="attribute1" name="attribute1" type="radio" class="star" value="1"/>
-        <input id="attribute1" name="attribute1" type="radio" class="star" value="2"/>
-        <input id="attribute1" name="attribute1" type="radio" class="star" value="3"/>
-        <input id="attribute1" name="attribute1" type="radio" class="star" value="4" />
-        <input id="attribute1" name="attribute1" type="radio" class="star" value="5"/> 
+        <input name="attribute1" type="radio" class="star" title="Poor" value="1"/>
+        <input name="attribute1" type="radio" class="star" title="Average" value="2"/>
+        <input name="attribute1" type="radio" class="star" title="Good" value="3"/>
+        <input name="attribute1" type="radio" class="star" title="Very Good" value="4" />
+        <input name="attribute1" type="radio" class="star" title="Excellent" value="5"/> 
         {% if form.attribute1.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
       </p>
       <p>
@@ -112,11 +111,11 @@
       <p>
         {{ form.attribute2.errors }}
         <strong>{{ form.attribute2.label }}</strong><br />
-        <input name="attribute2" type="radio" class="star" value="1"/>
-        <input name="attribute2" type="radio" class="star" value="2"/>
-        <input name="attribute2" type="radio" class="star" value="3"/>
-        <input name="attribute2" type="radio" class="star" value="4"/>
-        <input name="attribute2" type="radio" class="star" value="5"/> 
+        <input name="attribute2" type="radio" class="star" title="Poor" value="1"/>
+        <input name="attribute2" type="radio" class="star" title="Average" value="2"/>
+        <input name="attribute2" type="radio" class="star" title="Good" value="3"/>
+        <input name="attribute2" type="radio" class="star" title="Very Good" value="4"/>
+        <input name="attribute2" type="radio" class="star" title="Excellent" value="5"/> 
         {% if form.attribute2.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
       </p>
       <p>
@@ -126,11 +125,11 @@
       <p>
         {{ form.attribute3.errors }}
         <strong>{{ form.attribute3.label }}</strong><br />
-        <input name="attribute3" type="radio" class="star" value="1"/>
-        <input name="attribute3" type="radio" class="star" value="2"/>
-        <input name="attribute3" type="radio" class="star" value="3"/>
-        <input name="attribute3" type="radio" class="star" value="4"/>
-        <input name="attribute3" type="radio" class="star" value="5"/> 
+        <input name="attribute3" type="radio" class="star" title="Poor" value="1"/>
+        <input name="attribute3" type="radio" class="star" title="Average" value="2"/>
+        <input name="attribute3" type="radio" class="star" title="Good" value="3"/>
+        <input name="attribute3" type="radio" class="star" title="Very Good" value="4"/>
+        <input name="attribute3" type="radio" class="star" title="Excellent" value="5"/> 
         {% if form.attribute3.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
       </p>
       <p>
@@ -140,11 +139,11 @@
       <p>
         {{ form.attribute4.errors }}
         <strong>{{ form.attribute4.label }}</strong><br />
-        <input name="attribute4" type="radio" class="star" value="1"/>
-        <input name="attribute4" type="radio" class="star" value="2"/>
-        <input name="attribute4" type="radio" class="star" value="3"/>
-        <input name="attribute4" type="radio" class="star" value="4"/>
-        <input name="attribute4" type="radio" class="star" value="5"/> 
+        <input name="attribute4" type="radio" class="star" title="Poor" value="1"/>
+        <input name="attribute4" type="radio" class="star" title="Average" value="2"/>
+        <input name="attribute4" type="radio" class="star" title="Good" value="3"/>
+        <input name="attribute4" type="radio" class="star" title="Very Good" value="4"/>
+        <input name="attribute4" type="radio" class="star" title="Excellent" value="5"/> 
         {% if form.attribute4.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
       </p>
       <p>
@@ -154,11 +153,11 @@
       <p>
         {{ form.attribute5.errors }}
         <strong>{{ form.attribute5.label }}</strong><br />
-        <input name="attribute5" type="radio" class="star" value="1"/>
-        <input name="attribute5" type="radio" class="star" value="2"/>
-        <input name="attribute5" type="radio" class="star" value="3"/>
-        <input name="attribute5" type="radio" class="star" value="4"/>
-        <input name="attribute5" type="radio" class="star" value="5"/> 
+        <input name="attribute5" type="radio" class="star" title="Poor" value="1"/>
+        <input name="attribute5" type="radio" class="star" title="Average" value="2"/>
+        <input name="attribute5" type="radio" class="star" title="Good" value="3"/>
+        <input name="attribute5" type="radio" class="star" title="Very Good" value="4"/>
+        <input name="attribute5" type="radio" class="star" title="Excellent" value="5"/> 
         {% if form.attribute5.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
       </p>
       <p>
@@ -168,11 +167,11 @@
       <p>
         {{ form.attribute6.errors }}
         <strong>{{ form.attribute6.label }}</strong><br />
-        <input name="attribute6" type="radio" class="star" value="1"/>
-        <input name="attribute6" type="radio" class="star" value="2"/>
-        <input name="attribute6" type="radio" class="star" value="3"/>
-        <input name="attribute6" type="radio" class="star" value="4"/>
-        <input name="attribute6" type="radio" class="star" value="5"/> 
+        <input name="attribute6" type="radio" class="star" title="Poor" value="1"/>
+        <input name="attribute6" type="radio" class="star" title="Average" value="2"/>
+        <input name="attribute6" type="radio" class="star" title="Good" value="3"/>
+        <input name="attribute6" type="radio" class="star" title="Very Good" value="4"/>
+        <input name="attribute6" type="radio" class="star" title="Excellent" value="5"/> 
         {% if form.attribute6.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
       </p>
       <p>
@@ -182,11 +181,11 @@
       <p>
         {{ form.attribute7.errors }}
         <strong>{{ form.attribute7.label }}</strong><br />
-        <input name="attribute7" type="radio" class="star" value="1"/>
-        <input name="attribute7" type="radio" class="star" value="2"/>
-        <input name="attribute7" type="radio" class="star" value="3"/>
-        <input name="attribute7" type="radio" class="star" value="4"/>
-        <input name="attribute7" type="radio" class="star" value="5"/> 
+        <input name="attribute7" type="radio" class="star" title="Poor" value="1"/>
+        <input name="attribute7" type="radio" class="star" title="Average" value="2"/>
+        <input name="attribute7" type="radio" class="star" title="Good" value="3"/>
+        <input name="attribute7" type="radio" class="star" title="Very Good" value="4"/>
+        <input name="attribute7" type="radio" class="star" title="Excellent" value="5"/> 
         {% if form.attribute7.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
       </p>
       <p>
@@ -196,11 +195,11 @@
       <p>
         {{ form.attribute8.errors }}
         <strong>{{ form.attribute8.label }}</strong><br />
-        <input name="attribute8" type="radio" class="star" value="1"/>
-        <input name="attribute8" type="radio" class="star" value="2"/>
-        <input name="attribute8" type="radio" class="star" value="3"/>
-        <input name="attribute8" type="radio" class="star" value="4"/>
-        <input name="attribute8" type="radio" class="star" value="5"/> 
+        <input name="attribute8" type="radio" class="star" title="Poor" value="1"/>
+        <input name="attribute8" type="radio" class="star" title="Average" value="2"/>
+        <input name="attribute8" type="radio" class="star" title="Good" value="3"/>
+        <input name="attribute8" type="radio" class="star" title="Very Good" value="4"/>
+        <input name="attribute8" type="radio" class="star" title="Excellent" value="5"/> 
         {% if form.attribute8.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
       </p>
       <p>
@@ -210,11 +209,11 @@
       <p>
         {{ form.attribute9.errors }}
         <strong>{{ form.attribute9.label }}</strong><br />
-        <input name="attribute9" type="radio" class="star" value="1"/>
-        <input name="attribute9" type="radio" class="star" value="2"/>
-        <input name="attribute9" type="radio" class="star" value="3"/>
-        <input name="attribute9" type="radio" class="star" value="4"/>
-        <input name="attribute9" type="radio" class="star" value="5"/> 
+        <input name="attribute9" type="radio" class="star" title="Poor" value="1"/>
+        <input name="attribute9" type="radio" class="star" title="Average" value="2"/>
+        <input name="attribute9" type="radio" class="star" title="Good" value="3"/>
+        <input name="attribute9" type="radio" class="star" title="Very Good" value="4"/>
+        <input name="attribute9" type="radio" class="star" title="Excellent" value="5"/> 
         {% if form.attribute9.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
       </p>
       <p>
--- a/app/templates/projrev/templatetags/_as_review.html	Tue Aug 11 04:34:01 2009 +0530
+++ b/app/templates/projrev/templatetags/_as_review.html	Wed Aug 12 19:30:12 2009 +0530
@@ -1,17 +1,74 @@
-<p class="post-footer align-right">
-  Comment by: <strong>{{ review.reviewer}}</strong>,
-On <strong>{{ review.reviewed_on|date:"jS F Y h:iA" }}</strong>
-  Total Score: <strong>{{ total_score }}</strong><br />
-  Attribute 1: <strong>{{ review.attribute1 }},</strong> 
-  Attribute 2: <strong>{{ review.attribute2 }},</strong>
-  Attribute 3: <strong>{{ review.attribute3 }},</strong>
-  Attribute 4: <strong>{{ review.attribute4 }},</strong>
-  Attribute 5: <strong>{{ review.attribute5 }},</strong>
-  Attribute 6: <strong>{{ review.attribute6 }},</strong>
-  Attribute 7: <strong>{{ review.attribute7 }},</strong>
-  Attribute 8: <strong>{{ review.attribute8 }},</strong>
-  Attribute 9: <strong>{{ review.attribute9 }}</strong>
-</p>
+{% load review_helpers %}
+<script type="text/javascript">
+$(document).ready(function(){
+$("#id_full_comment_{{ review.id }}").colorbox({width:"50%", inline:true, href:"#attributes_{{ review.id }}", title:"Comment and scores"});
+});
+</script>
+<div style="display: none;">
+ <div id="attributes_{{ review.id }}" style='padding:10px; background:#fff; text-align: left;'>
+ {{ review.comment }}<br /><br />
+ <table>
+ <tr>
+  <td>
+   Feasibility of the proposed activity and the appropriateness of the time frame: 
+  </td>
+  <td><strong>{{ review.attribute1 }}</strong></td>
+ </tr>
+ <tr>
+  <td>
+   Uniqueness/novelty/innovation of the said proposal:
+  </td>
+  <td> <strong>{{ review.attribute2 }}</strong></td>
+ </tr>
+ <tr>
+  <td>
+   Scope for inter-institutional collaboration and development:
+  </td>
+  <td> <strong>{{ review.attribute3 }}</strong></td>
+ </tr>
+ <tr>
+  <td>
+   The organisation of the programme to be carried out:
+  </td>
+  <td> <strong>{{ review.attribute4 }}</strong></td>
+ </tr>
+ <tr>
+  <td>
+   The details of the work as the outlined by the principal investigator(PI):
+  </td>
+  <td><strong>{{ review.attribute5 }}</strong></td>
+ </tr>
+ <tr>
+  <td>
+   The details of the work as the outlined by the principal investigator(PI): 
+  </td>
+  <td><strong>{{ review.attribute6 }}</strong></td>
+ </tr>
+ <tr>
+  <td>
+   Social impact/reach/spread of the outcome of the proposal: 
+  </td>
+  <td><strong>{{ review.attribute7 }}</strong></td>
+ </tr>
+ <tr>
+  <td>
+   Contribution of the proposal to minimizing the digital divide in our country: 
+  </td>
+  <td><strong>{{ review.attribute8 }}</strong></td>
+ </tr>
+ <tr>
+  <td>
+   Any other matter which is likely to affect the execution of the project:
+  </td>
+  <td><strong>{{ review.attribute9 }}</strong></td>
+ </tr>
+ </table>
+ </div>
+</div>
 <div class="review-center-box">
-  {{ review.comment }}
+  Comment by: <strong>{{ review.reviewer }}</strong>,
+On <strong>{{ review.reviewed_on|date:"jS F Y h:iA" }}</strong><br/><br/>
+  {{ review.comment|wordwrap:"80"|splitline }}<br /><br/>
+  Total Score: <strong>{{ total_score }} </strong>&nbsp;&nbsp;
+  <a id="id_full_comment_{{ review.id }}" href="#">Click here to see complete comment and individual scores</a><br />
 </div>
\ No newline at end of file