diff --git a/manage.py b/manage.py index 8da7130..e5d60b4 100644 --- a/manage.py +++ b/manage.py @@ -269,6 +269,15 @@ def homeroom_abs_publish(): homeroom = request.form['homeroom'].split('^') period = request.form['period'] signature = request.form['signatureData'] + if (request.form['stype'] == 'edit'): + oldData = list(db.child("Homerooms").child(homeroom[0]).child(homeroom[1]).child( + "Absent").child(date).child(period).shallow().get(session['token']).val()) + print(oldData, type(oldData)) + for k in oldData: + if k == 'name' or k == 'teacher': + continue + db.child("Homerooms").child(homeroom[0]).child(homeroom[1]).child( + "Absent").child(date).child(period).child(k).remove(session['token']) formData = request.form.to_dict() notes = "" if "confirm" in db.child("Homerooms").child(homeroom[0]).child(homeroom[1]).child("Absent").child(date).get(session['token']).val(): @@ -288,6 +297,7 @@ def homeroom_abs_publish(): formData.pop('date') formData.pop('homeroom') formData.pop('period') + formData.pop('stype') for i in formData: i = i.split('^') db.child("Homerooms").child(homeroom[0]).child( diff --git a/templates/homeroom.html b/templates/homeroom.html index 9873ddf..a871caf 100644 --- a/templates/homeroom.html +++ b/templates/homeroom.html @@ -81,23 +81,23 @@
X
+X
{% else %} -𝜑
+𝜑
{% endif %} {% else %} {% if absData[currDate][j]['name'] != 'GP' %} -V
+V
{% else %} {% if (homeroomData[i]['GP_Class'][absData[currDate][j]['teacher']] in absData[currDate][j]['signature'])%} -V
+V
{% else %} - + {% endif %} {% endif %} {% endif %} @@ -124,14 +124,15 @@ {% for i in periods %} -