@@ -1,5 +1,6 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"autoname": "format:{####} {title}",
|
||||
"creation": "2021-05-03 05:49:08.383057",
|
||||
"doctype": "DocType",
|
||||
@@ -38,7 +39,7 @@
|
||||
"fieldname": "lessons",
|
||||
"fieldtype": "Table",
|
||||
"label": "Lessons",
|
||||
"options": "Lessons"
|
||||
"options": "Lesson Reference"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_3",
|
||||
@@ -57,10 +58,11 @@
|
||||
"link_fieldname": "chapter"
|
||||
}
|
||||
],
|
||||
"modified": "2021-08-31 10:43:45.866864",
|
||||
"modified": "2021-09-20 10:58:47.241660",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Chapter",
|
||||
"naming_rule": "Expression",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"modified": "2021-07-27 16:25:02.903245",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Chapters",
|
||||
"name": "Chapter Reference",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"sort_field": "modified",
|
||||
@@ -4,5 +4,5 @@
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class Lessons(Document):
|
||||
class ChapterReference(Document):
|
||||
pass
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"autoname": "format:{####} {title}",
|
||||
"creation": "2021-05-03 06:21:12.995987",
|
||||
"doctype": "DocType",
|
||||
@@ -70,10 +71,11 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-08-31 10:44:14.168257",
|
||||
"modified": "2021-09-20 10:52:29.116536",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Lesson",
|
||||
"naming_rule": "Expression",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"modified": "2021-08-31 10:44:42.048232",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Lessons",
|
||||
"name": "Lesson Reference",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"sort_field": "modified",
|
||||
@@ -4,5 +4,5 @@
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class Chapters(Document):
|
||||
class LessonReference(Document):
|
||||
pass
|
||||
@@ -100,7 +100,7 @@
|
||||
"fieldname": "chapters",
|
||||
"fieldtype": "Table",
|
||||
"label": "Chapters",
|
||||
"options": "Chapters"
|
||||
"options": "Chapter Reference"
|
||||
},
|
||||
{
|
||||
"fieldname": "instructor",
|
||||
@@ -160,9 +160,14 @@
|
||||
"group": "Mentors",
|
||||
"link_doctype": "LMS Course Mentor Mapping",
|
||||
"link_fieldname": "course"
|
||||
},
|
||||
{
|
||||
"group": "Interests",
|
||||
"link_doctype": "LMS Course Interest",
|
||||
"link_fieldname": "course"
|
||||
}
|
||||
],
|
||||
"modified": "2021-08-25 11:04:57.211898",
|
||||
"modified": "2021-09-20 12:00:18.325579",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Course",
|
||||
|
||||
@@ -176,7 +176,7 @@ class LMSCourse(Document):
|
||||
|
||||
def get_lesson_details(self, chapter):
|
||||
lessons = []
|
||||
lesson_list = frappe.get_all("Lessons", {"parent": chapter.name},
|
||||
lesson_list = frappe.get_all("Lesson Reference", {"parent": chapter.name},
|
||||
["lesson", "idx"], order_by="idx")
|
||||
for row in lesson_list:
|
||||
lesson_details = frappe.get_doc("Lesson", row.lesson)
|
||||
@@ -213,7 +213,7 @@ class LMSCourse(Document):
|
||||
def get_lesson_index(self, lesson_name):
|
||||
"""Returns the {chapter_index}.{lesson_index} for the lesson.
|
||||
"""
|
||||
lesson = frappe.db.get_value("Lessons", {"lesson": lesson_name}, ["idx", "parent"], as_dict=True)
|
||||
lesson = frappe.db.get_value("Lesson Reference", {"lesson": lesson_name}, ["idx", "parent"], as_dict=True)
|
||||
if not lesson:
|
||||
return None
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:title",
|
||||
"creation": "2021-06-07 10:50:17.893625",
|
||||
"doctype": "DocType",
|
||||
@@ -33,10 +34,11 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-07-23 19:06:12.551633",
|
||||
"modified": "2021-09-20 10:44:15.930892",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Quiz",
|
||||
"naming_rule": "By fieldname",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<div class="lesson-info {% if membership.current_lesson == lesson.name %} active-lesson {% endif %}">
|
||||
|
||||
{% if membership or lesson.include_in_preview or is_instructor %}
|
||||
{% if membership or lesson.include_in_preview %}
|
||||
<a class="lesson-links" href="{{ course.get_learn_url(lesson.number) }}{{course.query_parameter}}"
|
||||
data-course="{{ course.name }}">
|
||||
{{ lesson.title }}
|
||||
@@ -33,6 +33,15 @@
|
||||
|
||||
</a>
|
||||
|
||||
{% elif is_instructor and not lesson.include_in_preview %}
|
||||
<a class="lesson-links"
|
||||
title="This lesson is not available for preview but as an instructor you can access it."
|
||||
href="{{ course.get_learn_url(lesson.number) }}{{course.query_parameter}}"
|
||||
data-course="{{ course.name }}">
|
||||
{{ lesson.title }}
|
||||
<img class="ml-2" src="/assets/community/icons/lock.svg">
|
||||
</a>
|
||||
|
||||
{% else %}
|
||||
<div class="no-preview" title="This lesson is not available for preview">
|
||||
<div class="lesson-links">
|
||||
|
||||
@@ -924,6 +924,10 @@ input[type=checkbox] {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.lesson-content-card .alert-dismissible .close {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.course-content-parent {
|
||||
display: grid;
|
||||
grid-gap: 2rem;
|
||||
|
||||
@@ -47,10 +47,17 @@
|
||||
|
||||
|
||||
{% if membership or lesson.include_in_preview or is_instructor %}
|
||||
<div class="common-card-style lesson-content-card markdown-source">{{ lesson.render_html() }}</div>
|
||||
<div class="common-card-style lesson-content-card markdown-source">
|
||||
{% if is_instructor %}
|
||||
<small class="alert alert-secondary alert-dismissible">
|
||||
This lesson is not available for preview. As you are the Instructor of the course only you can see it.
|
||||
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
|
||||
</small>
|
||||
{% endif %}
|
||||
{{ lesson.render_html() }}</div>
|
||||
{% else %}
|
||||
<div class="common-card-style lesson-content-card">
|
||||
<span>This lesson is not available for Preview. Please join the course to access this lesson. <a
|
||||
<span>This lesson is not available for Preview. Please join the course to access it. <a
|
||||
href="/courses/{{ course.name }}">Checkout Course Details.</a></span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -11,7 +11,7 @@ def get_context(context):
|
||||
}
|
||||
|
||||
def get_courses():
|
||||
course_names = frappe.get_all("LMS Course", filters={"is_published": True}, pluck="name")
|
||||
course_names = frappe.get_all("LMS Course", filters={"is_published": True}, order_by="upcoming", pluck="name")
|
||||
courses = []
|
||||
for course in course_names:
|
||||
courses.append(frappe.get_doc("LMS Course", course))
|
||||
|
||||
Reference in New Issue
Block a user