{% extends "templates/base.html" %} {% from "www/macros/common_macro.html" import InstructorsSection, MentorsSection %} {% block title %}{{ course.title }}{% endblock %} {% block head_include %} {% endblock %} {% block content %}
course

{{course.title}}

{{ CourseDescription(course) }} {{ BatchSection(course, is_mentor, upcoming_batches, mentor_batches) }} {{ CourseOutline(course) }}
{% endblock %} {% macro CourseDescription(course) %}

Course Description

{{ course.short_introduction }}
{% if course.video_link %}
{% endif %} {% endmacro %} {% macro BatchSection(course, is_mentor, upcoming_batches, mentor_batches) %} {% if is_mentor %} {{ BatchSectionForMentors(course, mentor_batches) }} {% else %} {{ BatchSectionForStudents(course, upcoming_batches) }} {% endif %} {% endmacro %} {% macro RenderBatch(batch, can_manage=False) %}
Session every {{batch.sessions_on}}
{{frappe.utils.format_time(batch.start_time, "short")}} - {{frappe.utils.format_time(batch.end_time, "short")}}
Starting {{frappe.utils.format_date(batch.start_date, "medium")}}
mentors
{% for m in batch.mentors %}
{% if m.photo_url %} {% endif %} {{m.full_name}}
{% endfor %}
{% if can_manage %} {% else %} {% endif %}
{% endmacro %} {% macro BatchSectionForMentors(course, mentor_batches) %}

Your Batches

{% if mentor_batches %}
You are a mentor for this course. Manage your batches or create a new batch from here.
{% for batch in mentor_batches %}
{{ RenderBatch(batch, can_manage=True) }}
{% endfor %}
Add a new batch {% else %}

You are a mentor for this course.

Create your first batch
{% endif %} {% endmacro %} {% macro BatchSectionForStudents(course, upcoming_batches) %}

Upcoming Batches

{% for batch in upcoming_batches %}
{{ RenderBatch(batch, can_manage=False) }}
{% endfor %} {% endmacro %} {% macro CourseOutline(course) %}

Course Outline

{% for chapter in course.topics %}

{{loop.index}} {{chapter.title}}

{{chapter.preview | markdown}}
{#
{% for lesson in chapter.lessons %}
{{lesson.title}}
{% endfor %}
#}
{% endfor %} {% endmacro %}