{% extends "base.html" %}
{% block title %} Actividades indice | {{super}}{%endblock %}

{%block escoge-asignatura%}
  {{informacion.asignatura.slug}}
{%endblock%}

{% block navbar%}
{%include "app/include/menu.html"%}
{%endblock%}


<!-- Contenido -->
{% block content %}
	<h1>
		Listado de tareas realizadas</h1>
	<hr>
	<div class="row-fluid">
	            <div class="span8">
	            	{% if tareas %}
					<table class="table table-striped">
				        <thead>
				          <tr>
				       		<th>Alumno<a href="#"><i class="icon-arrow-up"></i></a><a href="#"><i class="icon-arrow-down"></i></a></th>
			            	<th>Nombre</th>
			            	<th>Nota</th>
			            	<th>Revisores</th>
			            	<th>Descargar</th>
				          	<th style="padding-left:10%;">&nbsp;</th>
				          </tr>
				        </thead>
				        <tbody>

					        {% for tarea in tareas %}
					          <tr>
					            <td>{%if tarea.user.usuario.nombre%}{{tarea.user.usuario.nombre}}{%else%}{{tarea.user}}{%endif%}</td>

					            <td><a href="{% url ver_tarea informacion.asignatura.slug tarea.actividades.id tarea.user%}">{{tarea.actividades.name}}</a></td>
					            <td>{{tarea.nota}}</td>
					            <td>
					            	{% for revisor in tarea.evaluacion_tarea.all %}
				                      {% if revisor.realizado%}
				                        <a href="{%url ver_evaluacion informacion.asignatura.slug revisor.id revisor.user %}">{{revisor.user.usuario.nombre}}</a><br>
				                      {%else%}
				                       <small>Sin revisar</small>
				                      {%endif%}
				                      {%empty%}
				                       <small>Sin revisar</small>
				                    {%endfor%}

                				</td>
					            <td><a href="{% url descarga_tarea informacion.asignatura.slug tarea.actividades.id tarea.user%}"><i class="icon-arrow-down"></i></a></td>
					          </tr>
					          {% endfor%}
				          </tbody>
				      </table>
				      {% else %}
				      	<div class="span9"><h4>Aun no hay ninguna tarea realizada</h4></div>
				      	<br>
				      {% endif%}

            {%if informacion.atras %}
                  <a href="{{informacion.atras}}" class="btn btn-primary btn-large pull-right">Volver</a>
           {%endif%}

	  		</div>
		</div>	
{% endblock%}
{% block extra_js %}
<script src="{{MEDIA_URL}}js/bootstrap/bootstrap-datepicker.js"></script>
<script src="{{MEDIA_URL}}js/bootstrap/bootstrap-timepicker.js"></script>

<script type="text/javascript"> 
 	$(document).ready(function () { 
    		$(".datepicker").datepicker({format: 'dd/mm/yyyy'});

            $('.timepicker').timepicker({
                defaultTime: 'current',
                minuteStep: 15,
                disableFocus: true,
                showMeridian: false,
                template: 'dropdown'
            });

        });
</script>

{% endblock %}

