+
+
-
-
- Courses
-
-
+
+
+
+ {{ CourseDescription(course) }}
+ {{ BatchSection(course, is_mentor, upcoming_batches, mentor_batches) }}
+ {{ CourseOutline(course) }}
+
+
-
-
-
{{ course.title }}
- {% if course.short_introduction %} {{course.short_introduction}} {% endif %}
-
- {% if course.video_link %}
-
-
-
- {% endif %}
-
+
+
- {% if is_mentor %}
-
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 %}
-
-
-
{{batch.status}}
-
Starting {{frappe.utils.format_date(batch.start_date, "medium")}}
-
Sessions every {{batch.sessions_on}}
-
{{frappe.utils.format_time(batch.start_time, "short")}} -
- {{frappe.utils.format_time(batch.end_time, "short")}}
-
-
- {% if batch.mentors %}
-
-
Mentors
- {% for mentor in batch.mentors %}
-
-
- {{ profile(mentor.photo, mentor.full_name, mentor.abbr, "small")}}
-
-
{{mentor.full_name}}
-
- {% endfor %}
-
- {% endif %}
-
-
- Manage
-
-
- {% endfor %}
-
-
Add a new batch
-
- {% else %}
-
- {% endif %}
- {% endif %}
+
+
+
+
+{% endblock %}
- {% if not is_mentor and upcoming_batches %}
-
-
Upcoming Batches
-
- {% for batch in upcoming_batches %}
-
-
-
Starting {{frappe.utils.format_date(batch.start_date, "medium")}}
-
Sessions every {{batch.sessions_on}}
-
{{frappe.utils.format_time(batch.start_time, "short")}} -
- {{frappe.utils.format_time(batch.end_time, "short")}}
-
-
- {% if batch.mentors %}
-
-
Mentors
- {% for mentor in batch.mentors %}
-
-
- {{ profile(mentor.photo, mentor.full_name, mentor.abbr, "small")}}
-
-
{{mentor.full_name}}
-
- {% endfor %}
-
- {% endif %}
-
-
- Join
- now
-
-
- {% endfor %}
-
-
- {% endif %}
- {% if course.description %}
-
-
About the Course
-
{{frappe.utils.md_to_html(course.description)}}
-
- {% endif %}
+{% macro CourseDescription(course) %}
+
Course Description
-
-
Instructor
-
-
- {{ profile(instructor.photo, instructor.full_name, instructor.abbr, "small")}}
-
-
-
{{instructor.full_name}}
-
{{instructor.course_count}} Courses
-
-
-
+
+ {{ course.short_introduction }}
+
- {% if mentors %}
-
-
Mentors
-
- {% for mentor in mentors %}
-
-
- {{ profile(mentor.photo, mentor.full_name, mentor.abbr, "small")}}
-
-
-
{{mentor.full_name}}
- {% if mentor.batch_count %}
-
Mentored {{mentor.batch_count}} {% if mentor.batch_count == 1 %} Batch
- {% else %} Batches {% endif %}
- {% else %}
-
New Mentor
- {% endif %}
-
-
- {% endfor %}
-
-
- {% endif %}
+ {% if course.video_link %}
+
+
+
+ {% endif %}
+{% endmacro %}
- {% if not is_mentor %}
-
- Interested to mentor this course? Apply now!
-
-
- You've applied to become a mentor for this course. Your request is currently under review. If you are not
- any more interested to mentor this course, you can Cancel your Application .
-
- {% endif %}
+{% macro BatchSection(course, is_mentor, upcoming_batches, mentor_batches) %}
+ {% if is_mentor %}
+ {{ BatchSectionForMentors(course, mentor_batches) }}
+ {% else %}
+ {{ BatchSectionForStudents(course, upcoming_batches) }}
+ {% endif %}
+{% endmacro %}
- {% if course.topics %}
-
-
Topics
-
- {% for topic in course.topics %}
-
- {% endfor %}
-
-
- {% endif %}
-
-{% endblock %}
\ No newline at end of file
+{% 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 %}
+ Manage
+ {% else %}
+ Join this Batch
+ {% 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 %}
+
+ {% 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 %}
+
+{% macro InstructorsSection(instructor) %}
+
Instructor
+
+
{{instructor.full_name}}
+
Created {{instructor.course_count}} courses
+
+{% endmacro %}
+
+{% macro MentorsSection(instructor) %}
+
Mentors
+ {% for m in mentors %}
+
+
{{m.full_name}}
+
Mentored {{m.batch_count}} batches
+
+ {% endfor %}
+
+
+ Interested to become a mentor?
+
+
+
+{% endmacro %}