Files
Super-HomeworkManager/web/templates/assignments/edit.html

93 lines
5.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{template "base" .}}
{{define "content"}}
<div class="row justify-content-center">
<div class="col-lg-6">
<div class="card shadow">
<div class="card-header">
<h5 class="mb-0"><i class="bi bi-pencil me-2"></i>課題編集</h5>
</div>
<div class="card-body">
{{if .error}}<div class="alert alert-danger">{{.error}}</div>{{end}}
<form method="POST" action="/assignments/{{.assignment.ID}}">
{{.csrfField}}
<div class="mb-3">
<label for="title" class="form-label">タイトル <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="title" name="title" value="{{.assignment.Title}}"
required>
</div>
<div class="mb-3">
<label for="subject" class="form-label">科目</label>
<input type="text" class="form-control" id="subject" name="subject"
value="{{.assignment.Subject}}">
</div>
<div class="mb-3">
<label for="priority" class="form-label">重要度</label>
<select class="form-select" id="priority" name="priority">
<option value="low" {{if eq .assignment.Priority "low" }}selected{{end}}></option>
<option value="medium" {{if eq .assignment.Priority "medium" }}selected{{end}}></option>
<option value="high" {{if eq .assignment.Priority "high" }}selected{{end}}></option>
</select>
</div>
<div class="mb-3">
<label for="due_date" class="form-label">提出期限 <span class="text-danger">*</span></label>
<input type="datetime-local" class="form-control" id="due_date" name="due_date"
value="{{formatDateInput .assignment.DueDate}}" required>
</div>
<div class="mb-3">
<label for="description" class="form-label">説明</label>
<textarea class="form-control" id="description" name="description"
rows="3">{{.assignment.Description}}</textarea>
</div>
<!-- 通知設定 -->
<div class="card bg-light mb-3">
<div class="card-body py-2">
<h6 class="mb-2"><i class="bi bi-bell me-1"></i>通知設定</h6>
<!-- 督促通知 -->
<div class="form-check form-switch mb-2">
<input class="form-check-input" type="checkbox" id="urgent_reminder_enabled"
name="urgent_reminder_enabled" {{if
.assignment.UrgentReminderEnabled}}checked{{end}}>
<label class="form-check-label" for="urgent_reminder_enabled">
督促通知期限3時間前から繰り返し通知
</label>
</div>
<div class="form-text small mb-2">
重要度により間隔が変わります:大=10分、中=30分、小=1時間
</div>
<hr class="my-2">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="reminder_enabled"
name="reminder_enabled" {{if .assignment.ReminderEnabled}}checked{{end}}
onchange="toggleReminderDate(this)">
<label class="form-check-label" for="reminder_enabled">
リマインダー(指定日時に通知)
</label>
</div>
<div class="mt-2" id="reminder_at_group"
style="display: {{if .assignment.ReminderEnabled}}block{{else}}none{{end}};">
<label for="reminder_at" class="form-label small">通知日時</label>
<input type="datetime-local" class="form-control form-control-sm" id="reminder_at"
name="reminder_at"
value="{{if .assignment.ReminderAt}}{{formatDateInput .assignment.ReminderAt}}{{end}}">
{{if .assignment.ReminderSent}}
<div class="text-success small mt-1"><i class="bi bi-check-circle me-1"></i>通知送信済み</div>
{{end}}
</div>
</div>
</div>
<div class="d-flex gap-2">
<button type="submit" class="btn btn-primary"><i class="bi bi-check-lg me-1"></i>更新</button>
<a href="/assignments" class="btn btn-outline-secondary">キャンセル</a>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
function toggleReminderDate(checkbox) {
document.getElementById('reminder_at_group').style.display = checkbox.checked ? 'block' : 'none';
}
</script>
{{end}}