{% extends "lms/templates/lms_base.html" %} {% from "www/macros/livecode.html" import LiveCodeEditorJS, LiveCodeEditor with context %} {% block title %} {{ lesson.title }} - {{ course.title }} {% endblock %} {% block head_include %} {% for ext in page_extensions %} {{ ext.render_header() }} {% endfor %} {% endblock %} {% block page_content %}
{{ course.title }}
{% if membership %}
{{ progress }}% {{ _("Completed") }}
{% endif %}
{% set classname = class_info.name if class_info else False %} {{ widgets.CourseOutline(course=course, membership=membership, lesson_page=True, classname=classname) }}
{{ BreadCrumb(course, lesson, class_info) }} {{ LessonContent(lesson, class_info) }} {% if course.status == "Approved" and not course.upcoming and not class_info %} {{ Discussions() }} {% endif %}
{% endblock %} {% macro BreadCrumb(course, lesson, class_info) %} {% endmacro %} {% macro LessonContent(lesson, class_info) %} {% set instructors = get_instructors(course.name) %} {% set is_instructor = is_instructor(course.name) %}
{% if get_progress(course.name, lesson.name) == 'Complete' %} {{ _("COMPLETED") }} {% endif %} {% if (is_instructor or has_course_moderator_role()) %} {{ _("Edit") }} {% endif %}
{% if lesson.title %}{{ lesson.title }}{% endif %}
{% set ins_len = instructors | length %} {% for instructor in instructors %} {% if ins_len > 1 and loop.index == 1 %}
{% endif %} {{ widgets.Avatar(member=instructor, avatar_class="avatar-small") }} {% if ins_len > 1 and loop.index == ins_len %}
{% endif %} {% endfor %} {% if ins_len == 1 %} {{ instructors[0].full_name }} {% elif ins_len == 2 %} {{ instructors[0].full_name.split(" ")[0] }} and {{ instructors[1].full_name.split(" ")[0] }} {% else %} {% set suffix = "other" if ins_len - 1 == 1 else "others" %} {{ instructors[0].full_name.split(" ")[0] }} and {{ ins_len - 1 }} {{ suffix }} {% endif %}
{{ frappe.utils.format_date(lesson.creation, "medium") }}
{% if show_lesson %} {% if is_instructor and not lesson.include_in_preview %}
{{ _("This lesson is not available for preview. As you are the Instructor of the course only you can see it.") }} ×
{% endif %} {% if instructor_notes and (is_moderator or instructor or is_evaluator) %}
{{ instructor_notes }}
{% endif %} {{ render_html(lesson) }} {% else %} {% set course_link = "" + _('here') + "" %}
{{ _("There is no preview available for this lesson. Please join the course to access it. Click {0} to enroll.").format(course_link) }}
{% endif %}
{% if not class_info %} {{ pagination(prev_url, next_url) }} {% endif %}
{% endmacro %} {% macro pagination(prev_url, next_url) %} {% if prev_url or next_url %}
{% if prev_url %} {% endif %} {% if next_url %} {% endif %}
{% endif %} {% endmacro %} {% macro UploadAttachments() %}
{{ _("Upload Attachments") }}
{% endmacro %} {% macro Discussions() %} {% set topics_count = frappe.db.count("Discussion Topic", { "reference_doctype": "Course Lesson", "reference_docname": lesson.name }) %} {% set condition = is_instructor(course.name) or membership %} {% set doctype, docname = _("Course Lesson"), lesson.name %} {% set title = "Questions" if topics_count else "" %} {% set cta_title = "Ask a Question" %} {% set button_name = _("Start Learning") %} {% set redirect_to = "/courses/" + course.name %} {% set empty_state_title = _("Have a doubt?") %} {% set empty_state_subtitle = _("Post it here, our mentors will help you out.") %}
{% include "frappe/templates/discussions/discussions_section.html" %}
{% endmacro %} {%- block script %} {{ super() }} {{ include_script('controls.bundle.js') }} {% for ext in page_extensions %} {{ ext.render_footer() }} {% endfor %} {%- endblock %}