]> git.llucax.com Git - z.facultad/75.52/sercom.git/blob - sercom/subcontrollers/curso/ejercicio/instancia/templates/entregas.kid
simplifico logica de colores y pagino las entregas de una instancia de entrega.
[z.facultad/75.52/sercom.git] / sercom / subcontrollers / curso / ejercicio / instancia / templates / entregas.kid
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <?python from sercom.model import Grupo, AlumnoInscripto ?>
3 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
4     py:extends="'../../../../../templates/master.kid'">
5 <head>
6 <meta content="text/html; charset=utf-8" http-equiv="Content-Type" py:replace="''"/>
7 <title>list</title>
8 </head>
9 <body>
10
11 <h1>Entregas Realizadas</h1>
12
13 <table class="list">
14     <tr>
15                                 <th>Entregador</th>
16         <th>Correcta</th>
17         <th>InicioTareas</th>
18         <th>FinTareas</th>
19         <th>Observaciones</th>
20                                 <th>Operaciones</th>
21     </tr>
22                 <tr py:for="record in records">
23                                 <?python
24                                         def contar_comandos_mal(prueba, publico):
25                                                 total = 0
26                                                 tested = 0
27                                                 for c in prueba.comandos_ejecutados:
28                                                         if c.comando.publico == publico:
29                                                                 if not c.exito:
30                                                                         total += 1
31                                                                 tested += 1
32                                                 return (total, tested)
33
34                                         # Reviso que tan mal esta
35                                         # si no hay pruebas, esta mal porque no anduvieron los comandos
36                                         pruebas_pub_mal = 0
37                                         pruebas_priv_mal = 0
38                                         if len(record.pruebas) == 0:
39                                                 color = "#ff0000"
40                                         else:
41                                                 # Veo que onda con las pruebas
42                                                 pri_mal = 0
43                                                 pub_mal = 0
44                                                 for prueba in record.pruebas:
45                                                         (rpub_mal, pub_tested) = contar_comandos_mal(prueba, True)
46                                                         (rpri_mal, pri_tested) = contar_comandos_mal(prueba, False)
47                                                         pri_mal += rpri_mal
48                                                         pub_mal += rpub_mal
49                                                 if pri_mal + pub_mal == 0:
50                                                         color = "#00ff00"
51                                                 else:
52                                                         if pub_mal > 0:
53                                                                 color = "#ff0000"
54                                                         else:
55                                                                 color = "#ffff00"
56                                 ?>
57                                 <td style="background:${color};"><span py:if="record.entregador" py:replace="record.entregador.shortrepr()">usuario</span></td>
58         <td style="background:${color};"><span py:replace="record.exito">fecha asignado</span></td>
59         <td style="background:${color};"><span py:replace="record.inicio">fecha corregido</span></td>
60         <td style="background:${color};"><span py:replace="record.fin">fecha corregido</span></td>
61         <td style="background:${color};"><span py:replace="record.observaciones">nota</span></td>
62                                 <td>
63                                         <a href="${tg.url('/mis_entregas/corrida/%d' % record.id)}">Corrida</a>
64                                         <a href="${tg.url('/mis_entregas/get_archivo/%d' % record.id)}">Bajar Archivo</a>
65                                 </td>
66     </tr>
67 </table>
68
69 <br/>
70 <a href="javascript:window.history.go(-1);">Volver</a>
71
72 <div py:for="page in tg.paginate.pages">
73     <a py:if="page != tg.paginate.current_page"
74         href="${tg.paginate.get_href(page)}">${page}</a>
75     <b py:if="page == tg.paginate.current_page">${page}</b>
76 </div>
77
78 </body>
79 </html>
80
81 <!-- vim: set et sw=4 sts=4 : -->