feat: course details page structure

This commit is contained in:
pateljannat
2021-07-06 20:51:20 +05:30
parent 68fd32d536
commit 0ed5309b97
10 changed files with 129 additions and 76 deletions

View File

@@ -55,7 +55,7 @@
</a>
{% endif %}
{% if course.video_link %}
<div class="wide-button video-preview">
<div class="wide-button is-secondary video-preview">
Watch Video Preview
<img class="ml-2" src="/assets/community/images/play.png" />
</div>
@@ -135,6 +135,8 @@
{{ frappe.utils.md_to_html(course.description) }}
</div>
</div>
{% set avg_rating = course.get_average_rating() %}
{% if course.get_students() | length or avg_rating %}
<div>
<div class="course-home-headings">
Overview
@@ -146,7 +148,6 @@
{{ course.get_students() | length }} Enrolled
</div>
{% endif %}
{% set avg_rating = course.get_average_rating() %}
{% if avg_rating %}
<div class="overtime-item">
<img class="icon-background mr-1" src="/assets/community/icons/rating.svg" />
@@ -155,6 +156,7 @@
{% endif %}
</div>
</div>
{% endif %}
</div>
{% endmacro %}

View File

@@ -3,8 +3,6 @@ frappe.ready(() => {
check_mentor_request();
}
expand_the_first_chapter();
hide_wrapped_mentor_cards();
$("#apply-now").click((e) => {
@@ -175,16 +173,6 @@ var rotate_chapter_icon = (e) => {
}
}
var expand_the_first_chapter = () => {
var elements = $(".collapse");
elements.each((i, elem) => {
if (i <= 1) {
$(elem).addClass("show");
$(elem).siblings(".chapter-title").children(".chapter-icon").css("transform", "rotate(90deg)");
}
});
}
var highlight_rating = (e) => {
var rating = $(e.currentTarget).attr("data-rating");
$(".icon-rating").removeClass("star-click");