fix: show course settings only to moderators
This commit is contained in:
@@ -127,6 +127,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if is_moderator %}
|
||||||
<div class="field-group vertically-center">
|
<div class="field-group vertically-center">
|
||||||
<label for="published" class="vertically-center mb-0">
|
<label for="published" class="vertically-center mb-0">
|
||||||
<input type="checkbox" id="published" {% if course.published %} checked {% endif %}>
|
<input type="checkbox" id="published" {% if course.published %} checked {% endif %}>
|
||||||
@@ -137,6 +138,7 @@
|
|||||||
{{ _("Upcoming") }}
|
{{ _("Upcoming") }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import frappe
|
import frappe
|
||||||
from lms.lms.utils import redirect_to_courses_list, can_create_courses
|
from lms.lms.utils import (
|
||||||
|
redirect_to_courses_list,
|
||||||
|
can_create_courses,
|
||||||
|
has_course_moderator_role,
|
||||||
|
)
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
|
||||||
|
|
||||||
@@ -27,6 +31,7 @@ def get_context(context):
|
|||||||
else:
|
else:
|
||||||
set_course_context(context, course_name)
|
set_course_context(context, course_name)
|
||||||
|
|
||||||
|
context.is_moderator = has_course_moderator_role()
|
||||||
context.member = frappe.db.get_value(
|
context.member = frappe.db.get_value(
|
||||||
"User", frappe.session.user, ["full_name", "username"], as_dict=True
|
"User", frappe.session.user, ["full_name", "username"], as_dict=True
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user