Skip to content
Snippets Groups Projects

Resolve "Do not allow to add personal notes for cancelled lessons"

Merged Jonathan Weth requested to merge 82-do-not-count-cancelled-lessons into master
2 files
+ 77
67
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -59,9 +59,11 @@
<li class="tab">
<a href="#lesson-documentation">{% trans "Lesson documentation" %}</a>
</li>
<li class="tab">
<a href="#personal-notes">{% trans "Personal notes" %}</a>
</li>
{% if not lesson_period.get_substitution.cancelled or not request.site.preferences.alsijil__block_personal_notes_for_cancelled %}
<li class="tab">
<a href="#personal-notes">{% trans "Personal notes" %}</a>
</li>
{% endif %}
<li class="tab">
<a href="#version-history">{% trans "Change history" %}</a>
</li>
@@ -146,87 +148,100 @@
</div>
</div>
<div class="col s12" id="personal-notes">
<div class="card">
<div class="card-content">
{% if not lesson_period.get_substitution.cancelled or not request.site.preferences.alsijil__block_personal_notes_for_cancelled %}
<div class="col s12" id="personal-notes">
<div class="card">
<div class="card-content">
<span class="card-title">
{% blocktrans %}Personal notes{% endblocktrans %}
</span>
{% form form=personal_note_formset.management_form %}{% endform %}
<table class="striped responsive-table alsijil-table">
<thead>
<tr>
<th>{% blocktrans %}Person{% endblocktrans %}</th>
<th>{% blocktrans %}Absent{% endblocktrans %}</th>
<th>{% blocktrans %}Tardiness{% endblocktrans %}</th>
<th>{% blocktrans %}Excused{% endblocktrans %}</th>
<th>{% blocktrans %}Excuse type{% endblocktrans %}</th>
<th>{% blocktrans %}Extra marks{% endblocktrans %}</th>
<th>{% blocktrans %}Remarks{% endblocktrans %}</th>
</tr>
</thead>
<tbody>
{% for form in personal_note_formset %}
{% form form=personal_note_formset.management_form %}{% endform %}
<table class="striped responsive-table alsijil-table">
<thead>
<tr>
{{ form.id }}
<td>{{ form.person_name }}{{ form.person_name.value }}</td>
<td class="center-align">
<label>
{{ form.absent }}
<span></span>
</label>
</td>
<td>
<div class="input-field">
{{ form.late }}
<label for="{{ form.absent.id_for_label }}">
{% trans "Tardiness (in m)" %}
<th>{% blocktrans %}Person{% endblocktrans %}</th>
<th>{% blocktrans %}Absent{% endblocktrans %}</th>
<th>{% blocktrans %}Tardiness{% endblocktrans %}</th>
<th>{% blocktrans %}Excused{% endblocktrans %}</th>
<th>{% blocktrans %}Excuse type{% endblocktrans %}</th>
<th>{% blocktrans %}Extra marks{% endblocktrans %}</th>
<th>{% blocktrans %}Remarks{% endblocktrans %}</th>
</tr>
</thead>
<tbody>
{% for form in personal_note_formset %}
<tr>
{{ form.id }}
<td>{{ form.person_name }}{{ form.person_name.value }}</td>
<td class="center-align">
<label>
{{ form.absent }}
<span></span>
</label>
</div>
</td>
<td class="center-align">
<label>
{{ form.excused }}
<span></span>
</label>
</td>
<td>
<div class="input-field">
{{ form.excuse_type }}
<label for="{{ form.excuse_type.id_for_label }}">
{% trans "Excuse type" %}
</td>
<td>
<div class="input-field">
{{ form.late }}
<label for="{{ form.absent.id_for_label }}">
{% trans "Tardiness (in m)" %}
</label>
</div>
</td>
<td class="center-align">
<label>
{{ form.excused }}
<span></span>
</label>
</div>
</td>
<td>
{% for group, items in form.extra_marks|select_options %}
{% for choice, value, selected in items %}
<label class="{% if selected %} active{% endif %} alsijil-check-box">
<input type="checkbox"
{% if value == None or value == '' %}disabled{% else %}value="{{ value }}"{% endif %}
{% if selected %} checked="checked"{% endif %}
name="{{ form.extra_marks.html_name }}">
<span>{{ choice }}</span>
</td>
<td>
<div class="input-field">
{{ form.excuse_type }}
<label for="{{ form.excuse_type.id_for_label }}">
{% trans "Excuse type" %}
</label>
</div>
</td>
<td>
{% for group, items in form.extra_marks|select_options %}
{% for choice, value, selected in items %}
<label class="{% if selected %} active{% endif %} alsijil-check-box">
<input type="checkbox"
{% if value == None or value == '' %}disabled{% else %}value="{{ value }}"{% endif %}
{% if selected %} checked="checked"{% endif %}
name="{{ form.extra_marks.html_name }}">
<span>{{ choice }}</span>
</label>
{% endfor %}
{% endfor %}
{% endfor %}
</td>
<td>
<div class="input-field">
{{ form.remarks }}
<label for="{{ form.absent.id_for_label }}">
{% trans "Remarks" %}
</label>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</td>
<td>
<div class="input-field">
{{ form.remarks }}
<label for="{{ form.absent.id_for_label }}">
{% trans "Remarks" %}
</label>
</div>
</td>
<td>
<div class="input-field">
{{ form.remarks }}
<label for="{{ form.absent.id_for_label }}">
{% trans "Remarks" %}
</label>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endif %}
<div class="col s12" id="version-history">
<div class="card">
<div class="card-content">
Loading