diff --git a/aleksis/apps/alsijil/templates/alsijil/class_register/person.html b/aleksis/apps/alsijil/templates/alsijil/class_register/person.html index 223fc557697686ff392fe27ffe066c12cd81abc8..43fede95806ac809e72466594e535aea3d17fc1e 100644 --- a/aleksis/apps/alsijil/templates/alsijil/class_register/person.html +++ b/aleksis/apps/alsijil/templates/alsijil/class_register/person.html @@ -36,10 +36,10 @@ <a href="#personal-notes">{% trans "Personal notes" %}</a> </li> {% if stats %} - <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> + <li class="tab"><a href="#statistics">{% trans "Statistics" %}</a></li> {% endif %} </ul> + </div> {% if register_object_table %} <div class="col s12" id="lesson-documentations"> {% include "alsijil/partials/objects_table.html" with table=register_object_table filter_form=filter_form %} @@ -56,111 +56,8 @@ {% 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 %}#} - {# {% 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 }} ×</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"> + <div class="col s12" id="overview"> <h5>{% trans "Relevant personal notes" %}</h5> <form action="" method="post"> {% csrf_token %} @@ -311,6 +208,50 @@ </ul> </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 }} ×</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 %}