Attendance/templates/homeroom.html

373 lines
22 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
2021-12-12 02:38:10 -08:00
<title>Attendance 點名系統 2.0</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
2021-12-12 02:38:10 -08:00
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="/static/allpages.css">
2021-09-12 02:39:09 -07:00
<link rel="stylesheet" href="/static/homeroom.css">
2021-09-18 04:26:06 -07:00
<link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico" />
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-H6D61RSBHR"></script>
2021-10-19 07:30:49 -07:00
<script src="/static/gtag.js"></script>
</head>
<body>
2021-09-26 06:37:34 -07:00
<div class="showTime"><span id="showTime"></span></div>
2021-12-12 02:38:10 -08:00
{% include 'sidebar.html' %}
<div class="container">
2021-09-18 04:26:06 -07:00
<h1 class="margin-top">Homeroom View | 班級主頁</h1>
2021-12-12 02:38:10 -08:00
<h2 class="margin-top">{{currRoom[0]}}{{currRoom[1]}}</h2>
2021-09-18 04:26:06 -07:00
<h2>[{{currDate}}]</h2>
2021-10-15 05:32:24 -07:00
<select name="date" id="date" class="form-select logout" onchange="chgDate();">
2021-12-12 02:38:10 -08:00
{% for date in range(dates|length) %}
{% if dates[date][0] == currDate %}
{% if date-2 >= 0 %}<option value="{{dates[date-2][0]}}">{{dates[date-2][0]}}</option>{% endif %}
{% if date-1 >= 0 %}<option value="{{dates[date-1][0]}}">{{dates[date-1][0]}}</option>{% endif %}
<option value="{{dates[date][0]}}" selected="selected">{{dates[date][0]}} ★</option>
{% for i in range(1,5) %}
2021-12-12 02:38:10 -08:00
{% if date+i < dates|length %}<option value="{{dates[date+i][0]}}">{{dates[date+i][0]}}</option>{%endif%}
{% endfor %}
{% endif %}
{% endfor %}
2021-10-15 05:32:24 -07:00
</select>
<form action="/manage/homeroom_confirm" id="homeroom_confirm" method="post">
<input type="hidden" name="date" value="{{currDate}}">
2021-12-12 02:38:10 -08:00
<input type="hidden" name="homeroom" value="{{currRoom[0]}}^{{currRoom[1]}}">
2021-09-12 02:39:09 -07:00
<input type="hidden" id="hrCfrm-sign" name="signatureData" value="">
<input type="hidden" id="hrCfrm-notes" name="notes" value="">
</form>
<div class="col">
<div class="sticky-top" style="background-color:white;">
<div class="row title">
2021-09-18 04:26:06 -07:00
<div class="col">班級</div>
<div class="col">座號</div>
<div class="col">姓名</div>
<div class="col">英文姓名</div>
{% for i in periods %}
2021-12-12 02:38:10 -08:00
<div class="col" {% if currPeriod==i %}style="background-color: #ffdf81;"{%endif%}>{{i}}</div>
{% endfor %}
</div>
<div class="row title">
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
{% for i in periods %}
2021-12-12 02:38:10 -08:00
<div class="col" {% if currPeriod==i %}style="background-color: #ffdf81;"{%endif%}>
{{schedule[i]['subject']}} {% if schedule[i]['special'] == True %} <span class="text-red">(換)</span> {% endif %}</div>
{% endfor %}
</div>
<div class="row title">
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
{% for i in periods %}
2021-12-12 02:38:10 -08:00
<div class="col" {% if currPeriod==i %}style="background-color: #ffdf81;"{%endif%}>{{schedule[i]['teacher']}}</div>
{% endfor %}
</div>
</div>
2021-12-12 02:38:10 -08:00
{% for i in students %}
<div class="row">
2021-12-12 02:38:10 -08:00
<div class="col">{{currRoom[0]}}{{currRoom[1]}}</div>
<div class="col">{{ i[0] }}</div>
<div class="col">{{ i[1] }}</div>
<div class="col">{{ i[2] }}</div>
2021-09-12 02:39:09 -07:00
{% for j in periods %}
2021-12-12 02:38:10 -08:00
<div class="col view-{{j}}" {% if currPeriod==j %}style="background-color: #ffdf81;"{%endif%}>
{% if schedule[j]['subject'] == 'GP' %}
2021-12-26 05:08:50 -08:00
{% for k in submission[j] %}
{% if k!='notes' and i[0] in absentData[j] %}
{% if absentData[j][i[0]]['status'] == 'L' %}
<p class="highlightAbs n-3 view-n-{{i[0]}}">𝜑</p>
{% elif absentData[j][i[0]]['status'] == 'K' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% elif absentData[j][i[0]]['status'] == 'G' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% elif absentData[j][i[0]]['status'] == 'S' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% elif absentData[j][i[0]]['status'] == 'F' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% elif absentData[j][i[0]]['status'] == 'P' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% elif absentData[j][i[0]]['status'] == 'O' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% else %}
<p class="highlightAbs n-2 view-n-{{i[0]}}">{{absentData[j][i[0]]['status']}}</p>
{% endif %}
<p class="highlightAbs">{{absentData[j][i[0]]['note']}}</p>
{% elif studGP[i[0]][schedule[j]['teacher']] == k %}
<p class="highlightAbs n-1 view-n-{{i[0]}}">V</p>
{% if j in idvDS and i[0] in idvDS[j] %}
<p class="highlightAbs n-2">{{idvDS[j][i[0]]}}</p>
{% endif %}
{% else %}
<p class="highlightAbs view-n-{{i[0]}}"></p>
{% endif %}
{% endfor %}
2021-12-12 02:38:10 -08:00
{% else %}
{% if j in submission or j in absentData %}
{% if i[0] in absentData[j] %}
{% if absentData[j][i[0]]['status'] == 'L' %}
<p class="highlightAbs n-3 view-n-{{i[0]}}">𝜑</p>
{% elif absentData[j][i[0]]['status'] == 'K' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% elif absentData[j][i[0]]['status'] == 'G' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% elif absentData[j][i[0]]['status'] == 'S' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% elif absentData[j][i[0]]['status'] == 'F' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% elif absentData[j][i[0]]['status'] == 'P' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
{% elif absentData[j][i[0]]['status'] == 'O' %}
<p class="highlightAbs n-2 view-n-{{i[0]}}"></p>
2021-09-12 06:59:31 -07:00
{% else %}
2021-12-12 02:38:10 -08:00
<p class="highlightAbs n-2 view-n-{{i[0]}}">{{absentData[j][i[0]]['status']}}</p>
{% endif %}
<p class="highlightAbs">{{absentData[j][i[0]]['note']}}</p>
{% else %}
{% if j in submission %}
<p class="highlightAbs n-1 view-n-{{i[0]}}">V</p>
{% if j in idvDS and i[0] in idvDS[j] %}
<p class="highlightAbs n-2">{{idvDS[j][i[0]]}}</p>
{% endif %}
2021-09-12 02:39:09 -07:00
{% else %}
2021-12-12 02:38:10 -08:00
<div class="input-{{j}}-{{i[0]}}">
<input type="checkbox" class="tobeform 2^{{j}}^{{i[0]}} late" id="late^{{j}}^{{i[0]}}"
onchange="unCheckAbs('{{j}}^{{i[0]}}')">
<input type="checkbox" class="tobeform 1^{{j}}^{{i[0]}} absent" id="absent^{{j}}^{{i[0]}}"
onchange="unCheckLate('{{j}}^{{i[0]}}')">
</div>
{% endif %}
{% endif %}
2021-09-12 02:39:09 -07:00
{% endif %}
2021-09-12 06:59:31 -07:00
{% endif %}
2021-09-12 02:39:09 -07:00
</div>
{% endfor %}
</div>
{% endfor %}
2021-09-12 02:39:09 -07:00
<div class="row">
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
<div class="col"></div>
{% for i in periods %}
2021-10-15 05:29:53 -07:00
<div id="btns-{{i}}" class="col" {% if currPeriod==i %} style="background-color: #ffdf81;" {% endif %}>
2021-12-26 05:08:50 -08:00
{% if (schedule[i]['subject'] == 'GP' or 'c' in submission) or (i in submission and submission[i]['dscfrm'] == True) %}
<button class="btn btn-primary afterSelButton" disabled="disabled"></button>
2021-12-26 05:08:50 -08:00
{% elif i in submission and submission[i]['dscfrm'] != True %}
<button class="btn btn-warning afterSelButton" onclick="showSelDS('{{i|string}}')">定心<br>{{schedule[i]['subject']}}</button>
2021-09-12 02:39:09 -07:00
{% else %}
<button class="btn btn-primary afterSelButton"
2021-12-12 02:38:10 -08:00
onclick="afterSelAbs('{{i|string}}', 'newSubmit')">Confirm<br>{{schedule[i]['subject']}}</button>
2021-09-12 02:39:09 -07:00
{% endif %}
</div>
{% endfor %}
</div>
2021-12-12 02:38:10 -08:00
{% for i in range(7) %}
<div class="row" {%if i==0%}style="border-top: 2px solid black;"{%endif%} {% if i == 6 %} style="border-bottom: 2px solid black;" {% endif %}>
<div class="col"></div>
<div class="col"></div>
<div class="col" style="font-weight: bold;">{{dstext[i]}}</div>
<div class="col">{{dsboard[i]}}</div>
{% for j in periods %}
{% if j in submission and schedule[j] != 'GP' %}
<div class="col" {% if currPeriod==j %} style="background-color: #ffdf81;" {% endif %}>
{{submission[j]['ds' + (i+1)|string]}}</div>
{% else %}
<div class="col" {% if currPeriod==j %} style="background-color: #ffdf81;" {% endif %}></div>
{% endif %}
{% endfor %}
</div>
{% endfor %}
2021-09-12 02:39:09 -07:00
<form action="/manage/homeroom_abs" id="postHomeroomAbs" hidden="hidden" method="post">
<input type="text" id="HR-date" name="date" value="{{currDate}}">
<input type="text" id="HR-period" name="period" value="">
<input type="text" id="HR-signatureData" name="signatureData" value="">
2021-09-14 02:49:16 -07:00
<input type="text" id="HR-notes" name="notes" value="">
2021-12-12 02:38:10 -08:00
<input type="text" id="HR-homeroom" name="homeroom" value="{{currRoom[0]}}^{{currRoom[1]}}">
2021-12-26 05:08:50 -08:00
</form>
<form action="/manage/homeroom_ds" id="postHomeroomDS" hidden="hidden" method="POST">
<input type="text" id="DS-date" name="date" value="{{currDate}}">
<input type="text" id="DS-period" name="period" value="">
<input type="text" id="DS-ds1" name="ds^1" value="">
<input type="text" id="DS-ds2" name="ds^2" value="">
<input type="text" id="DS-ds3" name="ds^3" value="">
<input type="text" id="DS-ds4" name="ds^4" value="">
<input type="text" id="DS-ds5" name="ds^5" value="">
<input type="text" id="DS-ds6" name="ds^6" value="">
<input type="text" id="DS-ds7" name="ds^7" value="">
<input type="text" id="DS-notes" name="notes" value="">
<input type="text" id="DS-homeroom" name="homeroom" value="{{currRoom[0]}}^{{currRoom[1]}}">
2021-09-12 02:39:09 -07:00
</form>
2021-12-12 02:38:10 -08:00
{% if 'c' in submission %}
2021-09-12 02:39:09 -07:00
<button class="btn btn-primary margin-top afterSelButton" onclick="homeroomCfrm()" disabled="disabled">
2021-09-14 07:55:11 -07:00
Homeroom Teacher Already Confirmed | 班導已確認</button>
2021-09-12 02:39:09 -07:00
{% else %}
<button class="btn btn-primary margin-top afterSelButton" onclick="homeroomCfrm()">Homeroom
2021-09-15 04:30:09 -07:00
Teacher Confirm | 班導確認</button>
{% endif %}
2021-10-19 07:30:49 -07:00
<div id="finalCheck" class="modal fade" id="staticBackdrop" data-bs-backdrop="static"
data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="staticBackdropLabel">Please Sign Below 請在下方簽名</h5>
</div>
<div class="modal-body">
<h3>Period: <span id="showSignPeriod"></span></h3>
<h3>Subject: <span id="showSignSubjectName"></h3>
<div class="alert alert-warning margin-top" id="allPresentWarning" role="alert"
hidden="hidden">
<h4 class="alert-heading">請確認是否全班全到Please check if everyone is present!</h4>
</div>
<div class="forSign"><canvas id="signature_pad"></canvas></div>
2021-12-26 05:08:50 -08:00
<h3 class="margin-top">Notes 備註欄</h3>
<input type="textarea" class="form-control" name="notes" id="subjectNotes"
placeholder="Enter Notes 請輸入備註" style="width: 80%; margin-left: 10%;" row="3">
</div>
<div class="modal-footer">
<div class="row">
<div class="col"><button class="btn btn-secondary" type="button" onclick="signaturePad.clear()">Clear Signature 清除簽名</button></div>
<div class="col"><button type="button" class="btn btn-danger" onclick="location.reload();">Cancel 取消</button></div>
<div class="col"><button type="button" class="btn btn-primary" onclick="submitForm()">Submit 提交</button></div>
</div>
</div>
</div>
</div>
</div>
<div id="dsCheck" class="modal fade" id="staticBackdrop" data-bs-backdrop="static"
data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="staticBackdropLabel">定心專案 DS</h5>
</div>
<div class="modal-body">
2021-12-12 02:38:10 -08:00
<div class="ds">
{% for i in range(dsboard|length) %}
<div class="row dsboard" style="width: 40%; margin-left: 30%;">
<div class="col col-4">
<span>{{dsboard[i]}}</span>
</div>
{% for j in range(6) %}
<div class="col">
<input class="form-check-input" type="radio" name="ds{{i+1}}" id="ds{{i+1}}{{j}}" value="{{j}}" {%if j==5%}checked{%endif%}>
<label class="form-check-label" for="ds{{i+1}}{{j}}">{{j}}</label>
</div>
{% endfor %}
</div>
{% endfor %}
<div id="indds" class="row margin-top" style="width: 90%; margin-left: 5%">
<div class="col-2">
<select class="form-select" name="dsnumbers" id="dsnumbersel">
<option value="">選擇號碼</option>
{% for i in students %}
<option value="{{i[0]}}-{{i[1]}}-{{i[2]}}">{{i[0]}}-{{i[1]}}-{{i[2]}}</option>
{% endfor %}
</select>
</div>
<div class="col-4">
<select name="dsoffense" id="dsoffensesel" class="form-select">
<option value="">選擇違規事由</option>
{% for i in dsoffenses %}
<option value="{{i}}-{{dsoffenses[i]}}">{{i}}-{{dsoffenses[i]}}</option>
{% endfor %}
</select>
</div>
<div class="col-5">
<input type="text" class="form-control" name="dsoffenseother" id="dsoffenseother" placeholder="Other">
</div>
<div class="col noborder"><button class="btn btn-secondary nomargin-top" onclick="addDS()"><i class="fas fa-plus"></i></button></div>
</div>
<div id="inddsview" class="margin-top" style="width: 90%; margin-left: 5%;"><div class="col"></div></div>
</div>
2021-10-19 07:30:49 -07:00
<h3 class="margin-top">Notes 備註欄</h3>
2021-12-26 05:08:50 -08:00
<input type="textarea" class="form-control" name="notes" id="dsNotesEnter"
2021-10-19 07:30:49 -07:00
placeholder="Enter Notes 請輸入備註" style="width: 80%; margin-left: 10%;" row="3">
</div>
<div class="modal-footer">
2021-12-12 02:38:10 -08:00
<div class="row">
<div class="col"><button type="button" class="btn btn-danger" onclick="location.reload();">Cancel 取消</button></div>
2021-12-26 05:08:50 -08:00
<div class="col"><button type="button" class="btn btn-primary" onclick="submitDSForm()">Submit 提交</button></div>
2021-12-12 02:38:10 -08:00
</div>
2021-10-19 07:30:49 -07:00
</div>
</div>
</div>
2021-09-12 02:39:09 -07:00
</div>
{% for c in range(periods|length + 1) %}
2021-09-14 02:49:16 -07:00
{% if c % 4 == 0 %}
<div class="row signatures">
{% endif %}
<div class="col half">
2021-09-12 02:39:09 -07:00
{% if c == 0 %}
2021-10-05 04:22:23 -07:00
<div class="row needborder">Homeroom Teacher 導師</div>
2021-12-12 02:38:10 -08:00
{% if 'c' in submission %}
<div class="row"><img src="{{submission['c']['signature']}}" alt=""></div>
<div class="row">備註: {{submission['c']['notes']}}</div>
2021-09-12 02:39:09 -07:00
{% else %}
2021-09-16 06:19:10 -07:00
<div class="row"><span style="color:red;">No Signature 導師尚未簽名</span></div>
{% endif %}
{% else %}
2021-12-12 02:38:10 -08:00
{% if schedule[periods[c-1]]['subject'] == 'GP' %}
{% if periods[c-1] in submission %}
{% for i in submission[periods[c-1]] %}
{% if i != 'notes' %}
<div class="row needborder">{{periods[c-1]}}:
{{schedule[periods[c-1]]['teacher']}}: {{i}}</div>
<div class="row"><img src="{{submission[periods[c-1]][i]['signature']}}" alt="">
{% if loop.index == loop.length-1 %}
<br>備註: {{submission[periods[c-1]]['notes']}}
2021-10-05 04:22:23 -07:00
{% endif %}
</div>
2021-12-12 02:38:10 -08:00
{% endif %}
2021-09-12 02:39:09 -07:00
{% endfor %}
{% else %}
2021-12-12 02:38:10 -08:00
<div class="row needborder">{{periods[c-1]}}:
{{schedule[periods[c-1]]['teacher']}}: {{i}}: No
2021-10-05 04:22:23 -07:00
Signature
2021-09-12 02:39:09 -07:00
</div>
<div class="row"></div>
{% endif %}
{% else %}
2021-12-12 02:38:10 -08:00
<div class="row needborder">{{periods[c-1]}}: {{schedule[periods[c-1]]['subject']}}:
{{schedule[periods[c-1]]['teacher']}}
</div>
2021-12-12 02:38:10 -08:00
{% if periods[c-1] in submission %}
<div class="row"><img src="{{submission[periods[c-1]]['signature']}}" alt=""><br>備註:
{{submission[periods[c-1]]['notes']}}</div>
{% endif %}
2021-09-12 02:39:09 -07:00
{% endif %}
{% endif %}
</div>
2021-09-14 02:49:16 -07:00
{% if c % 4 == 3 %}
</div>
{% endif %}
{% endfor %}
</div>
2021-12-26 05:08:50 -08:00
{% include 'footer.html' %}
</div>
<script src="https://cdn.jsdelivr.net/npm/signature_pad@2.3.2/dist/signature_pad.min.js"></script>
2021-10-28 03:51:44 -07:00
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
2021-10-19 07:30:49 -07:00
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"></script>
<script>
2021-09-12 06:59:31 -07:00
var periodData = {}
{% for i in periods %}
2021-12-12 02:38:10 -08:00
periodData['{{i}}'] = '{{ schedule[i]['subject'] }}'
2021-09-12 06:59:31 -07:00
{% endfor %}
</script>
2021-10-19 07:30:49 -07:00
<script src="/static/pagejs/homeroom.js"></script>
2021-09-18 07:04:31 -07:00
<script src="/static/time.js"></script>
</body>
</html>