Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

info_sala added

  • Loading branch information...
commit 924b137c888c7eca7f05cd21c83be9cd9ce8b6a3 1 parent 4e36b6b
mfalcon authored
1  students/urls.py
View
@@ -11,6 +11,7 @@
url(r'^informe/(?P<inf_id>\d+)/$', views.student_report, name='st_student_report'),
url(r'^informe_pdf/(?P<inf_id>\d+)/$', views.get_informe_as_pdf, name='st_get_informe_as_pdf'),
url(r'^salas/$', views.salas, name='st_salas'),
+ url(r'^info_sala/(?P<sala_id>\d+)/$', views.info_sala, name='st_info_sala'),
url(r'^informes/nuevo/(?P<st_id>\d+)/$', views.nuevo_informe, name='st_nuevo_informe'),
url(r'^informes/modificar/(?P<inf_id>\d+)/$', views.modificar_informe, name='st_modificar_informe'),
)
23 students/views.py
View
@@ -194,6 +194,29 @@ def salas(request):
context,
context_instance = RequestContext(request),
)
+
+@login_required
+def info_sala(request,sala_id):
+ sala = Sala.objects.get(pk=sala_id)
+ varones = []
+ nenas = []
+ for alumno in sala.alumno_set.all():
+ if alumno.sexo == 0:
+ varones.append(alumno)
+ else:
+ nenas.append(alumno)
+
+ cant_alumnos = len(varones) + len(nenas)
+
+ context = {
+ 'sala': sala, 'varones': varones, 'nenas': nenas,
+ 'cant_alumnos': cant_alumnos,
+ }
+ return render_to_response(
+ 'students/info_sala.html',
+ context,
+ context_instance = RequestContext(request),
+ )
@login_required
def get_informe_as_pdf(request, inf_id):
i = Informe.objects.get(pk=inf_id) #get_object_or_404
62 templates/students/info_sala.html
View
@@ -0,0 +1,62 @@
+{% extends "base_pacc.html" %}
+
+{% block title %}Información de sala - {{ block.super }}{% endblock %}
+
+{% block nav %}
+<ul class="breadcrumb">
+ <li>
+ <a href={% url index %}>Home</a> <span class="divider">/</span>
+ </li>
+ <li>
+ <a href={% url st_students_list %}>Alumnos</a> <span class="divider">/</span>
+ </li>
+ <li class="active">
+ <a href="#">Informacion sala</a>
+ </li>
+</ul>
+{% endblock %}
+
+{% block main_content %}
+ <div class="row">
+ <div class="span8 offset2">
+ <p>Maestra/s: {{ sala.maestra_set.all.0 }}</span></p>
+ <p>{{ sala }}</p>
+ <p>Total alumnos: {{ cant_alumnos }}</p>
+ </div>
+ </div>
+ <br />
+ <br />
+ <div class="row">
+ <div class="span5 offset2">
+ <h3>Varones</h3>
+ <table class="table table-striped">
+ <tfoot>
+ <td>Cantidad de varones: {{ varones|length }}</td>
+ </tfoot>
+ <tbody>
+ {% for st in varones %}
+ <tr>
+ <td><a href={% url st_student_personal_info st.id %}>{{ st.get_full_name }}</a></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+
+ <div class="span5">
+ <h3>Nenas</h3>
+ <table class="table table-striped">
+ <tfoot>
+ <td>Cantidad de nenas: {{ nenas|length }}</td>
+ </tfoot>
+ <tbody>
+ {% for st in nenas %}
+ <tr>
+ <td><a href={% url st_student_personal_info st.id %}>{{ st.get_full_name }}</a></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+{% endblock %}
4 templates/students/st_info.html
View
@@ -1,6 +1,6 @@
{% extends "base_pacc.html" %}
-{% block title %}{{ block.super }}{% endblock %}
+{% block title %}Informacion alumno{{ block.super }}{% endblock %}
{% block nav %}
<ul class="breadcrumb">
@@ -11,7 +11,7 @@
<a href={% url st_students_list %}>Alumnos</a> <span class="divider">/</span>
</li>
<li class="active">
- <a href="#">Informes</a>
+ <a href="#">Informacion alumno</a>
</li>
</ul>
{% endblock %}
2  templates/students/st_list.html
View
@@ -32,7 +32,7 @@
{% for st in students %}
<tr>
<td><a href={% url st_student_personal_info st.id %}>{{ st.get_full_name }}</a></td>
- <td>{{ st.sala.get_sala_display }}</td>
+ <td><a href={% url st_info_sala st.sala.id %}>{{ st.sala.get_sala_display }}</a></td>
</tr>
{% endfor %}
</tbody>
Please sign in to comment.
Something went wrong with that request. Please try again.