{% 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}}

{{ course.short_introduction }}
{{ CourseVideo(course) }} {{ CourseDescription(course) }} {{ BatchSection(course) }} {{ CourseOutline(course) }}
{% endblock %} {% macro CourseVideo(course) %} {% if course.video_link %}
{% endif %} {% endmacro %} {% macro CourseDescription(course) %}

Course Description

{{ frappe.utils.md_to_html(course.description) }}
{% endmacro %} {% macro BatchSection(course) %} {% if course.is_mentor(frappe.session.user) %} {{ BatchSectionForMentors(course, course.get_batches(mentor=frappe.session.user)) }} {% else %} {{ BatchSectionForStudents(course, course.get_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.get_mentors() %}
{{ widgets.Avatar(member=m, avatar_class="avatar-medium" ) }} {{m.full_name}}
{% endfor %}
{% if can_manage %} 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.get_chapters() %} {{ widgets.ChapterTeaser(index=loop.index, chapter=chapter)}} {% endfor %} {% endmacro %}