Skip to content
Snippets Groups Projects
Verified Commit c8b20d10 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

[Lesson view] Add form field for extra marks in personal note table

parent 0e17112c
No related branches found
No related tags found
1 merge request!68Resolve "Add option to configure extra marks for personal notes"
......@@ -28,7 +28,7 @@ class LessonDocumentationForm(forms.ModelForm):
class PersonalNoteForm(forms.ModelForm):
class Meta:
model = PersonalNote
fields = ["absent", "late", "excused", "remarks"]
fields = ["absent", "late", "excused", "extra_marks", "remarks"]
person_name = forms.CharField(disabled=True)
......
.alsijil-check-box {
margin-right: 10px;
}
.alsijil-check-box [type="checkbox"] {
padding-left: 30px;
}
.alsijil-lesson-cancelled {
text-decoration: line-through;
}
......
{# -*- engine:django -*- #}
{% extends "core/base.html" %}
{% load week_helpers %}
{% load week_helpers material_form_internal %}
{% load material_form i18n static %}
{% block browser_title %}{% blocktrans %}Lesson{% endblocktrans %}{% endblock %}
......@@ -144,6 +144,7 @@
<th>{% blocktrans %}Absent{% endblocktrans %}</th>
<th>{% blocktrans %}Tardiness{% endblocktrans %}</th>
<th>{% blocktrans %}Excused{% endblocktrans %}</th>
<th>{% blocktrans %}Extra marks{% endblocktrans %}</th>
<th>{% blocktrans %}Remarks{% endblocktrans %}</th>
</tr>
</thead>
......@@ -172,6 +173,19 @@
<span></span>
</label>
</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 %}
</td>
<td>
<div class="input-field">
{{ form.remarks }}
......
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