Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
90 lines (87 sloc) 5.04 KB
{% block main_content %}
{% set currentSemester = app.session.get('currentSemester') %}
<div class="widget-box">
<div class="widget-title">
<span class="icon">
<i class="icon-th"></i>
</span>
<h5>Planning du {{ currentSemester.startDate|date("d/m/Y") }} au {{ currentSemester.endDate|date("d/m/Y") }}</h5>
</div>
<div class="widget-content nopadding">
{% set cell_class = '' %}
<table id="planning" class="table table-bordered">
<thead>
<tr>
<th rowspan="2">&nbsp;</th>
{% for headerCell in headerCells %}
<th colspan="{{ headerCell.classRooms | length }}">{{ headerCell.day | day }}</th>
{% endfor %}
</tr>
<tr>
{% for headerCell in headerCells %}
{% for classRoom in headerCell.classRooms %}
<th>{{ classRoom }}</th>
{% endfor %}
{% endfor %}
</tr>
</thead>
{% for row in planningRows %}
<tr>
<th>{{ row.startTime | date('H:i') }} - {{ row.endTime | date('H:i')}}</th>
{% for dayCells in row.cells %}
{% if loop.index is divisibleby(2) %}{% set cell_class = 'left-border' %}{% else %}{% set cell_class = '' %}{% endif %}
{% for classRoomCell in dayCells %}
{% if classRoomCell is not null %}
<td class="center {{ cell_class }}" {% if classRoomCell.rowspan > 0 %} rowspan="{{ classRoomCell.rowspan }}" {% endif %}>
{% if classRoomCell.hasCourse %}
<div class="classCell" style="border: 2px solid {{ classRoomCell.course.classLevelColorCode }}">
<a class="course_details" href="{{ path('course_show', { 'id': classRoomCell.course.id }) }}">
{% include '::class_level_badge.html.twig' with { 'classLevelColorCode': classRoomCell.course.classLevelColorCode, 'classLevelLabel': classRoomCell.course.classLevelLabel } %}
<p>
{{ classRoomCell.course.startTime | date('H:i') }} - {{ classRoomCell.course.endTime | date('H:i') }}
<br />
{% for teacher in classRoomCell.course.teachers %}
{% if forPrint %}
{% set teacherLastname = teacher['teacher_lastName'] | slice(0,1) ~ "." %}
{% set separator = ', ' %}
{% else %}
{% set teacherLastname = teacher['teacher_lastName'] %}
{% set separator = "\n" %}
{% endif %}
{{ teacher['teacher_firstName'] }} {{ teacherLastname }}{% if not loop.last %}{{ separator|nl2br }}{% endif %}
{% endfor %}
{% if classRoomCell.course.alternateStartDate is not empty or classRoomCell.course.alternateStartDate is not empty %}
{% set currentSemester = app.session.get('currentSemester') %}
{% if classRoomCell.course.alternateStartDate is not empty %}
<br />
à partir du {{ classRoomCell.course.alternateStartDate | date("d/m/Y") }}
{%endif %}
{% if classRoomCell.course.alternateEndDate is not empty %}
<br />
jusqu'au {{ classRoomCell.course.alternateEndDate | date("d/m/Y") }}
{%endif %}
{% endif %}
</p>
</a>
</div>
{% else %}
{{ classRoomCell.content | raw }}
{% endif %}
</td>
{% endif %}
{% endfor %}
{% endfor %}
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %}
<script type="text/javascript">
// Loop through all the div.thatSetsABackgroundWithAnIcon on your page
$('div.classCell').each(function(){
var $div = $(this);
// Set the div's height to its parent td's height
$div.height($div.closest('td').height());
});
</script>
You can’t perform that action at this time.