Merge branch 'main' into translations

This commit is contained in:
Jannat Patel
2022-06-07 11:28:42 +05:30
committed by GitHub
24 changed files with 184 additions and 81 deletions

View File

@@ -22,9 +22,6 @@
</div>
<div class="lesson-pagination-parent">
{{ LessonContent(lesson) }}
{% if membership %}
{{ pagination(prev_url, next_url) }}
{% endif %}
{{ Discussions() }}
</div>
</div>
@@ -45,7 +42,7 @@
{% macro LessonContent(lesson) %}
{% set instructors = get_instructors(course.name) %}
{% set is_instructor = is_instructor(course.name) %}
<div class="lesson-content">
<div class="common-card-style lesson-content">
<div class="lesson-title">
<div class="course-home-headings title mb-0
{% if membership %} is-member {% endif %}
@@ -100,6 +97,8 @@
{% endif %}
</div>
{{ pagination(prev_url, next_url) }}
</div>
{% endmacro %}
@@ -145,11 +144,13 @@
{% endmacro %}
{% macro Discussions() %}
{% set topics_count = frappe.db.count("Discussion Topic",
{"reference_doctype": "Course Lesson", "reference_docname": lesson.name}) %}
{% set is_instructor = frappe.session.user == course.instructor %}
{% set condition = is_instructor if is_instructor else membership %}
{% set doctype, docname = _("Course Lesson"), lesson.name %}
{% set title = _("Questions") %}
{% set cta_title = _("Ask a Question") %}
{% 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?") %}