Attendance/templates/group_teach.html

250 lines
16 KiB
HTML
Raw Normal View History

2021-09-09 06:29:31 -07:00
<!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>
2021-09-09 06:29:31 -07:00
<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" />
2021-10-19 07:30:49 -07:00
<link rel="stylesheet" href="/static/allpages.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>
2021-09-09 06:29:31 -07:00
</head>
<body>
2021-09-26 06:37:34 -07:00
<div class="showTime"><span id="showTime"></span></div>
<div class="container">
2021-09-18 04:26:06 -07:00
<h1 class="margin-top">Group Class View | 分組課頁面</h1>
<h2>[{{currDate}}]</h2>
<a href="/logout"><button class="btn btn-primary margin-top logout">Logout 登出</button></a>
2021-10-03 07:33:53 -07:00
<a href="/select"><button class="btn btn-primary margin-top logout">Choose Subuser 選擇其他帳號</button></a>
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>
2021-12-12 02:38:10 -08:00
{% for c in data %}
{% for p in data[c] %}
{% if p == 'cdata' %}
{% continue %}
{% endif %}
<h3 class="nmb margin-top">Period {{p}}: {{data[c]['cdata']['name']}}</h3>
<form action="/manage/group_teach_publish" id="attendanceData^{{p}}" method="post">
<input type="hidden" name="date" value="{{currDate}}">
2021-12-12 02:38:10 -08:00
<input type="hidden" name="period" value="{{p}}">
2021-09-12 02:39:09 -07:00
<input type="hidden" class="signatureData" name="signatureData" value="">
2021-12-12 02:38:10 -08:00
<input type="hidden" name="category" value="{{data[c]['cdata']['category']}}">
<input type="hidden" name="class_id" value="{{data[c]['cdata']['class_id']}}">
2021-12-26 05:08:50 -08:00
<input type="hidden" name="submissionType" class="submissionType" value="">
2021-12-12 02:38:10 -08:00
<div class="col" style="margin-top: 5px;">
<div class="row title sticky-top" style="background-color: white">
2021-09-18 07:04:31 -07:00
<div class="col">Grade 年級</div>
<div class="col">Number 座號</div>
<div class="col">Name 姓名</div>
<div class="col">English Name 英文名</div>
2021-12-12 02:38:10 -08:00
<div class="col">Period {{p}} | 第 {{p}} 節</div>
</div>
2021-12-12 02:38:10 -08:00
{% set need_fill = namespace(found=false) %}
2021-12-26 05:08:50 -08:00
{% set need_ds = namespace(found=false) %}
2021-12-12 02:38:10 -08:00
{% if data[c] != None %}
{% for grade in data[c][p] %}
{% for student in data[c][p][grade] %}
<div class="row">
<div class="col">{{grade}}</div>
<div class="col">{{ student }}</div>
2021-12-12 02:38:10 -08:00
<div class="col">{{ data[c][p][grade][student]['name'] }}</div>
<div class="col">{{ data[c][p][grade][student]['ename'] }}</div>
{% if data[c][p][grade][student]['status'] == 'L' %}
2021-09-12 02:39:09 -07:00
<div class="col">
2021-12-12 02:38:10 -08:00
<p class="highlightAbs n-3">𝜑 <span style="color:black">{{data[c][p][grade][student]['note']}}</span></p>
2021-09-12 02:39:09 -07:00
</div>
2021-12-12 02:38:10 -08:00
{% elif data[c][p][grade][student]['status'] == 'K' %}
<div class="col">
2021-12-12 02:38:10 -08:00
<p class="highlightAbs n-2"><span style="color:black">{{data[c][p][grade][student]['note']}}</span></p>
</div>
2021-12-12 02:38:10 -08:00
{% elif data[c][p][grade][student]['status'] == 'G' %}
2021-09-12 02:39:09 -07:00
<div class="col">
2021-12-12 02:38:10 -08:00
<p class="highlightAbs n-2"><span style="color:black">{{data[c][p][grade][student]['note']}}</span></p>
2021-09-12 02:39:09 -07:00
</div>
2021-12-12 02:38:10 -08:00
{% elif data[c][p][grade][student]['status'] == 'S' %}
<div class="col">
<p class="highlightAbs n-2"><span style="color:black">{{data[c][p][grade][student]['note']}}</span></p>
</div>
{% elif data[c][p][grade][student]['status'] == 'F' %}
<div class="col">
<p class="highlightAbs n-2"><span style="color:black">{{data[c][p][grade][student]['note']}}</span></p>
</div>
{% elif data[c][p][grade][student]['status'] == 'P' %}
<div class="col">
<p class="highlightAbs n-2"><span style="color:black">{{data[c][p][grade][student]['note']}}</span></p>
</div>
{% elif data[c][p][grade][student]['status'] == 'O' %}
<div class="col">
<p class="highlightAbs n-2"><span style="color:black">{{data[c][p][grade][student]['note']}}</span></p>
</div>
{% elif data[c][p][grade][student]['status'] == '--' %}
2021-09-12 02:39:09 -07:00
<div class="col">
<p class="highlightAbs">--</p>
2021-12-12 02:38:10 -08:00
</div>
{% elif data[c][p][grade][student]['status'] == 'present' %}
<div class="col">
<p class="highlightAbs n-1">V</p>
</div>
{% else %}
<div id="input^{{p}}^{{grade}}^{{student}}" class="col">
{% set need_fill.found = true %}
<input type="checkbox" class="tobeform {{grade}}^{{student}} late"
id="late^{{p}}^{{grade}}^{{student}}"
name="2^{{grade}}^{{student}}"
onchange="unCheckAbs('{{p}}^{{grade}}^{{student}}')">
<input type="checkbox" class="tobeform {{grade}}^{{student}} absent"
id="absent^{{p}}^{{grade}}^{{student}}"
name="1^{{grade}}^{{student}}"
onchange="unCheckLate('{{p}}^{{grade}}^{{student}}')">
2021-09-12 02:39:09 -07:00
</div>
{% endif %}
2021-12-26 05:08:50 -08:00
{% if data[c][p][grade][student]['needDS'] == True %}
{% set need_ds.found = true %}
{% endif %}
</div>
{% endfor %}
{% endfor %}
{% endif %}
2021-12-26 05:08:50 -08:00
{% if need_fill.found %}
2021-09-12 02:39:09 -07:00
<button class="btn btn-primary margin-bottom viewSignatureBtn" type="button"
2021-12-12 02:38:10 -08:00
onclick="viewSignature('{{p}}')">
↑ Confirm 確認 (Period {{p}}) ↑</button>
2021-12-26 05:08:50 -08:00
{% elif need_ds.found %}
<button class="btn btn-warning margin-bottom viewSignatureBtn" type="button"
onclick="signDS('{{p}}')">
↑ Confirm DS 定心專案 (Period {{p}}) ↑</button>
{% else %}
<button class="btn btn-primary margin-bottom viewSignatureBtn" type="button"
onclick="viewSignature('{{p}}')" disabled="disabled">
Already Submitted</button>
2021-09-12 02:39:09 -07:00
{% endif %}
2021-12-12 02:38:10 -08:00
<div id="sign-{{p}}" class="signDiv modal fade" id="staticBackdrop" data-bs-backdrop="static"
2021-10-19 07:30:49 -07:00
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">
2021-12-12 02:38:10 -08:00
<div class="alert alert-warning margin-top" id="allPresentWarning-{{p}}" role="alert"
2021-10-19 07:30:49 -07:00
hidden="hidden">
<h4 class="alert-heading">請確認是否全班全到Please check if everyone is present!</h4>
</div>
2021-12-12 02:38:10 -08:00
<div class="forSign"><canvas id="signature_pad^{{p}}"></canvas></div>
2021-10-19 07:30:49 -07:00
<h3 class="margin-top">Notes 備註欄</h3>
2021-12-12 02:38:10 -08:00
<input type="textarea" class="form-control" name="notes" id="subjectNotes^{{p}}"
2021-10-19 07:30:49 -07:00
placeholder="Enter Notes 請輸入備註" style="width: 80%; margin-left: 10%;" row="3">
2021-12-12 02:38:10 -08:00
<style>
#indds div {
padding-left: 0;
}
#indds button {
margin-top: 0;
}
</style>
2021-12-26 05:08:50 -08:00
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" onclick="signaturePad.clear()">Clear
Signature 清除簽名</button>
<button type="button" class="btn btn-danger" onclick="location.reload();">Cancel
取消</button>
<button type="button" class="btn btn-primary submitButton" onclick="submitForm()">Submit
提交</button>
</div>
</div>
</div>
</div>
<div id="ds-{{p}}" class="signDiv 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-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">
2021-12-26 05:08:50 -08:00
{% 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 %}
2021-12-12 02:38:10 -08:00
<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 grade in data[c][p] %}
{% for i in data[c][p][grade] %}
2021-12-26 05:08:50 -08:00
{% if data[c][p][grade][i]['needDS'] == True %}
2021-12-12 02:38:10 -08:00
<option value="{{grade}}-{{i}}-{{data[c][p][grade][i]['name']}}-{{data[c][p][grade][i]['ename']}}">{{grade}}-{{i}}-{{data[c][p][grade][i]['name']}}-{{data[c][p][grade][i]['ename']}}</option>
{% endif %}
{% endfor %}
{% 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>
2021-12-26 05:08:50 -08:00
<div class="col noborder"><button type="button" class="btn btn-secondary nomargin-top" onclick="addDS()"><i class="fas fa-plus"></i></button></div>
2021-12-12 02:38:10 -08:00
</div>
2021-12-26 05:08:50 -08:00
<div id="inddsview" class="margin-top" style="width: 90%; margin-left: 5%;"><div class="col"></div></div>
2021-12-12 02:38:10 -08:00
</div>
2021-12-26 05:08:50 -08:00
<h3 class="margin-top">Notes 備註欄</h3>
<input type="textarea" class="form-control" name="notes" id="dsNotesEnter"
placeholder="Enter Notes 請輸入備註" style="width: 80%; margin-left: 10%;" row="3">
2021-10-19 07:30:49 -07:00
</div>
<div class="modal-footer">
2021-12-26 05:08:50 -08:00
<button type="button" class="btn btn-danger" onclick="location.reload();">Cancel 取消</button>
<button type="button" class="btn btn-primary" onclick="submitDSForm()">Submit 提交</button>
2021-10-19 07:30:49 -07:00
</div>
</div>
</div>
2021-09-12 02:39:09 -07:00
</div>
</div>
</form>
2021-09-12 02:39:09 -07:00
{% endfor %}
2021-12-12 02:38:10 -08:00
{% endfor %}
</div>
2021-09-12 02:39:09 -07:00
<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>
2021-09-24 22:31:36 -07:00
{% include 'footer.html' %}
2021-10-19 07:30:49 -07:00
<script src="/static/pagejs/group_teach.js"></script>
2021-09-18 07:04:31 -07:00
<script src="/static/time.js"></script>
2021-09-09 06:29:31 -07:00
</body>
</html>