{% extends 'baseTemplate.html' %}
{% block title %}{{course.name}} ({{course.promotion}}){% endblock %}
{% block nav %}{% endblock %}
{% block background %}{% load static %}{% static 'Arago.jpg' %}{% endblock %}
{% block content %}
<div class="container-fluid">
	<div class="well">
		<div class="row">
			<div class="col-md-4">
				<h1>{{course.name}}
				{% if course.promotion.number|divisibleby:2 %}
					(<span style='color:#D62222'>X{{course.promotion.number}}</span>)
				{% else %}
					(<span style='color:#F2E52E'>X{{course.promotion.number}}</span>)
				{% endif %}
				</h1>
				<p>Nombre d'inscrits : {{course.enrolled}}</p>
			</div>
			<div class="col-md-8">
				{% if course.totalratio != 0 %}
				<h3>Taux de visibilité du cours :</h3>
				<div class="progress">
 					<div class="progress-bar progress-bar-{{course.progressbarclass}}" role="progressbar"
 							aria-valuenow="{{course.totalratio}}" aria-valuemin="0" aria-valuemax="100"
 							style="width: {{course.totalratio}}%;">
    					{{course.totalratio}} %
  					</div>
  				</div>
				{% endif %}
			</div>
		</div>
	</div>
	<div class="row">
		{% for lesson in course.lessons %}
		<div class="col-md-4">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h2 class="panel-title">Séance n°{{lesson.number}} <i>{{lesson.title}}</i> – {{lesson.date|date:"d/m/y"}}, en {{lesson.amphi}}
					{% if lesson.professor %}
					par {{lesson.professor.name}}
					{% endif %}
					</h2>
				</div>
				<div class="panel-body">
					{% if lesson.counts %}
					<p>Estimation du taux de visibilité pour cette séance :</p>
					<div class="progress">
 						<div class="progress-bar progress-bar-{{lesson.progressbarclass}}" role="progressbar"
 							aria-valuenow="{{lesson.totalratio}}" aria-valuemin="0" aria-valuemax="100"
 							style="width: {{lesson.totalratio}}%;">
    						{{lesson.totalratio}} %
  						</div>
  					</div>
					<div class="list group">
						{% for count in lesson.counts %}
						<div class="list-group-item">
							<p>Résultat du comptage : <b>{{count.census}}/{{course.enrolled}}</b>. {{count.comment}}</p>
  						<p style="text-align:right;font-style:italic">{{count.signature}}</p>
  						</div>
  						{% endfor %}
  					</div>
  					{% else %}
					<div class="alert alert-warning">
						<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
  						<span class="sr-only">Attention : </span>Aucun comptage n'a été soumis pour cette séance
					</div>
					{% endif %}
				</div>
			</div>
		</div>
		{% endfor %}
	</div>
</div>
{% endblock %}