Changed grade template logic.
authorThadeu Lima de Souza Cascardo <cascardo@vespa.holoscopio.com>
Tue, 9 Oct 2007 20:23:26 +0000 (17:23 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@vespa.holoscopio.com>
Tue, 9 Oct 2007 20:23:26 +0000 (17:23 -0300)
templates/grade.html

index 44858af..59c156a 100644 (file)
@@ -5,24 +5,48 @@
 {% if aprovadas %}
 
   {% for p in aprovadas %}
 {% if aprovadas %}
 
   {% for p in aprovadas %}
-    {% ifchanged p.dia %}
-      <h3>
-        {{ p.dia|date:"l, d \de F" }}
-      </h3>
-      <br /><br />
-      <table>
-      <tr>
-    {% endifchanged %}
-      {% ifchanged p.time_start %}
-        </tr>
-        <tr>
-        <td> {{ p.time_start }} </td>
+    {% if forloop.first %}
+  <h3>
+    {{ p.dia|date:"l, d \de F" }}
+  </h3>
+  <br />
+  <table>
+    <tr>
+
+    {% endif %}
+
+    {% ifchanged p.time_start %}
+
+    </tr>
+    <tr>
+      <td> {{ p.time_start }} </td>
+
     {% endifchanged %}
     {% endifchanged %}
-    <td> {{ p.titulo }} </td>
+
+      <td> {{ p.titulo }} </td>
+
     {% ifchanged p.dia %}
     {% ifchanged p.dia %}
-      </tr>
-      </table>
+
+    </tr>
+  </table>
+
+
+  <h3>
+    {{ p.dia|date:"l, d \de F" }}
+  </h3>
+  <br />
+  <table>
+    <tr>
+
     {% endifchanged %}
     {% endifchanged %}
+  
+    {% if forloop.last %}
+
+    </tr>
+  </table>
+
+    {% endif %}
   {% endfor %}
 
 {% else %}
   {% endfor %}
 
 {% else %}
@@ -37,6 +61,7 @@
 
 {% endif %}
 
 
 {% endif %}
 
+<br />
 <a href="javascript:;" onclick="history.back ();">Voltar</a>
 
 {% endblock %}
 <a href="javascript:;" onclick="history.back ();">Voltar</a>
 
 {% endblock %}