Skip to content
Snippets Groups Projects
Verified Commit 3926f0ea authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Add status icon for every lesson

parent b48a2a05
No related branches found
No related tags found
Loading
Pipeline #2711 passed
......@@ -21,6 +21,10 @@
{% for teacher in lesson_period.get_teachers.all %}
{{ teacher.short_name }}
{% endfor %}
<span class="right">
{% include "alsijil/partials/lesson_status_icon.html" with period=lesson_period css_class="medium" %}
</span>
{% endblock %}
{% block content %}
......
{% load i18n week_helpers %}
{% now_datetime as now_dt %}
{% if period.has_documentation %}
<i class="material-icons green-text tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Data complete" %}" title="{% trans "Data complete" %}">check_circle</i>
{% else %}
{% period_to_time_start week period.period as time_start %}
{% period_to_time_end week period.period as time_end %}
{% if now_dt > time_end %}
<i class="material-icons red-text tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Missing data" %}" title="{% trans "Missing data" %}">history</i>
{% elif now_dt > time_start and now_dt < time_end %}
<i class="material-icons orange-text tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Pending" %}" title="{% trans "Pending" %}">more_horiz</i>
{% else %}
{% if period.get_substitution %}
{% if period.get_substitution.cancelled %}
<i class="material-icons red-text tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Lesson cancelled" %}" title="{% trans "Lesson cancelled" %}">cancel</i>
{% else %}
<i class="material-icons orange-text tooltipped {{ css_class }}" data-position="bottom" data-tooltip="{% trans "Substitution" %}" title="{% trans "Substitution" %}">update</i>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
......@@ -45,6 +45,7 @@
<table class="striped responsive-table datatable">
<thead>
<tr>
<th></th>
<th>{% blocktrans %}Period{% endblocktrans %}</th>
<th>{% blocktrans %}Subject{% endblocktrans %}</th>
<th>{% blocktrans %}Teachers{% endblocktrans %}</th>
......@@ -52,24 +53,10 @@
</thead>
<tbody>
{% for period in periods %}
<tr class="
{% if period.has_documentation %}
success
{% else %}
{% weekday_to_date week period.period.weekday as current_date %}
{% today as today %}
{% if current_date < today %}
error
{% else %}
{% if period.get_substitution %}
warning
{% if period.get_substitution.cancelled %}
alsijil-lesson-cancelled
{% endif %}
{% endif %}
{% endif %}
{% endif %}
">
<tr>
<td class="center-align">
{% include "alsijil/partials/lesson_status_icon.html" with period=period %}
</td>
<td>{{ period.period.period }}</td>
<td>
<a href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment