diff --git a/manage.py b/manage.py index 9f4ba75..f0d3bf3 100644 --- a/manage.py +++ b/manage.py @@ -295,8 +295,13 @@ def homeroom_confirm(): if (check_login_status()): return redirect('/logout') refresh_token() - date = request.form['date'] homeroom = request.form['homeroom'].split('^') + date = request.form['date'] + if 'notes' in request.form: + notes = request.form['notes'] + db.child("Homerooms").child(homeroom[0]).child(homeroom[1]).child( + "Absent").child(date).update({"notes": notes}, session['token']) + signature = request.form['signatureData'] signature = removeprefix(signature, 'data:image/png;base64,') signature = bytes(signature, 'utf-8') diff --git a/templates/admin.html b/templates/admin.html index 4d06f46..4fff365 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -149,6 +149,7 @@
Homeroom Teacher 導師
{% if 'confirm' in absData[currDate] %}
+
備註: {{absData[currDate]['notes']}}
{% else %}
No Signature 導師尚未簽名
{% endif %} diff --git a/templates/homeroom.html b/templates/homeroom.html index db46f47..fbbb557 100644 --- a/templates/homeroom.html +++ b/templates/homeroom.html @@ -46,6 +46,7 @@ +
@@ -181,6 +182,7 @@
Homeroom Teacher 導師
{% if 'confirm' in absData[currDate] %}
+
備註: {{absData[currDate]['notes']}}
{% else %}
No Signature 導師尚未簽名
{% endif %} @@ -246,6 +248,7 @@ var data = signaturePad.toDataURL('image/png'); if (hrCfrm) { $('#hrCfrm-sign').val(data); + $('#hrCfrm-notes').val($('#subjectNotes').val()); document.getElementById('homeroom_confirm').submit() } else { var notes = $('#subjectNotes').val();