diff --git a/lms/www/classes/class.html b/lms/www/classes/class.html
index 5c23dfce..1df30575 100644
--- a/lms/www/classes/class.html
+++ b/lms/www/classes/class.html
@@ -285,9 +285,8 @@
{%- block script %}
{{ super() }}
-
+ {% if is_moderator %}
+ {% endif %}
{{ include_script('controls.bundle.js') }}
{% endblock %}
diff --git a/lms/www/classes/index.html b/lms/www/classes/index.html
index 0b9980f8..69b62d2f 100644
--- a/lms/www/classes/index.html
+++ b/lms/www/classes/index.html
@@ -6,7 +6,7 @@
{% block page_content %}
- {% if has_course_moderator_role() %}
+ {% if is_moderator %}
@@ -30,9 +30,11 @@
{%- block script %}
{{ super() }}
{{ include_script('controls.bundle.js') }}
+ {% if is_moderator %}
+ {% endif %}
{% endblock %}
{% macro ClassCards(classes) %}
diff --git a/lms/www/classes/index.py b/lms/www/classes/index.py
index cb28b46d..90875fc0 100644
--- a/lms/www/classes/index.py
+++ b/lms/www/classes/index.py
@@ -1,10 +1,11 @@
import frappe
from frappe.utils import getdate
+from lms.lms.utils import has_course_moderator_role
def get_context(context):
context.no_cache = 1
-
+ context.is_moderator = has_course_moderator_role()
context.classes = frappe.get_all(
"LMS Class",
{"end_date": [">=", getdate()]},