Skip to content
Snippets Groups Projects
Commit 43e6be1f authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch '63-status-icon' into 'master'

Resolve "Show status icon for every lesson"

Closes #63

See merge request !50
parents b20bb4f3 329d1a9e
No related branches found
No related tags found
1 merge request!50Resolve "Show status icon for every lesson"
Pipeline #2788 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 %}
......
......@@ -46,6 +46,7 @@
<table class="striped datatable">
<thead>
<tr>
<th></th>
<th>{% blocktrans %}Period{% endblocktrans %}</th>
<th>{% blocktrans %}Subject{% endblocktrans %}</th>
<th>{% blocktrans %}Teachers{% endblocktrans %}</th>
......@@ -53,24 +54,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 class="tr-link">
<a class="tr-link" href="{% url 'lesson_by_week_and_period' week.year week.week period.id %}">
{{ period.period.period }}.
......
{% 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 %}
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