105 lines
4.6 KiB
HTML
105 lines
4.6 KiB
HTML
{% load timedelta_filter %}
|
|
<article class="instructor">
|
|
<section class="instructor__header panel">
|
|
<h1 class="instructor__department">{{ user.instructor.department.name }}</h1>
|
|
</header>
|
|
<div class="instructor__active_periods">
|
|
<h3>Students clocked-in</h3>
|
|
<a class="action-button instructor__add_period" href="{% url 'period-create' %}">+ Add new session</a>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Student</th>
|
|
<th>Station</th>
|
|
<th>Clocked in</th>
|
|
<th colspan="2">Duration</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for period in period_list %}
|
|
{% if not period.clocked_out %}
|
|
<tr>
|
|
<td>{{ period.student }}</td>
|
|
<td>{{ period.station_number }}</td>
|
|
<td>{{ period.clocked_in }}</td>
|
|
{% if period.clocked_out %}
|
|
<td>{{ period.clocked_out }}</td>
|
|
<td>{{ period.clocked_in|timesince:period.clocked_out }}</td>
|
|
{% else %}
|
|
<td>Current sesson: {{ period.clocked_in|timesince }}</td>
|
|
{% endif %}
|
|
<td><a href="{% url 'period-detail' period.id %}">View</a></td>
|
|
</tr>
|
|
{% endif %}
|
|
{% empty %}
|
|
<tr><td colspan="2">No periods yet.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
<section class="instructor__attendance_log">
|
|
<div>
|
|
<h3>Attendance log</h3>
|
|
<a class="instructor__generate_reports action-button" href="">Generate Reports →</a>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Student</th>
|
|
<th>Station</th>
|
|
<th>Date</th>
|
|
<th>Clocked in</th>
|
|
<th>Clocked out</th>
|
|
<th colspan="2">Duration</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for period in period_list %}
|
|
{% if period.clocked_out %}
|
|
<tr>
|
|
<td>{{ period.student }}</td>
|
|
<td>{{ period.station_number }}</td>
|
|
<td>{{ period.clocked_in|date:"M d, y" }}</td>
|
|
<td>{{ period.clocked_in|time:"P" }}</td>
|
|
{% if period.clocked_out %}
|
|
<td>{{ period.clocked_out|time:"P" }}</td>
|
|
<td>{{ period.clocked_in|timesince:period.clocked_out }}</td>
|
|
{% else %}
|
|
<td colspan="2">Current sesson: {{ period.clocked_in|timesince }}</td>
|
|
{% endif %}
|
|
<td><a href="{% url 'period-detail' period.id %}">View</a></td>
|
|
</tr>
|
|
{% endif %}
|
|
{% empty %}
|
|
<tr><td colspan="2">No periods yet.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
<p>
|
|
<a class="action-button" href="{% url 'period-list' %}">See more →</a>
|
|
</p>
|
|
</div>
|
|
</section>
|
|
<section class="instructor__total_hours">
|
|
<h3>Total hours</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Student</th>
|
|
<th>Total hours</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for student in student_list %}
|
|
<tr>
|
|
<td>{{ student.user.first_name }} {{ student.user.last_name }}</td>
|
|
<td><strong>{{ student.total_hours|timedelta_format }}</strong></td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr><td colspan="2">No periods yet.</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</section>
|
|
</article>
|