]> git.llucax.com Git - software/sercom.git/blobdiff - sercom/subcontrollers/correccion/templates/entregas.kid
Hacer un poco más linda la paginación del controller de docentes.
[software/sercom.git] / sercom / subcontrollers / correccion / templates / entregas.kid
index 63e8bed3c7523b1c4127a4867ec09719f4efcaaa..9313b440416caf6ba50ad2e6a7a2952f7160223e 100644 (file)
@@ -8,50 +8,66 @@
 </head>
 <body>
 
-<h1>Entregas realizadas</h1>
+<h1>Entregas Realizadas</h1>
 
 <table class="list">
     <tr>
-                               <th width="20%">Fecha</th>
-        <th width="5%" title="Correcta?">Ok?</th>
-        <th width="25%">Observaciones</th>
-        <th width="50%">Tareas Ejecutadas</th>
+                               <th>Entregador</th>
+        <th>Correcta</th>
+        <th>InicioTareas</th>
+        <th>FinTareas</th>
+        <th>Observaciones</th>
+                               <th>Operaciones</th>
     </tr>
-    <tr py:for="record in records">
-        <td><span py:replace="record.fecha">usuario</span></td>
-                               <td align="center">
-                                       <span py:replace="tg.strbool(record.exito)">Si</span>
-                               </td>
-        <td><span py:replace="record.observaciones">fecha corregido</span></td>
+               <tr py:for="record in records">
+                               <?python
+                                       def contar_comandos_mal(prueba, publico):
+                                               total = 0
+                                               tested = 0
+                                               for c in prueba.comandos_ejecutados:
+                                                       if c.comando.publico == publico:
+                                                               if not c.exito:
+                                                                       total += 1
+                                                               tested += 1
+                                               return (total, tested)
+
+                                       # Reviso que tan mal esta
+                                       # si no hay pruebas, esta mal porque no anduvieron los comandos
+                                       pruebas_pub_mal = 0
+                                       pruebas_priv_mal = 0
+                                       if len(record.pruebas) == 0:
+                                               color = "#ff0000"
+                                       else:
+                                               # Veo que onda con las pruebas
+                                               pri_mal = 0
+                                               pub_mal = 0
+                                               for prueba in record.pruebas:
+                                                       (rpub_mal, pub_tested) = contar_comandos_mal(prueba, True)
+                                                       (rpri_mal, pri_tested) = contar_comandos_mal(prueba, False)
+                                                       pri_mal += rpri_mal
+                                                       pub_mal += rpub_mal
+                                               if pri_mal + pub_mal == 0:
+                                                       color = "#00ff00"
+                                               else:
+                                                       if pub_mal > 0:
+                                                               color = "#ff0000"
+                                                       else:
+                                                               color = "#ffff00"
+                               ?>
+                               <td style="background:${color};"><span py:if="record.entregador" py:replace="record.entregador.shortrepr()">usuario</span></td>
+        <td style="background:${color};"><span py:replace="record.exito">fecha asignado</span></td>
+        <td style="background:${color};"><span py:replace="record.inicio">fecha corregido</span></td>
+        <td style="background:${color};"><span py:replace="record.fin">fecha corregido</span></td>
+        <td style="background:${color};"><span py:replace="record.observaciones">nota</span></td>
                                <td>
-                                       <table width="100%;">
-                                               <tr>
-                                                       <th><strong>Tarea</strong></th>
-                                                       <th><strong>Desde</strong></th>
-                                                       <th><strong>Hasta</strong></th>
-                                                       <th><strong>Correcta</strong></th>
-                                                       <th><strong>Obs</strong></th>
-                                               </tr>
-                                               <tr py:for="i in record.tareas">
-                                                       <td >${i.tarea.shortrepr()}</td>
-                                                       <td>${i.inicio}</td>
-                                                       <td>${i.fin}</td>
-                                                       <td align="center">
-                                                               <span py:replace="tg.strbool(i.exito)">Si</span>
-                                                       </td>
-                                                       <td>${i.observaciones}</td>
-                                               </tr>
-                                       </table>
+                                       <a href="${tg.url('/mis_entregas/corrida/%d' % record.id)}">Corrida</a>
+                                       <a href="${tg.url('/mis_entregas/get_archivo/%d' % record.id)}">Bajar Archivo</a>
                                </td>
     </tr>
 </table>
-<br />
-<a href="/correccion/list">Volver</a>
-<div py:for="page in tg.paginate.pages">
-    <a py:if="page != tg.paginate.current_page"
-        href="${tg.paginate.get_href(page)}">${page}</a>
-    <b py:if="page == tg.paginate.current_page">${page}</b>
-</div>
+
+<br/>
+<a href="javascript:window.history.go(-1);">Volver</a>
 
 </body>
 </html>