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

Reformat person.html

parent 593d3d1e
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"
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% load rules data_helpers week_helpers i18n material_form static django_tables2 %} {% load rules data_helpers week_helpers i18n material_form static django_tables2 %}
{% block extra_head %} {% block extra_head %}
<link rel="stylesheet" href="{% static "css/alsijil/person.css" %}"> <link rel="stylesheet" href="{% static "css/alsijil/person.css" %}">
<script src="{% static "js/alsijil/person.js" %}" type="text/javascript"></script> <script src="{% static "js/alsijil/person.js" %}" type="text/javascript"></script>
{% endblock %} {% endblock %}
{% block browser_title %}{% blocktrans %}Class register: person{% endblocktrans %}{% endblock %} {% block browser_title %}{% blocktrans %}Class register: person{% endblocktrans %}{% endblock %}
...@@ -26,19 +26,19 @@ ...@@ -26,19 +26,19 @@
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col s12"> <div class="col s12">
<ul class="tabs"> <ul class="tabs">
{% if register_object_table %} {% if register_object_table %}
<li class="tab"> <li class="tab">
<a href="#lesson-documentations">{% trans "Lesson documentations" %}</a> <a href="#lesson-documentations">{% trans "Lesson documentations" %}</a>
</li> </li>
{% endif %} {% endif %}
<li class="tab"> <li class="tab">
<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"><a href="#statistics">{% trans "Statistics" %}</a></li> <li class="tab"><a href="#statistics">{% trans "Statistics" %}</a></li>
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
{% if register_object_table %} {% if register_object_table %}
<div class="col s12" id="lesson-documentations"> <div class="col s12" id="lesson-documentations">
...@@ -58,156 +58,157 @@ ...@@ -58,156 +58,157 @@
<div class="col s12" id="overview"> <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 %}
{% form form=action_form %}{% endform %} {% form form=action_form %}{% endform %}
<button type="submit" class="btn waves-effect waves-light">Enter</button> <button type="submit" class="btn waves-effect waves-light">Enter</button>
{% render_table personal_notes_table %} {% render_table personal_notes_table %}
</form> </form>
<ul class="collapsible"> <ul class="collapsible">
<li> <li>
<div> <div>
<ul> <ul>
{% for note in personal_notes %} {% for note in personal_notes %}
{% ifchanged note.school_term %}</ul></div></li> {% ifchanged note.school_term %}</ul></div></li>
<li {% if forloop.first %}class="active"{% endif %}> <li {% if forloop.first %}class="active"{% endif %}>
<div class="collapsible-header"><i <div class="collapsible-header"><i
class="material-icons">date_range</i>{{ note.school_term }}</div> class="material-icons">date_range</i>{{ note.school_term }}</div>
<div class="collapsible-body"> <div class="collapsible-body">
<ul class="collection"> <ul class="collection">
{% endifchanged %} {% endifchanged %}
{% ifchanged note.week %} {% ifchanged note.week %}
<li class="collection-item"> <li class="collection-item">
<strong>{% blocktrans with week=note.calendar_week.week %}Week {{ week }}{% endblocktrans %}</strong> <strong>{% blocktrans with week=note.calendar_week.week %}Week
</li> {{ week }}{% endblocktrans %}</strong>
{% endifchanged %} </li>
{% ifchanged note.date %} {% endifchanged %}
<li class="collection-item"> {% ifchanged note.date %}
{% if can_mark_all_as_excused and note.date %} <li class="collection-item">
<form action="" method="post" class="right hide-on-small-only" style="margin-top: -7px;"> {% if can_mark_all_as_excused and note.date %}
{% csrf_token %} <form action="" method="post" class="right hide-on-small-only" style="margin-top: -7px;">
{% trans "Mark all as" %} {% csrf_token %}
<input type="hidden" value="{{ note.date|date:"Y-m-d" }}" name="date"> {% trans "Mark all as" %}
{% include "alsijil/partials/mark_as_buttons.html" %} <input type="hidden" value="{{ note.date|date:"Y-m-d" }}" name="date">
</form> {% include "alsijil/partials/mark_as_buttons.html" %}
{% endif %} </form>
<i class="material-icons left">schedule</i> {% endif %}
<i class="material-icons left">schedule</i>
{% if note.date %} {% if note.date %}
{{ note.date }} {{ note.date }}
{% else %} {% else %}
{{ note.register_object.date_start }} {{ note.register_object.date_start }}
{{ note.register_object.period_from.period }}.–{{ note.register_object.date_end }} {{ note.register_object.period_from.period }}.–{{ note.register_object.date_end }}
{{ note.register_object.period_to.period }}. {{ note.register_object.period_to.period }}.
{% endif %} {% endif %}
{% if can_mark_all_as_excused and note.date %} {% if can_mark_all_as_excused and note.date %}
<form action="" method="post" class="hide-on-med-and-up"> <form action="" method="post" class="hide-on-med-and-up">
{% csrf_token %} {% csrf_token %}
{% trans "Mark all as" %} {% trans "Mark all as" %}
<input type="hidden" value="{{ note.date|date:"Y-m-d" }}" name="date"> <input type="hidden" value="{{ note.date|date:"Y-m-d" }}" name="date">
{% include "alsijil/partials/mark_as_buttons.html" %} {% include "alsijil/partials/mark_as_buttons.html" %}
</form> </form>
{% endif %} {% endif %}
</li> </li>
{% endifchanged %} {% endifchanged %}
<li class="collection-item"> <li class="collection-item">
<div class="row no-margin"> <div class="row no-margin">
<div class="col s2 m1"> <div class="col s2 m1">
{% if note.register_object.period %} {% if note.register_object.period %}
{{ note.register_object.period.period }}. {{ note.register_object.period.period }}.
{% endif %} {% endif %}
</div> </div>
<div class="col s10 m4"> <div class="col s10 m4">
<i class="material-icons left">event_note</i> <i class="material-icons left">event_note</i>
<a href="{{ note.get_absolute_url }}"> <a href="{{ note.get_absolute_url }}">
{% if note.register_object.get_subject %} {% if note.register_object.get_subject %}
{{ note.register_object.get_subject.name }} {{ note.register_object.get_subject.name }}
{% else %} {% else %}
{% trans "Event" %} ({{ note.register_object.title }}) {% trans "Event" %} ({{ note.register_object.title }})
{% endif %}<br/> {% endif %}<br/>
{{ note.register_object.teacher_names }} {{ note.register_object.teacher_names }}
</a> </a>
</div> </div>
<div class="col s12 m7 no-padding"> <div class="col s12 m7 no-padding">
{% has_perm "alsijil.edit_personalnote" user note as can_edit_personal_note %} {% has_perm "alsijil.edit_personalnote" user note as can_edit_personal_note %}
{% if note.absent and not note.excused and can_edit_personal_note %} {% if note.absent and not note.excused and can_edit_personal_note %}
<form action="" method="post" class="right hide-on-small-only" style="margin-top: -7px;"> <form action="" method="post" class="right hide-on-small-only" style="margin-top: -7px;">
{% csrf_token %} {% csrf_token %}
{% trans "Mark as" %} {% trans "Mark as" %}
<input type="hidden" value="{{ note.pk }}" name="personal_note"> <input type="hidden" value="{{ note.pk }}" name="personal_note">
{% include "alsijil/partials/mark_as_buttons.html" %} {% include "alsijil/partials/mark_as_buttons.html" %}
<a class="btn-flat red-text" title="{% trans "Delete note" %}" <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>
{% elif can_edit_personal_note %}
<a class="btn-flat red-text right hide-on-small-only" title="{% trans "Delete note" %}"
href="{% url "delete_personal_note" note.pk %}"> href="{% url "delete_personal_note" note.pk %}">
<i class="material-icons center">cancel</i> <i class="material-icons center">cancel</i>
</a> </a>
{% endif %} </form>
{% elif can_edit_personal_note %}
<a class="btn-flat red-text right hide-on-small-only" title="{% trans "Delete note" %}"
href="{% url "delete_personal_note" note.pk %}">
<i class="material-icons center">cancel</i>
</a>
{% endif %}
{% if note.absent %} {% if note.absent %}
<div class="chip red white-text"> <div class="chip red white-text">
{% trans 'Absent' %} {% trans 'Absent' %}
</div> </div>
{% endif %} {% endif %}
{% if note.excused %} {% if note.excused %}
<div class="chip green white-text"> <div class="chip green white-text">
{% if note.excuse_type %} {% if note.excuse_type %}
{{ note.excuse_type.name }} {{ note.excuse_type.name }}
{% else %} {% else %}
{% trans 'Excused' %} {% trans 'Excused' %}
{% endif %} {% endif %}
</div> </div>
{% endif %} {% endif %}
{% if note.late %} {% if note.late %}
<div class="chip orange white-text"> <div class="chip orange white-text">
{% blocktrans with late=note.late %}{{ late }}' late{% endblocktrans %} {% blocktrans with late=note.late %}{{ late }}' late{% endblocktrans %}
</div> </div>
{% endif %} {% endif %}
{% for extra_mark in note.extra_marks.all %} {% for extra_mark in note.extra_marks.all %}
<div class="chip">{{ extra_mark.name }}</div> <div class="chip">{{ extra_mark.name }}</div>
{% endfor %} {% endfor %}
<em>{{ note.remarks }}</em> <em>{{ note.remarks }}</em>
</div> </div>
<div class="col s12 hide-on-med-and-up"> <div class="col s12 hide-on-med-and-up">
{% if note.absent and not note.excused and can_edit_personal_note %} {% if note.absent and not note.excused and can_edit_personal_note %}
<form action="" method="post"> <form action="" method="post">
{% csrf_token %} {% csrf_token %}
{% trans "Mark as" %} {% trans "Mark as" %}
<input type="hidden" value="{{ note.pk }}" name="personal_note"> <input type="hidden" value="{{ note.pk }}" name="personal_note">
{% include "alsijil/partials/mark_as_buttons.html" %} {% 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>
{% elif can_edit_personal_note %}
<a class="btn-flat red-text" title="{% trans "Delete note" %}" <a class="btn-flat red-text" title="{% trans "Delete note" %}"
href="{% url "delete_personal_note" note.pk %}"> href="{% url "delete_personal_note" note.pk %}">
<i class="material-icons left">cancel</i> <i class="material-icons center">cancel</i>
{% trans "Delete" %}
</a> </a>
{% endif %} </form>
</div> {% elif can_edit_personal_note %}
</li> <a class="btn-flat red-text" title="{% trans "Delete note" %}"
{% endfor %} href="{% url "delete_personal_note" note.pk %}">
<i class="material-icons left">cancel</i>
{% trans "Delete" %}
</a>
{% endif %}
</div>
</li> </li>
</ul> {% endfor %}
</div> </li>
</div> </ul>
</div>
</div>
</div> </div>
{% if stats %} {% if stats %}
<div class="col s12" id="statistics"> <div class="col s12" id="statistics">
...@@ -252,6 +253,6 @@ ...@@ -252,6 +253,6 @@
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% endif %} {% 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