huge update
This commit is contained in:
123 files changed
+25119
-4984
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,83 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Institute Feedback{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="mb-0">Provide Institute Feedback</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="{{ form.feedback_type.id_for_label }}" class="form-label">Feedback Type</label>
|
||||
{{ form.feedback_type }}
|
||||
{% if form.feedback_type.errors %}
|
||||
<div class="invalid-feedback d-block">
|
||||
{{ form.feedback_type.errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="{{ form.rating.id_for_label }}" class="form-label">Rating</label>
|
||||
{{ form.rating }}
|
||||
{% if form.rating.errors %}
|
||||
<div class="invalid-feedback d-block">
|
||||
{{ form.rating.errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="{{ form.feedback_text.id_for_label }}" class="form-label">Feedback</label>
|
||||
{{ form.feedback_text }}
|
||||
{% if form.feedback_text.errors %}
|
||||
<div class="invalid-feedback d-block">
|
||||
{{ form.feedback_text.errors }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="mb-3 form-check">
|
||||
{{ form.is_anonymous }}
|
||||
<label class="form-check-label" for="{{ form.is_anonymous.id_for_label }}">
|
||||
Submit Anonymously
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mb-3 form-check">
|
||||
{{ form.is_public }}
|
||||
<label class="form-check-label" for="{{ form.is_public.id_for_label }}">
|
||||
Make Public
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2">
|
||||
<button type="submit" class="btn btn-primary">Submit Feedback</button>
|
||||
<a href="{% url 'parent_dashboard' %}" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_css %}
|
||||
<style>
|
||||
.form-control, .form-select {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
.invalid-feedback {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,12 @@
|
||||
<!-- Cancellation Reason Modal -->
|
||||
<div id="cancellationReasonModal" 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) closeCancellationReasonModal();">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 600px; 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;">Cancellation Reason</h5>
|
||||
<button style="background: none; border: none; color: white; font-size: 24px; cursor: pointer; line-height: 24px;" onclick="closeCancellationReasonModal()">×</button>
|
||||
</div>
|
||||
<div style="padding: 20px;">
|
||||
<div id="cancellationReasonContent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,245 @@
|
||||
<!-- Parent Feedback Modal -->
|
||||
<div id="parentFeedbackModal" 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) closeParentFeedbackModal();">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 600px; 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;">Give Feedback</h5>
|
||||
<button style="background: none; border: none; color: white; font-size: 24px; cursor: pointer; line-height: 24px;" onclick="closeParentFeedbackModal()">×</button>
|
||||
</div>
|
||||
<div style="padding: 20px;">
|
||||
<!-- Custom Tab Navigation -->
|
||||
<div class="feedback-tabs">
|
||||
<div id="parent-teacher-tab-btn" class="feedback-tab-btn active" onclick="switchParentFeedbackTab('teacher')">
|
||||
Teacher Feedback
|
||||
</div>
|
||||
<div id="parent-institute-tab-btn" class="feedback-tab-btn" onclick="switchParentFeedbackTab('institute')">
|
||||
Institute Feedback
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab Content -->
|
||||
<div class="tab-content">
|
||||
<!-- Teacher Feedback Form -->
|
||||
<div id="parent-teacher-tab-content" class="tab-pane active">
|
||||
<form method="post" action="{% url 'submit_feedback' %}" id="parentTeacherFeedbackForm">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="feedback_type" value="teacher">
|
||||
<div class="mb-3">
|
||||
<label for="parent_teacher_select" class="form-label">Select Teacher</label>
|
||||
<select class="form-select" id="parent_teacher_select" name="teacher_id" required style="border-color: #BDBDBD;">
|
||||
<option value="">Select Teacher</option>
|
||||
{% for teacher in teachers %}
|
||||
<option value="{{ teacher.id }}">{{ teacher.name }} - {{ teacher.designation }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="parent_student_select" class="form-label">Select Student</label>
|
||||
<select class="form-select" id="parent_student_select" name="student_id" required style="border-color: #BDBDBD;">
|
||||
<option value="">Select Student</option>
|
||||
{% for student in parent.students.all %}
|
||||
<option value="{{ student.id }}">{{ student.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Rating</label>
|
||||
<div class="rating-stars d-flex">
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="1" onclick="selectParentRating(this, 'parent_teacher_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="2" onclick="selectParentRating(this, 'parent_teacher_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="3" onclick="selectParentRating(this, 'parent_teacher_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="4" onclick="selectParentRating(this, 'parent_teacher_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="5" onclick="selectParentRating(this, 'parent_teacher_rating')"></i>
|
||||
<input type="hidden" name="rating" id="parent_teacher_rating" value="" required>
|
||||
<div class="invalid-feedback d-block" id="parent-teacher-rating-error" style="display: none;">Please select a rating</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="parent_teacher_feedback" class="form-label">Your Feedback</label>
|
||||
<textarea class="form-control" id="parent_teacher_feedback" name="feedback_text" rows="3" required style="border-color: #BDBDBD;"></textarea>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<button type="button" class="btn" style="background-color: #9E9E9E; color: white;" onclick="closeParentFeedbackModal()">Cancel</button>
|
||||
<button type="submit" class="btn" style="background-color: #3F51B5; color: white;">Submit Feedback</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Institute Feedback Form -->
|
||||
<div id="parent-institute-tab-content" class="tab-pane">
|
||||
<form method="post" action="{% url 'submit_institute_feedback' %}" id="parentInstituteFeedbackForm">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="feedback_type" value="institute">
|
||||
<div class="mb-3">
|
||||
<label for="parent_feedback_type_select" class="form-label">Feedback Category</label>
|
||||
<select class="form-select" id="parent_feedback_type_select" name="feedback_type" required style="border-color: #BDBDBD;">
|
||||
<option value="">Select Category</option>
|
||||
<option value="General">General</option>
|
||||
<option value="Facilities">Facilities</option>
|
||||
<option value="Teaching">Teaching Quality</option>
|
||||
<option value="Infrastructure">Infrastructure</option>
|
||||
<option value="Administration">Administration</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="parent_institute_student_select" class="form-label">Select Student</label>
|
||||
<select class="form-select" id="parent_institute_student_select" name="student_id" required style="border-color: #BDBDBD;">
|
||||
<option value="">Select Student</option>
|
||||
{% for student in parent.students.all %}
|
||||
<option value="{{ student.id }}">{{ student.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Rating</label>
|
||||
<div class="rating-stars d-flex">
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="1" onclick="selectParentRating(this, 'parent_institute_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="2" onclick="selectParentRating(this, 'parent_institute_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="3" onclick="selectParentRating(this, 'parent_institute_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="4" onclick="selectParentRating(this, 'parent_institute_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="5" onclick="selectParentRating(this, 'parent_institute_rating')"></i>
|
||||
<input type="hidden" name="rating" id="parent_institute_rating" value="" required>
|
||||
<div class="invalid-feedback d-block" id="parent-institute-rating-error" style="display: none;">Please select a rating</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="parent_institute_feedback" class="form-label">Your Feedback</label>
|
||||
<textarea class="form-control" id="parent_institute_feedback" name="feedback_text" rows="3" required placeholder="Please provide your feedback about the institute" style="border-color: #BDBDBD;"></textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="is_anonymous" id="parent_isAnonymous" style="border-color: #BDBDBD;">
|
||||
<label class="form-check-label" for="parent_isAnonymous">
|
||||
Submit anonymously
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<button type="button" class="btn" style="background-color: #9E9E9E; color: white;" onclick="closeParentFeedbackModal()">Cancel</button>
|
||||
<button type="submit" class="btn" style="background-color: #3F51B5; color: white;">Submit Feedback</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Parent Feedback Modal Scripts -->
|
||||
<script>
|
||||
function openParentFeedbackModal() {
|
||||
document.getElementById('parentFeedbackModal').style.display = 'block';
|
||||
document.body.style.overflow = 'hidden';
|
||||
}
|
||||
|
||||
function closeParentFeedbackModal() {
|
||||
document.getElementById('parentFeedbackModal').style.display = 'none';
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
|
||||
function switchParentFeedbackTab(tabName) {
|
||||
const teacherTabBtn = document.getElementById('parent-teacher-tab-btn');
|
||||
const instituteTabBtn = document.getElementById('parent-institute-tab-btn');
|
||||
const teacherContent = document.getElementById('parent-teacher-tab-content');
|
||||
const instituteContent = document.getElementById('parent-institute-tab-content');
|
||||
|
||||
teacherTabBtn.classList.remove('active');
|
||||
instituteTabBtn.classList.remove('active');
|
||||
teacherContent.classList.remove('active');
|
||||
instituteContent.classList.remove('active');
|
||||
|
||||
if (tabName === 'teacher') {
|
||||
teacherTabBtn.classList.add('active');
|
||||
teacherContent.classList.add('active');
|
||||
} else if (tabName === 'institute') {
|
||||
instituteTabBtn.classList.add('active');
|
||||
instituteContent.classList.add('active');
|
||||
}
|
||||
}
|
||||
|
||||
function selectParentRating(star, inputId) {
|
||||
const value = parseInt(star.getAttribute('data-value'));
|
||||
document.getElementById(inputId).value = value;
|
||||
|
||||
// Update star display
|
||||
const allStars = star.parentNode.querySelectorAll('.rating-star');
|
||||
allStars.forEach(s => {
|
||||
const starValue = parseInt(s.getAttribute('data-value'));
|
||||
if (starValue <= value) {
|
||||
s.classList.remove('far');
|
||||
s.classList.add('fas');
|
||||
s.classList.add('selected');
|
||||
} else {
|
||||
s.classList.remove('fas');
|
||||
s.classList.add('far');
|
||||
s.classList.remove('selected');
|
||||
}
|
||||
});
|
||||
|
||||
// Hide error message if any
|
||||
const errorId = inputId === 'parent_teacher_rating' ? 'parent-teacher-rating-error' : 'parent-institute-rating-error';
|
||||
document.getElementById(errorId).style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Additional Feedback Styles -->
|
||||
<style>
|
||||
.feedback-tabs {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1.5rem;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.feedback-tab-btn {
|
||||
padding: 0.5rem 1rem;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
background: none;
|
||||
color: #6c757d;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.feedback-tab-btn:hover {
|
||||
color: #3F51B5;
|
||||
}
|
||||
|
||||
.feedback-tab-btn.active {
|
||||
color: #3F51B5;
|
||||
border-bottom: 2px solid #3F51B5;
|
||||
}
|
||||
|
||||
.tab-pane {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-pane.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.rating-stars {
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.rating-star {
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.rating-star:hover,
|
||||
.rating-star.selected {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
|
||||
.form-select,
|
||||
.form-control {
|
||||
border-color: #BDBDBD;
|
||||
}
|
||||
|
||||
.form-select:focus,
|
||||
.form-control:focus {
|
||||
border-color: #3F51B5;
|
||||
box-shadow: 0 0 0 0.2rem rgba(63, 81, 181, 0.25);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,12 @@
|
||||
<!-- Meeting Agenda Modal -->
|
||||
<div id="meetingAgendaModal" 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) closeMeetingAgendaModal();">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 600px; 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;">Meeting Agenda</h5>
|
||||
<button style="background: none; border: none; color: white; font-size: 24px; cursor: pointer; line-height: 24px;" onclick="closeMeetingAgendaModal()">×</button>
|
||||
</div>
|
||||
<div style="padding: 20px;">
|
||||
<div id="meetingAgendaContent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
<!-- Meeting Notes Modal -->
|
||||
<div id="meetingNotesModal" 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) closeMeetingNotesModal();">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 600px; 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;">Meeting Notes</h5>
|
||||
<button style="background: none; border: none; color: white; font-size: 24px; cursor: pointer; line-height: 24px;" onclick="closeMeetingNotesModal()">×</button>
|
||||
</div>
|
||||
<div style="padding: 20px;">
|
||||
<div id="meetingNotesContent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,132 @@
|
||||
<!-- Student Details Modal -->
|
||||
<div id="studentDetailsModal" 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) closeStudentDetailsModal();">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 95%; 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;">Student Details</h5>
|
||||
<button style="background: none; border: none; color: white; font-size: 24px; cursor: pointer; line-height: 24px;" onclick="closeStudentDetailsModal()">×</button>
|
||||
</div>
|
||||
<div style="padding: 20px; max-height: 80vh; overflow-y: auto;">
|
||||
<div id="studentDetailsError" class="alert alert-danger" style="display: none;"></div>
|
||||
<div id="studentDetailsLoading" class="text-center" style="display: none;">
|
||||
<div class="spinner-border text-primary" role="status">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
</div>
|
||||
<p class="mt-2">Loading student details...</p>
|
||||
</div>
|
||||
<div id="studentDetailsContent">
|
||||
<div class="row">
|
||||
<!-- Student Basic Info -->
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="card-header bg-light py-2">
|
||||
<h5 class="card-title mb-0"><i class="fas fa-info-circle me-2"></i>Basic Information</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="text-center mb-3">
|
||||
<div id="studentImage" class="mx-auto mb-2" style="width: 80px; height: 80px; border-radius: 50%; overflow: hidden; background: #f0f0f0; display: flex; align-items: center; justify-content: center;">
|
||||
<i class="fas fa-user fa-2x text-secondary"></i>
|
||||
</div>
|
||||
<h5 id="studentName" class="mb-1">Student Name</h5>
|
||||
<p id="studentCourse" class="text-muted mb-0">Course</p>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<p class="text-muted mb-1">ID</p>
|
||||
<p id="studentId" class="mb-3">-</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<p class="text-muted mb-1">Status</p>
|
||||
<p id="studentStatusBadge" class="mb-3">-</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<p class="text-muted mb-1">Current Period</p>
|
||||
<p id="studentPeriod" class="mb-3">-</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<p class="text-muted mb-1">Attendance</p>
|
||||
<p id="studentAttendance" class="mb-3">-</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Student Contact Info -->
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card h-100 border-0 shadow-sm">
|
||||
<div class="card-header bg-light py-2">
|
||||
<h5 class="card-title mb-0"><i class="fas fa-address-book me-2"></i>Contact Information</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<p class="text-muted mb-1">Email</p>
|
||||
<p id="studentEmail" class="mb-3">-</p>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="text-muted mb-1">Phone</p>
|
||||
<p id="studentPhone" class="mb-3">-</p>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<p class="text-muted mb-1">Address</p>
|
||||
<p id="studentAddress" class="mb-3">-</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Course Timeline Information -->
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-header bg-light py-2">
|
||||
<h5 class="card-title mb-0"><i class="fas fa-calendar-alt me-2"></i>Course Timeline</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<p class="text-muted mb-1">Course Name</p>
|
||||
<p id="studentCourseName" class="mb-3">-</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<p class="text-muted mb-1">Course Code</p>
|
||||
<p id="studentCourseCode" class="mb-3">-</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<p class="text-muted mb-1">Course Status</p>
|
||||
<p id="studentCourseStatus" class="mb-3">-</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<p class="text-muted mb-1">Current Period</p>
|
||||
<p id="studentCurrentPeriod" class="mb-3">-</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
<p class="text-muted mb-1">Course Description</p>
|
||||
<p id="studentCourseDescription" class="mb-3">-</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<p class="text-muted mb-1">Current Period End Date</p>
|
||||
<p id="studentPeriodEndDate" class="mb-3">-</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p class="text-muted mb-1">Expected Course Completion</p>
|
||||
<p id="studentCourseEndDate" class="mb-3">-</p>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<p class="text-muted mb-1">Progress</p>
|
||||
<div class="progress mb-3">
|
||||
<div id="studentProgressBar" class="progress-bar" role="progressbar" style="width: 0%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,132 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container py-4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="content-card">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h3 class="mb-0">
|
||||
<i class="fas fa-star me-2"></i> Submit Feedback
|
||||
</h3>
|
||||
<a href="{% url 'parent_dashboard' %}" class="btn btn-outline-secondary">
|
||||
<i class="fas fa-arrow-left me-2"></i> Back to Dashboard
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<form method="post" class="feedback-form">
|
||||
{% csrf_token %}
|
||||
|
||||
<!-- Student Selection -->
|
||||
<div class="mb-3">
|
||||
<label for="student" class="form-label">Select Student</label>
|
||||
<select class="form-select" id="student" name="student" required>
|
||||
<option value="">Choose your child...</option>
|
||||
{% for student in students %}
|
||||
<option value="{{ student.id }}">{{ student.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Teacher Selection -->
|
||||
<div class="mb-3">
|
||||
<label for="teacher" class="form-label">Select Teacher</label>
|
||||
<select class="form-select" id="teacher" name="teacher" required>
|
||||
<option value="">Choose a teacher...</option>
|
||||
{% for teacher in teachers %}
|
||||
<option value="{{ teacher.id }}">{{ teacher.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Rating -->
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Rating</label>
|
||||
<div class="rating-stars d-flex">
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="1" onclick="selectRating(this, 'selected_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="2" onclick="selectRating(this, 'selected_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="3" onclick="selectRating(this, 'selected_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="4" onclick="selectRating(this, 'selected_rating')"></i>
|
||||
<i class="far fa-star fs-4 text-warning rating-star" data-value="5" onclick="selectRating(this, 'selected_rating')"></i>
|
||||
<input type="hidden" name="rating" id="selected_rating" value="" required>
|
||||
<div class="invalid-feedback d-block" id="rating-error" style="display: none;">Please select a rating</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Feedback Text -->
|
||||
<div class="mb-3">
|
||||
<label for="feedback_text" class="form-label">Your Feedback</label>
|
||||
<textarea class="form-control" id="feedback_text" name="feedback_text" rows="4" required></textarea>
|
||||
</div>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="text-end">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fas fa-paper-plane me-1"></i> Submit Feedback
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Rating System JavaScript -->
|
||||
<script>
|
||||
function selectRating(star, inputId) {
|
||||
const value = parseInt(star.getAttribute('data-value'));
|
||||
document.getElementById(inputId).value = value;
|
||||
|
||||
// Update star display
|
||||
const allStars = star.parentNode.querySelectorAll('.rating-star');
|
||||
allStars.forEach(s => {
|
||||
const starValue = parseInt(s.getAttribute('data-value'));
|
||||
if (starValue <= value) {
|
||||
s.classList.remove('far');
|
||||
s.classList.add('fas');
|
||||
s.classList.add('selected');
|
||||
} else {
|
||||
s.classList.remove('fas');
|
||||
s.classList.add('far');
|
||||
s.classList.remove('selected');
|
||||
}
|
||||
});
|
||||
|
||||
// Hide error message
|
||||
document.getElementById('rating-error').style.display = 'none';
|
||||
}
|
||||
|
||||
// Form validation
|
||||
document.querySelector('.feedback-form').addEventListener('submit', function(e) {
|
||||
const ratingInput = document.getElementById('selected_rating');
|
||||
if (!ratingInput.value) {
|
||||
e.preventDefault();
|
||||
document.getElementById('rating-error').style.display = 'block';
|
||||
document.getElementById('rating-error').scrollIntoView({ behavior: 'smooth' });
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Rating System Styles -->
|
||||
<style>
|
||||
.rating-stars {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.rating-star {
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.rating-star:hover,
|
||||
.rating-star.active,
|
||||
.rating-star.selected {
|
||||
color: #FFD700 !important;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
</style>
|
||||
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user