huge updates

This commit is contained in:
sankalp committed 2025-04-22 03:47:31 +05:45
1 parent b5a43ac0ad
commit 6cc74a355f
40 files changed
+6878 -2378

No files matched your search

+94 -54
View File
@@ -1,61 +1,101 @@
<!-- Attendance Modal -->
<div id="attendanceModal" style="display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.5); z-index: 10000;" onclick="if(event.target === this) closeAttendanceModal();">
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 800px; background-color: white; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.2);">
<div style="background-color: #3F51B5; color: white; padding: 15px; border-top-left-radius: 8px; border-top-right-radius: 8px; display: flex; justify-content: space-between; align-items: center;">
<h5 style="margin: 0; font-size: 18px;">Take Attendance</h5>
<button style="background: none; border: none; color: white; font-size: 24px; cursor: pointer; line-height: 24px;" onclick="closeAttendanceModal()">&times;</button>
</div>
<div style="padding: 20px; max-height: 80vh; overflow-y: auto;">
<form method="post" action="/app/save-attendance/" id="quickAttendanceForm">
{% csrf_token %}
<input type="hidden" name="routine_id" id="modalRoutineId">
<input type="hidden" name="date" id="modalDate">
<div class="row mb-3">
<div class="col-md-6">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="modalTeacherAttend" name="teacher_attend">
<label class="form-check-label" for="modalTeacherAttend">Teacher Present</label>
<div class="modal fade" id="attendanceModal" tabindex="-1" aria-labelledby="attendanceModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title" id="attendanceModalLabel">
<i class="fas fa-clipboard-check me-2"></i>Take Attendance
</h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="attendanceForm">
<input type="hidden" name="routine_id" id="routineId">
<div class="mb-4">
<h6 class="mb-3">Class Information</h6>
<div class="row">
<div class="col-md-6">
<p class="mb-1"><strong>Subject:</strong> <span id="subjectName"></span></p>
<p class="mb-1"><strong>Course:</strong> <span id="courseName"></span></p>
</div>
<div class="col-md-6">
<p class="mb-1"><strong>Time:</strong> <span id="classTime"></span></p>
<p class="mb-1"><strong>Date:</strong> <span id="classDate"></span></p>
</div>
</div>
</div>
<div class="col-md-6">
<select class="form-select" id="modalClassStatus" name="class_status">
<option value="True" selected>Conducted</option>
<option value="False">Not Conducted</option>
</select>
</div>
</div>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th width="5%">#</th>
<th width="40%">Name</th>
<th width="40%">Student ID</th>
<th width="15%">Present</th>
</tr>
</thead>
<tbody id="modalStudentList">
<!-- Students will be loaded here -->
</tbody>
</table>
</div>
<div class="mt-3 d-flex justify-content-between">
<div>
<button type="button" class="btn btn-outline-success me-2" onclick="markAllPresent()">
<i class="fas fa-check-double me-1"></i> Mark All Present
</button>
<button type="button" class="btn btn-outline-danger" onclick="markAllAbsent()">
<i class="fas fa-times-circle me-1"></i> Mark All Absent
</button>
<div class="mb-4">
<h6 class="mb-3">Students List</h6>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>Student ID</th>
<th>Name</th>
<th>Status</th>
<th>Remarks</th>
</tr>
</thead>
<tbody id="studentsList">
<!-- Students will be populated here -->
</tbody>
</table>
</div>
</div>
<button type="submit" class="btn btn-primary">
<i class="fas fa-save me-1"></i> Save Attendance
</button>
</div>
</form>
<div class="mb-3">
<label for="remarks" class="form-label">General Remarks</label>
<textarea class="form-control" id="remarks" name="remarks" rows="2" placeholder="Add any general remarks about the class"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
<i class="fas fa-times me-2"></i>Cancel
</button>
<button type="button" class="btn btn-primary" id="saveAttendance">
<i class="fas fa-save me-2"></i>Save Attendance
</button>
</div>
</div>
</div>
</div>
</div>
<style>
#attendanceModal .modal-content {
border: none;
box-shadow: var(--shadow-lg);
}
#attendanceModal .modal-header {
border-bottom: none;
}
#attendanceModal .modal-body {
padding: 1.5rem;
}
#attendanceModal .table th {
background-color: var(--light);
font-weight: 600;
}
#attendanceModal .table td {
vertical-align: middle;
}
#attendanceModal .btn {
padding: 0.5rem 1rem;
font-weight: 500;
}
#attendanceModal .form-control {
border-radius: var(--border-radius-md);
}
#attendanceModal .form-control:focus {
border-color: var(--primary);
box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}
</style>