Bloody template hackers. Hope this works and they don't change semantics later.
[cascardo/eventmanager.git] / templates / grade.html
index 44858af..13796b4 100644 (file)
@@ -5,24 +5,51 @@
 {% if aprovadas %}
 
   {% for p in aprovadas %}
+    {% if forloop.first %}
+  <h3>
+    {{ p.dia|date:"l, d \de F" }}
+  </h3>
+  <br />
+  <table>
+    <tr>
+
     {% 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>
     {% endifchanged %}
-    <td> {{ p.titulo }} </td>
+
+    {% else %}
     {% ifchanged p.dia %}
-      </tr>
-      </table>
+
+    </tr>
+  </table>
+
+
+  <h3>
+    {{ p.dia|date:"l, d \de F" }}
+  </h3>
+  <br />
+  <table>
+    <tr>
+
     {% endifchanged %}
+    {% endif %}
+  
+    {% ifchanged p.time_start %}
+
+    </tr>
+    <tr>
+      <td> {{ p.time_start }} </td>
+
+    {% endifchanged %}
+
+      <td> {{ p.titulo }} </td>
+
+    {% if forloop.last %}
+
+    </tr>
+  </table>
+
+    {% endif %}
   {% endfor %}
 
 {% else %}
@@ -37,6 +64,7 @@
 
 {% endif %}
 
+<br />
 <a href="javascript:;" onclick="history.back ();">Voltar</a>
 
 {% endblock %}