@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
|
"allow_rename": 1,
|
||||||
"autoname": "format:{####} {title}",
|
"autoname": "format:{####} {title}",
|
||||||
"creation": "2021-05-03 05:49:08.383057",
|
"creation": "2021-05-03 05:49:08.383057",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@@ -38,7 +39,7 @@
|
|||||||
"fieldname": "lessons",
|
"fieldname": "lessons",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "Lessons",
|
"label": "Lessons",
|
||||||
"options": "Lessons"
|
"options": "Lesson Reference"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "column_break_3",
|
"fieldname": "column_break_3",
|
||||||
@@ -57,10 +58,11 @@
|
|||||||
"link_fieldname": "chapter"
|
"link_fieldname": "chapter"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2021-08-31 10:43:45.866864",
|
"modified": "2021-09-20 10:58:47.241660",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Chapter",
|
"name": "Chapter",
|
||||||
|
"naming_rule": "Expression",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
"modified": "2021-07-27 16:25:02.903245",
|
"modified": "2021-07-27 16:25:02.903245",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Chapters",
|
"name": "Chapter Reference",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
@@ -4,5 +4,5 @@
|
|||||||
# import frappe
|
# import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class Lessons(Document):
|
class ChapterReference(Document):
|
||||||
pass
|
pass
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
|
"allow_rename": 1,
|
||||||
"autoname": "format:{####} {title}",
|
"autoname": "format:{####} {title}",
|
||||||
"creation": "2021-05-03 06:21:12.995987",
|
"creation": "2021-05-03 06:21:12.995987",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@@ -70,10 +71,11 @@
|
|||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-08-31 10:44:14.168257",
|
"modified": "2021-09-20 10:52:29.116536",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Lesson",
|
"name": "Lesson",
|
||||||
|
"naming_rule": "Expression",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
"modified": "2021-08-31 10:44:42.048232",
|
"modified": "2021-08-31 10:44:42.048232",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Lessons",
|
"name": "Lesson Reference",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [],
|
"permissions": [],
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
@@ -4,5 +4,5 @@
|
|||||||
# import frappe
|
# import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class Chapters(Document):
|
class LessonReference(Document):
|
||||||
pass
|
pass
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
"fieldname": "chapters",
|
"fieldname": "chapters",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "Chapters",
|
"label": "Chapters",
|
||||||
"options": "Chapters"
|
"options": "Chapter Reference"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "instructor",
|
"fieldname": "instructor",
|
||||||
@@ -160,9 +160,14 @@
|
|||||||
"group": "Mentors",
|
"group": "Mentors",
|
||||||
"link_doctype": "LMS Course Mentor Mapping",
|
"link_doctype": "LMS Course Mentor Mapping",
|
||||||
"link_fieldname": "course"
|
"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",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Course",
|
"name": "LMS Course",
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ class LMSCourse(Document):
|
|||||||
|
|
||||||
def get_lesson_details(self, chapter):
|
def get_lesson_details(self, chapter):
|
||||||
lessons = []
|
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")
|
["lesson", "idx"], order_by="idx")
|
||||||
for row in lesson_list:
|
for row in lesson_list:
|
||||||
lesson_details = frappe.get_doc("Lesson", row.lesson)
|
lesson_details = frappe.get_doc("Lesson", row.lesson)
|
||||||
@@ -213,7 +213,7 @@ class LMSCourse(Document):
|
|||||||
def get_lesson_index(self, lesson_name):
|
def get_lesson_index(self, lesson_name):
|
||||||
"""Returns the {chapter_index}.{lesson_index} for the lesson.
|
"""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:
|
if not lesson:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
|
"allow_rename": 1,
|
||||||
"autoname": "field:title",
|
"autoname": "field:title",
|
||||||
"creation": "2021-06-07 10:50:17.893625",
|
"creation": "2021-06-07 10:50:17.893625",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@@ -33,10 +34,11 @@
|
|||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-07-23 19:06:12.551633",
|
"modified": "2021-09-20 10:44:15.930892",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Quiz",
|
"name": "LMS Quiz",
|
||||||
|
"naming_rule": "By fieldname",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<div class="lesson-info {% if membership.current_lesson == lesson.name %} active-lesson {% endif %}">
|
<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}}"
|
<a class="lesson-links" href="{{ course.get_learn_url(lesson.number) }}{{course.query_parameter}}"
|
||||||
data-course="{{ course.name }}">
|
data-course="{{ course.name }}">
|
||||||
{{ lesson.title }}
|
{{ lesson.title }}
|
||||||
@@ -33,6 +33,15 @@
|
|||||||
|
|
||||||
</a>
|
</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 %}
|
{% else %}
|
||||||
<div class="no-preview" title="This lesson is not available for preview">
|
<div class="no-preview" title="This lesson is not available for preview">
|
||||||
<div class="lesson-links">
|
<div class="lesson-links">
|
||||||
|
|||||||
@@ -924,6 +924,10 @@ input[type=checkbox] {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.lesson-content-card .alert-dismissible .close {
|
||||||
|
padding: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.course-content-parent {
|
.course-content-parent {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-gap: 2rem;
|
grid-gap: 2rem;
|
||||||
|
|||||||
@@ -47,10 +47,17 @@
|
|||||||
|
|
||||||
|
|
||||||
{% if membership or lesson.include_in_preview or is_instructor %}
|
{% 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 %}
|
{% else %}
|
||||||
<div class="common-card-style lesson-content-card">
|
<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>
|
href="/courses/{{ course.name }}">Checkout Course Details.</a></span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ def get_context(context):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def get_courses():
|
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 = []
|
courses = []
|
||||||
for course in course_names:
|
for course in course_names:
|
||||||
courses.append(frappe.get_doc("LMS Course", course))
|
courses.append(frappe.get_doc("LMS Course", course))
|
||||||
|
|||||||
Reference in New Issue
Block a user