Skip to content
Snippets Groups Projects
Commit 593d3d1e authored by Julian's avatar Julian
Browse files

Move statistics to a real extra tab

parent c8771f09
No related branches found
No related tags found
1 merge request!111Resolve "[Person overview] Implement multiple selection for marking absences as excused or for deleting"
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
<a href="#personal-notes">{% trans "Personal notes" %}</a> <a href="#personal-notes">{% trans "Personal notes" %}</a>
</li> </li>
{% if stats %} {% if stats %}
<li class="tab col s6"><a href="#overview" class="active">{% trans "Overview" %}</a></li> <li class="tab"><a href="#statistics">{% trans "Statistics" %}</a></li>
<li class="tab col s6"><a href="#statistics">{% trans "Statistics" %}</a></li>
{% endif %} {% endif %}
</ul> </ul>
</div>
{% if register_object_table %} {% if register_object_table %}
<div class="col s12" id="lesson-documentations"> <div class="col s12" id="lesson-documentations">
{% include "alsijil/partials/objects_table.html" with table=register_object_table filter_form=filter_form %} {% include "alsijil/partials/objects_table.html" with table=register_object_table filter_form=filter_form %}
...@@ -56,111 +56,8 @@ ...@@ -56,111 +56,8 @@
{% endif %} {% endif %}
{% if stats %}
<div class="col s12">
<ul class="tabs">
<li class="tab col s6"><a href="#overview" class="active">{% trans "Overview" %}</a></li>
<li class="tab col s6"><a href="#statistics">{% trans "Statistics" %}</a></li>
</ul>
</div>
{% endif %}
<div class="col s12" id="statistics">
<h5>{% trans "Unexcused absences" %}</h5>
{# {% for note in unexcused_absences %}#} <div class="col s12" id="overview">
{# {% weekday_to_date note.calendar_week note.lesson_period.period.weekday as note_date %}#}
{# <li class="collection-item">#}
{# {% has_perm "alsijil.edit_personalnote" user note as can_edit_personal_note %}#}
{# {% if can_edit_personal_note %}#}
{# <label class="left">#}
{# <input type="checkbox" name="selected_notes" value="{{ note.pk }}"#}
{# form="excuse-multiple-form" class="filled-in"/>#}
{# <span></span>#}
{# </label>#}
{# <form action="" method="post" class="right hide-on-small-only">#}
{# {% csrf_token %}#}
{# {% trans "Mark as" %}#}
{# <input type="hidden" value="{{ note.pk }}" name="personal_note">#}
{# {% include "alsijil/partials/mark_as_buttons.html" %}#}
{# <a class="btn-flat red-text" title="{% trans "Delete note" %}"#}
{# href="{% url "delete_personal_note" note.pk %}">#}
{# <i class="material-icons center">cancel</i>#}
{# </a>#}
{# </form>#}
{# {% endif %}#}
{# <i class="material-icons left red-text">warning</i>#}
{# <p class="no-margin">#}
{# <a href="{% url note.register_object.alsijil_url note.year note.week note.lesson_period.pk %}">{{ note_date }}, {{ note.lesson_period }}</a>#}
{# </p>#}
{# {% if note.remarks %}#}
{# <p class="no-margin"><em>{{ note.remarks }}</em></p>#}
{# {% endif %}#}
{# {% if can_edit_personal_note %}#}
{# <form action="" method="post" class="hide-on-med-and-up">#}
{# {% csrf_token %}#}
{# {% trans "Mark as" %}#}
{# <input type="hidden" value="{{ note.pk }}" name="personal_note">#}
{# {% include "alsijil/partials/mark_as_buttons.html" %}#}
{# <a class="btn-flat red-text" title="{% trans "Delete note" %}"#}
{# href="{% url "delete_personal_note" note.pk %}">#}
{# <i class="material-icons center">cancel</i>#}
{# </a>#}
{# </form>#}
{# {% endif %}#}
{# </li>#}
{# {% empty %}#}
{# <li class="collection-item avatar valign-wrapper">#}
{# <i class="material-icons left circle green white-text">check</i>#}
{# <span class="title">{% trans "There are no unexcused lessons." %}</span>#}
{# </li>#}
{# {% endfor %}#}
</ul>
{% if stats %}
<h5>{% trans "Statistics on absences, tardiness and remarks" %}</h5>
<ul class="collapsible">
{% for school_term, stat in stats %}
<li {% if forloop.first %}class="active"{% endif %}>
<div class="collapsible-header">
<i class="material-icons">date_range</i>{{ school_term }}</div>
<div class="collapsible-body">
<table>
<tr>
<th colspan="2">{% trans 'Absences' %}</th>
<td>{{ stat.absences_count }}</td>
</tr>
<tr>
<td rowspan="{{ excuse_types.count|add:2 }}" class="hide-on-small-only">{% trans "thereof" %}</td>
<td rowspan="{{ excuse_types.count|add:2 }}" class="hide-on-med-and-up"></td>
<th class="truncate">{% trans 'Excused' %}</th>
<td>{{ stat.excused }}</td>
</tr>
{% for excuse_type in excuse_types %}
<th>{{ excuse_type.name }}</th>
<td>{{ stat|get_dict:excuse_type.count_label }}</td>
{% endfor %}
<tr>
<th>{% trans 'Unexcused' %}</th>
<td>{{ stat.unexcused }}</td>
</tr>
<tr>
<th colspan="2">{% trans 'Tardiness' %}</th>
<td>{{ stat.tardiness }}'/{{ stat.tardiness_count }} &times;</td>
</tr>
{% for extra_mark in extra_marks %}
<tr>
<th colspan="2">{{ extra_mark.name }}</th>
<td>{{ stat|get_dict:extra_mark.count_label }}</td>
</tr>
{% endfor %}
</table>
</div>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="col s12" id="overview">
<h5>{% trans "Relevant personal notes" %}</h5> <h5>{% trans "Relevant personal notes" %}</h5>
<form action="" method="post"> <form action="" method="post">
{% csrf_token %} {% csrf_token %}
...@@ -311,6 +208,50 @@ ...@@ -311,6 +208,50 @@
</ul> </ul>
</div> </div>
</div> </div>
</div>
</div> </div>
{% if stats %}
<div class="col s12" id="statistics">
<h5>{% trans "Statistics on absences, tardiness and remarks" %}</h5>
<ul class="collapsible">
{% for school_term, stat in stats %}
<li {% if forloop.first %}class="active"{% endif %}>
<div class="collapsible-header">
<i class="material-icons">date_range</i>{{ school_term }}</div>
<div class="collapsible-body">
<table>
<tr>
<th colspan="2">{% trans 'Absences' %}</th>
<td>{{ stat.absences_count }}</td>
</tr>
<tr>
<td rowspan="{{ excuse_types.count|add:2 }}" class="hide-on-small-only">{% trans "thereof" %}</td>
<td rowspan="{{ excuse_types.count|add:2 }}" class="hide-on-med-and-up"></td>
<th class="truncate">{% trans 'Excused' %}</th>
<td>{{ stat.excused }}</td>
</tr>
{% for excuse_type in excuse_types %}
<th>{{ excuse_type.name }}</th>
<td>{{ stat|get_dict:excuse_type.count_label }}</td>
{% endfor %}
<tr>
<th>{% trans 'Unexcused' %}</th>
<td>{{ stat.unexcused }}</td>
</tr>
<tr>
<th colspan="2">{% trans 'Tardiness' %}</th>
<td>{{ stat.tardiness }}'/{{ stat.tardiness_count }} &times;</td>
</tr>
{% for extra_mark in extra_marks %}
<tr>
<th colspan="2">{{ extra_mark.name }}</th>
<td>{{ stat|get_dict:extra_mark.count_label }}</td>
</tr>
{% endfor %}
</table>
</div>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %} {% endblock %}
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