fix: get_doc references

This commit is contained in:
Jannat Patel
2022-02-10 09:53:08 +05:30
parent e17637d27b
commit fd5b7976e7
21 changed files with 334 additions and 286 deletions

View File

@@ -49,11 +49,11 @@
</div>
{% endif %}
{% if membership %}
{% set lesson_index = course.get_lesson_index(membership.current_lesson) if membership and
{% set lesson_index = get_lesson_index(membership.current_lesson) if membership and
membership.current_lesson
else '1.1' %}
<a class="button wide-button is-primary" id="continue-learning"
href="{{ course.get_learn_url(lesson_index) }}{{ course.query_parameter }}">
href="{{ get_lesson_url(course.name, lesson_index) }}{{ course.query_parameter }}">
Continue Learning <img class="ml-2" src="/assets/school/icons/white-arrow.svg" />
</a>
{% endif %}
@@ -70,7 +70,7 @@
</div>
{% endif %}
{% if course.is_cohort_staff(frappe.session.user) %}
{% if is_cohort_staff(course.name, frappe.session.user) %}
<a class="button wide-button is-secondary"
href="/courses/{{course.name}}/manage"
style="color: inherit;">
@@ -129,14 +129,14 @@
<div class="course-home-headings">
Creator
</div>
{% for instructor in course.get_instructors() %}
{% for instructor in get_instructors(course.name) %}
{{ widgets.MemberCard(member=instructor, show_course_count=True, avatar_class="avatar-large") }}
{% endfor %}
</div>
{% endmacro %}
{% macro Progress(course) %}
{% set certificate = course.is_certified() %}
{% set certificate = is_certified(course.name) %}
{% set progress = frappe.utils.cint(membership.progress) %}
{% if progress %}
<div class="course-progress-section">
@@ -186,17 +186,17 @@
{% endmacro %}
{% macro Overview(course) %}
{% set avg_rating = course.get_average_rating() %}
{% if course.get_students() | length or avg_rating %}
{% set avg_rating = get_average_rating(course.name) %}
{% if get_students(course.name) | length or avg_rating %}
<div class="course-overview-section">
<div class="course-home-headings">
Overview
</div>
<div class="common-card-style overview-card small-title">
{% if course.get_students() | length %}
{% if get_students(course.name) | length %}
<div class="overview-item">
<img class="icon-background mr-1" src="/assets/school/icons/user.svg" />
{{ course.get_students() | length }} Enrolled
{{ get_students(course.name) | length }} Enrolled
</div>
{% endif %}
{% if avg_rating %}
@@ -213,13 +213,13 @@
<!-- Mentors -->
{% macro Mentors(course) %}
{% if course.get_mentors() | length %}
{% if get_mentors(course.name) | length %}
<div class="course-home-mentors">
<div class="course-home-headings">
Mentors
</div>
<div class="member-parent">
{% for mentor in course.get_mentors() %}
{% for mentor in get_mentors(course.name) %}
{{ widgets.MemberCard(member=mentor, show_course_count=False) }}
{% endfor %}
</div>