diff --git a/manage.py b/manage.py index af25a95..8da7130 100644 --- a/manage.py +++ b/manage.py @@ -138,7 +138,7 @@ def manageProcess(fCommand, fData): cclass['class_id'] in tmpAbsData[currDate][p]['signature']), "absent": False if not num in tmpAbsData[currDate][p] else tmpAbsData[currDate][p][num] } - return render_template('group_teach.html', cclass=cclass, absData=absData, dow=dow, currDate=currDate, tmpAbsData=tmpAbsData, confirmed=confirmed) + return render_template('group_teach.html', dateKeys=sorted(tmpAbsData.keys()), cclass=cclass, absData=absData, dow=dow, currDate=currDate, tmpAbsData=tmpAbsData, confirmed=confirmed) elif pl == 'homeroom': homeroom = session['homeroom'].split('^') homeroomData = db.child("Homerooms").child(homeroom[0]).child( @@ -177,7 +177,7 @@ def manageProcess(fCommand, fData): if i >= datetime.now(tz).strftime("%Y-%m-%d"): break return render_template('homeroom.html', absData=absData, homeroomCode=homeroom, homeroomData=homeroomData, - currDate=currDate, periods=['m', '1', '2', '3', '4', 'n', '5', '6', '7', '8', '9'], currPeriod=currPeriod) + currDate=currDate, dateKeys=sorted(absData.keys()), periods=['m', '1', '2', '3', '4', 'n', '5', '6', '7', '8', '9'], currPeriod=currPeriod) else: return redirect('/logout') diff --git a/templates/admin.html b/templates/admin.html index f3ddb41..fe7646e 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -34,13 +34,6 @@

Homeroom NOT Confirmed 班導尚未確認

{% endif %} - -
@@ -60,7 +53,7 @@ - {% for date in tmpAbsData %} - {% if date == currDate %} - - {% else %} - - {% endif %} - {% endfor %} + {% for date in range(dateKeys|length) %} + {% if dateKeys[date] == currDate %} + {% if date-2 >= 0 %}{% endif %} + {% if date-1 >= 0 %}{% endif %} + + {% for i in range(1,5) %} + {% if date+i < dateKeys|length %}{%endif%} + {% endfor %} + {% endif %} + {% endfor %} {% for i in absData %} {% set alr_fill = namespace(found=false) %} diff --git a/templates/homeroom.html b/templates/homeroom.html index c5d6034..a15c6a6 100644 --- a/templates/homeroom.html +++ b/templates/homeroom.html @@ -32,13 +32,16 @@
diff --git a/templates/selSubUser.html b/templates/selSubUser.html index 583e8e4..270d9ae 100644 --- a/templates/selSubUser.html +++ b/templates/selSubUser.html @@ -35,13 +35,13 @@ {% for key in data %} {% if data[key]['type'] == 'homeroom' %} - {% else %} {% for i in data[key] %} {% if i == 'type' %} {% else %} - + {% endif %} {% endfor %} {% endif %}