diff --git a/templates/admin/dashboard.html b/templates/admin/dashboard.html index 093e194..9cab112 100644 --- a/templates/admin/dashboard.html +++ b/templates/admin/dashboard.html @@ -3,8 +3,9 @@ {% load app_filters %} {% block extrahead %} {{ block.super }} - + + @@ -33,123 +34,67 @@ }); } }); - - // Add CSRF token to all AJAX requests - function getCookie(name) { - let cookieValue = null; - if (document.cookie && document.cookie !== '') { - const cookies = document.cookie.split(';'); - for (let i = 0; i < cookies.length; i++) { - const cookie = cookies[i].trim(); - if (cookie.substring(0, name.length + 1) === (name + '=')) { - cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); - break; - } - } - } - return cookieValue; - } - - // Set up CSRF token for AJAX requests - const csrftoken = getCookie('csrftoken'); - - // Add CSRF token to all AJAX requests - $(document).ready(function() { - $.ajaxSetup({ - beforeSend: function(xhr, settings) { - if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type) && !this.crossDomain) { - xhr.setRequestHeader("X-CSRFToken", csrftoken); - } - } - }); - }); - - // Update all form submissions to include CSRF token - document.addEventListener('DOMContentLoaded', function() { - // Add CSRF token to fetch requests - window.fetch = new Proxy(window.fetch, { - apply: function(fetch, that, args) { - if (args.length > 0 && typeof args[0] === 'object' && args[0].method !== 'GET') { - if (args[0].headers) { - args[0].headers['X-CSRFToken'] = csrftoken; - } else { - args[0].headers = { 'X-CSRFToken': csrftoken }; - } - } - return fetch.apply(that, args); - } - }); - }); {% endblock %} {% block extrastyle %} {{ block.super }} {% endblock %} @@ -753,21 +468,20 @@

Welcome, Admin!

Student Management Dashboard

- - +
-
+
Students
-
+
Total Students @@ -798,11 +512,11 @@
-
+
Staff
-
+
Total Staff @@ -833,11 +547,11 @@
-
+
Parents
-
+
Total Parents @@ -868,11 +582,11 @@
-
+
Courses
-
+
Total Courses @@ -906,82 +620,78 @@
-
-
- Top Rated Teachers -
-
-
-
- - - - - - - - - - - {% for teacher in teacher_ratings %} - - + + {% empty %} + + + + {% endfor %} + +
TeacherStudent RatingParent RatingTotal Feedbacks
-
- {% if teacher.image %} - {{ teacher.name }} - {% else %} -
- -
- {% endif %} -
-
{{ teacher.name }}
- {{ teacher.designation }} +
+ Top Rated Teachers +
+
+ + + + + + + + + + + {% for teacher in teacher_ratings %} + + + - - - - {% empty %} - - - - {% endfor %} - -
TeacherStudent RatingParent RatingTotal Feedbacks
+
+ {% if teacher.image %} + {{ teacher.name }} + {% else %} +
+
+ {% endif %} +
+
{{ teacher.name }}
+ {{ teacher.designation }} +
+
+
+
+ {{ teacher.avg_student_rating|floatformat:1 }} +
+ {% for i in "12345"|make_list %} + {% if forloop.counter <= teacher.avg_student_rating %} + + {% else %} + + {% endif %} + {% endfor %}
+
-
- {{ teacher.avg_student_rating|floatformat:1 }} -
- {% for i in "12345"|make_list %} - {% if forloop.counter <= teacher.avg_student_rating %} - - {% else %} - - {% endif %} - {% endfor %} -
+
+ {{ teacher.avg_parent_rating|floatformat:1 }} +
+ {% for i in "12345"|make_list %} + {% if forloop.counter <= teacher.avg_parent_rating %} + + {% else %} + + {% endif %} + {% endfor %}
-
-
- {{ teacher.avg_parent_rating|floatformat:1 }} -
- {% for i in "12345"|make_list %} - {% if forloop.counter <= teacher.avg_parent_rating %} - - {% else %} - - {% endif %} - {% endfor %} -
-
-
- {{ teacher.total_feedbacks }} +
- No teacher ratings available -
-
+
+ {{ teacher.total_feedbacks }} +
+ No teacher ratings available +
@@ -991,17 +701,15 @@
-
-
-
- Recent Notices -
- -
+
+
+ Recent Notices +
+
-
+
{% for notice in recent_notices %}
@@ -1120,17 +828,14 @@
- +
-
-
-
-
- Recent Institute Feedback -
-
-
+
+
+ Recent Institute Feedback +
+
{% for feedback in recent_feedback %}
@@ -1171,7 +876,7 @@ {% if feedback.student %} {{ feedback.student.name }} (Student) - {{ feedback.student.course.name }} - + {{ feedback.student.course.name }} - {% if feedback.student.course.duration_type == 'Semester' %} Semester {{ feedback.student.current_period }} {% else %} @@ -1185,7 +890,7 @@ {% with student=feedback.parent.students.first %} {% if student %} - Parent of {{ student.name }} - + Parent of {{ student.name }} - {{ student.course.name }} {% if student.course.duration_type == 'Semester' %} (Semester {{ student.current_period }}) @@ -1221,24 +926,24 @@
+
+
- -
+ +
+
-
-
+
Parent-Teacher Meetings -
- -
-
-
-
+
+
- + @@ -1256,61 +961,47 @@ {% empty %} @@ -1322,12 +1013,10 @@ {% endfor %}
Date Time{{ meeting.duration }} minutes {% if meeting.is_online %} - - Online - {% if meeting.meeting_link %} - - - {% endif %} - + Online + {% if meeting.meeting_link %} + + + {% endif %} {% else %} - - In-person - + In-person {% endif %} - - {% if meeting.status == 'scheduled' %} - Scheduled - {% elif meeting.status == 'completed' %} - Completed - {% elif meeting.status == 'cancelled' %} - Cancelled - {% else %} - Rescheduled - {% endif %} + + {{ meeting.get_status_display }} -
- {% if meeting.status == 'scheduled' %} - - - - {% endif %} - {% if meeting.notes or meeting.status == 'completed' %} - - {% endif %} - {% if meeting.agenda %} - - {% endif %} - {% if meeting.status == 'cancelled' and meeting.cancellation_reason %} - - {% endif %} -
+ {% if meeting.status == 'scheduled' %} + + + + {% endif %} + {% if meeting.notes or meeting.status == 'completed' %} + + {% endif %} + {% if meeting.agenda %} + + {% endif %} + {% if meeting.status == 'cancelled' and meeting.cancellation_reason %} + + {% endif %}
-
-
-
-
-
-
+
+
+
+

Scheduling meeting...

-
+
{% csrf_token %}
Please select a valid date
-
+
Please select a valid time
-
+
Duration must be between 15 and 120 minutes
-
+
-
+
+
-
+
-
+
+

Loading notes...

+
-
-
-
+
+
+

Loading agenda...

-
+

Cancelling meeting...

-
+
{% csrf_token %} @@ -1451,15 +1140,15 @@
Please provide a reason for cancellation
-
+
-
+
-
-
-
+
+
+

Rescheduling meeting...

-
+
{% csrf_token %} @@ -1483,16 +1172,16 @@
Please select a valid date
-
+
Please select a valid time
-
+
-
+
@@ -1526,8 +1215,8 @@ - - + +