app/templates/projrev/proposal/review.html
changeset 34 21942fac2b4b
parent 30 94fe7fe7394d
child 38 3cb38edbe05f
--- a/app/templates/projrev/proposal/review.html	Thu Aug 06 18:49:06 2009 +0530
+++ b/app/templates/projrev/proposal/review.html	Mon Aug 10 16:38:13 2009 +0530
@@ -1,4 +1,16 @@
 {% extends "projrev/base.html" %}
+{% load review_helpers %}
+
+{% block scripts %}
+{{ block.super }}
+<script type="text/javascript">
+$(document).ready(function () {
+  $('#attribute1').html();
+  
+}
+</script>
+{% endblock scripts %}
+
 {% block content %}
 <div class="post">
 			
@@ -50,19 +62,190 @@
       <a href="/site-content/{{ proposal_path }}">{{ proposal_name }}</a>
     </div>
   </div>
+
+
 	<form enctype="multipart/form-data" method="post" action="">			
 		<p>
-      {{ form.as_p }}
+      <p>
+      {% if form.comment.help_text %}
+        <script type="text/javascript">
+          $(document).ready( function() {
+            var tooltip = [
+            "<div class='tooltip'>",
+            "  <div class='tooltip-body'>",
+            "    <img src='/site-content/images/info.png' alt='' />",
+            "    <h3>Info</h3>",
+            "    <p>",
+            "      {% autoescape off %}",
+            "        {{ form.comment.help_text|linebreaksbr|escapejs }}",
+            "      {% endautoescape %}",
+            "    </p>",
+            "  </div>",
+            "  <div class='tooltip-bottom'></div>",
+            "</div>"
+            ].join("");
+
+            var tooltip_object=null;
+            var documented = $("#id_{{ form.comment.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;
+                }
+              });
+            }
+          });
+        </script>
+      {% endif %}
+      {{ form.comment.errors }}
+      {{ form.comment.label_tag }}{{ form.comment }}{% if form.comment.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
+      </p>
+      <p>
+        {{ form.attribute1.errors }}
+        {{ form.attribute1.label_tag }}
+        <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"/> 
+        {% if form.attribute1.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
+      </p>
+      <p>
+        {{ form.attribute2.errors }}
+        {{ form.attribute2.label_tag }}
+        <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"/> 
+        {% if form.attribute2.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
+      </p>
+      <p>
+        {{ form.attribute3.errors }}
+        {{ form.attribute3.label_tag }}
+        <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"/> 
+        {% if form.attribute3.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
+      </p>
+      <p>
+        {{ form.attribute4.errors }}
+        {{ form.attribute4.label_tag }}
+        <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"/> 
+        {% if form.attribute4.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
+      </p>
+      <p>
+        {{ form.attribute5.errors }}
+        {{ form.attribute5.label_tag }}
+        <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"/> 
+        {% if form.attribute5.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
+      </p>
+      <p>
+        {{ form.attribute6.errors }}
+        {{ form.attribute6.label_tag }}
+        <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"/> 
+        {% if form.attribute6.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
+      </p>
+      <p>
+        {{ form.attribute7.errors }}
+        {{ form.attribute7.label_tag }}
+        <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"/> 
+        {% if form.attribute7.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
+      </p>
+      <p>
+        {{ form.attribute8.errors }}
+        {{ form.attribute8.label_tag }}
+        <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"/> 
+        {% if form.attribute8.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
+      </p>
+      <p>
+        {{ form.attribute9.errors }}
+        {{ form.attribute9.label_tag }}
+        <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"/> 
+        {% if form.attribute9.field.required %}<span class="specialclass">&nbsp;&nbsp;(required)</span>{% endif %}
+      </p>
 		<br />	
 		<input class="button" type="submit" value="Submit Review" />		
-		</p>		
+		</p>
 	</form>
 				
-	<p class="post-footer align-right">					
-		<span class="comments">Reviews (5)</span>
-		<span class="date">Last reviewed: Nov 11, 2006</span>
-		<span class="date">Last submitted: Nov 11, 2006</span>	
+	 <p class="post-footer align-right">
+    <span class="comments">Reviews:
+    {% if nr_reviews %}
+      {{ nr_reviews }}
+    {% else %}
+      (<i>None</i>)
+    {% endif %}
+    </span>
+    <span class="date">Last reviewed:
+    {% if last_reviewed %}
+      {{ last_reviewed|date:"jS F Y h:iA" }}
+    {% else %}
+      (<i>Not Reviewed</i>)
+    {% endif %}
+    </span>
+    <span class="date">Last submitted:
+    {% if last_submitted %}
+      {{ last_submitted|date:"jS F Y h:iA" }}
+    {% else %}
+      (<i>New Submission</i>)
+    {% endif %} 
+    </span> 
+  </p>
+  {% if reviews %}
+  <br /><br />
+  <p>
+  <h2>Reviews: Comments and Scores:</h2>
+	{% for review in reviews %}
+	  {% as_review review %}
+	{% endfor %}
 	</p>
-				
+	{% endif %}
 </div>
 {% endblock content %}
\ No newline at end of file