From a2f654e56e87a67142f6cf07c184b919f4cab45f Mon Sep 17 00:00:00 2001 From: Shreyansh Mojidra Date: Sat, 21 Feb 2026 21:04:20 +0000 Subject: [PATCH 1/4] fixed dark/light mode for user list --- web/templates/users_list.html | 44 +++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/web/templates/users_list.html b/web/templates/users_list.html index dbdac3dd1..431f00512 100644 --- a/web/templates/users_list.html +++ b/web/templates/users_list.html @@ -6,19 +6,19 @@ {% block content %}
-

User List

+

User List

{% if page_obj %}
{% for profile in page_obj %} -

{{ profile.user.username }}

- + class="text-xl font-semibold text-gray-800 dark:text-white mb-2">{{ profile.user.username }} + {% if profile.is_teacher %} Teacher {% else %} @@ -26,29 +26,31 @@

User List

{% endif %}
-

Joined: {{ profile.user.date_joined|date:"F d, Y" }}

+

Joined: {{ profile.user.date_joined|date:"F d, Y" }}

{% if profile.is_teacher %}
-

Courses: {{ profile.total_courses }}

-

Students: {{ profile.total_students }}

- {% if profile.avg_rating > 0 %}

Rating: {{ profile.avg_rating }}/5

{% endif %} +

Courses: {{ profile.total_courses }}

+

Students: {{ profile.total_students }}

+ {% if profile.avg_rating > 0 %} +

Rating: {{ profile.avg_rating }}/5

+ {% endif %}
{% else %}
-

Enrolled: {{ profile.total_courses }}

-

Completed: {{ profile.total_completed }}

-

Avg. Progress: {{ profile.avg_progress }}%

-

Achievements: {{ profile.achievements_count }}

+

Enrolled: {{ profile.total_courses }}

+

Completed: {{ profile.total_completed }}

+

Avg. Progress: {{ profile.avg_progress }}%

+

Achievements: {{ profile.achievements_count }}

{% endif %}
{% if profile.user.groups.exists %} - {{ profile.user.groups.count }} group{{ profile.user.groups.count|pluralize }} + {{ profile.user.groups.count }} group{{ profile.user.groups.count|pluralize }} {% else %} - 0 groups + 0 groups {% endif %} View Profile + class="text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 font-medium">View Profile
@@ -59,21 +61,23 @@

User List

{% else %}
-

No public profiles found

-

Users need to set their profiles to public to appear in this list.

+

No public profiles found

+

+ Users need to set their profiles to public to appear in this list. +

{% endif %}
From bc3289d93e5d6799a49e81f059abac6306b02d02 Mon Sep 17 00:00:00 2001 From: Shreyansh Mojidra Date: Mon, 23 Feb 2026 18:08:44 +0000 Subject: [PATCH 2/4] New UI for Navbar --- web/templates/base.html | 807 ++++++++++++++++++++++------------------ 1 file changed, 437 insertions(+), 370 deletions(-) diff --git a/web/templates/base.html b/web/templates/base.html index 121663855..0d0edb7d3 100644 --- a/web/templates/base.html +++ b/web/templates/base.html @@ -69,20 +69,38 @@ function updateDarkModeIcon() { const isDark = document.documentElement.classList.contains('dark'); const icon = document.getElementById('darkModeIcon'); + const label = document.getElementById('darkModeLabel'); log(`Updating icon. Dark mode is: ${isDark}`); if (icon) { - icon.className = isDark ? 'fas fa-sun' : 'fas fa-moon'; + icon.className = 'fas w-5 text-teal-500 ' + (isDark ? 'fa-sun' : 'fa-moon'); icon.title = isDark ? 'Switch to Light Mode' : 'Switch to Dark Mode'; log('Icon updated successfully'); - } else { - log('Warning: Dark mode icon element not found'); + } + if (label) { + label.textContent = isDark ? 'Light mode' : 'Dark mode'; } } // Initialize dark mode immediately and after DOM content loads initializeDarkMode(); document.addEventListener('DOMContentLoaded', initializeDarkMode); + + // Navbar scroll effect: backdrop blur + shadow on scroll + function updateNavbarOnScroll() { + const header = document.getElementById('main-header'); + if (!header) return; + const scrollClasses = ['bg-teal-600/95', 'dark:bg-teal-800/95', 'backdrop-blur-md', 'shadow-lg']; + if (window.scrollY > 10) { + scrollClasses.forEach(c => header.classList.add(c)); + } else { + scrollClasses.forEach(c => header.classList.remove(c)); + } + } + window.addEventListener('scroll', updateNavbarOnScroll, { + passive: true + }); + document.addEventListener('DOMContentLoaded', updateNavbarOnScroll);