{% 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 %}
{{ widgets.CourseOutline(course=course, membership=membership, lesson_page=True) }}
{{ BreadCrumb(course, lesson) }} {{ LessonContent(lesson) }} {% if course.status == "Approved" and not course.upcoming %} {{ Discussions() }} {% endif %}
{% endblock %} {% macro BreadCrumb(course, lesson) %} {% endmacro %} {% macro LessonContent(lesson) %} {% 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 %} {{ 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 %}
{{ pagination(prev_url, next_url) }}
{% 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 HelpArticle() %}

{{ _("Embed Components") }}

{{ _("You can add additional content to the lesson using a special syntax. The table below mentions all types of dynamic content that you can add to the lessons and the syntax for the same.") }}

  1. {{ _("YouTube Video") }}

    To get the YouTube Video ID, follow the steps mentioned below.

    • {{ _("Upload the video on youtube.") }}
    • {{ _("When you share a youtube video, it shows a URL") }}
    • {{ _("Copy the last parameter of the URL and paste it here.") }}
{% 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() }} {% for ext in page_extensions %} {{ ext.render_footer() }} {% endfor %} {%- endblock %}