fix: responsive design
This commit is contained in:
@@ -133,6 +133,8 @@ class LMSCourse(Document):
|
||||
"status": "Complete"
|
||||
})
|
||||
precision = cint(frappe.db.get_default("float_precision")) or 3
|
||||
if not lesson_count:
|
||||
return 0
|
||||
return flt(((completed_lessons/lesson_count) * 100), precision)
|
||||
|
||||
def get_batch(self, batch_name):
|
||||
|
||||
@@ -93,11 +93,11 @@ class MacroInlineProcessor(InlineProcessor):
|
||||
macro = m.group(1)
|
||||
arg = m.group(2)
|
||||
html = render_macro(macro, arg)
|
||||
html = sanitize_html(str(html))
|
||||
html = sanitize_html(str(html), macro)
|
||||
e = etree.fromstring(html)
|
||||
return e, m.start(0), m.end(0)
|
||||
|
||||
def sanitize_html(html):
|
||||
def sanitize_html(html, macro):
|
||||
"""Sanotize the html using BeautifulSoup.
|
||||
|
||||
The markdown processor request the correct markup and crashes on
|
||||
@@ -106,4 +106,7 @@ def sanitize_html(html):
|
||||
"""
|
||||
soup = BeautifulSoup(html, features="lxml")
|
||||
nodes = soup.body.children
|
||||
return "<div>" + "\n".join(str(node) for node in nodes) + "</div>"
|
||||
classname = ""
|
||||
if macro == "YouTubeVideo":
|
||||
classname = "lesson-video"
|
||||
return "<div class='" + classname + "'>" + "\n".join(str(node) for node in nodes) + "</div>"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="common-card-style member-card {{dimension_class}} ">
|
||||
{% set avatar_class = "avatar-large" if dimension_class == "member-card-medium" else "avatar-xl"%}
|
||||
{% set avatar_class = "avatar-large" if not dimension_class else "avatar-xl"%}
|
||||
{{ widgets.Avatar(member=member, avatar_class=avatar_class) }}
|
||||
<div class="small-title member-card-title">
|
||||
{{ member.full_name }}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{% if course.get_reviews() | length %}
|
||||
<div class="reviews-parent">
|
||||
<div class="reviews-parent col">
|
||||
<div class="reviews-heading">
|
||||
<div class="course-home-headings">Review</div>
|
||||
<div class="course-home-headings">Student Review</div>
|
||||
{% if course.is_eligible_to_review(membership) %}
|
||||
<a class="review-link" href="">
|
||||
Provide your Feedback
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="mentors-section">
|
||||
<div class="reviews-section">
|
||||
{% for review in course.get_reviews() %}
|
||||
<div class="review-card">
|
||||
<div class="common-card-style review-content small-title"> {{ review.review }} </div>
|
||||
@@ -77,7 +77,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="button wide-button submit-review is-primary" data-course="{{ course.name | urlencode}}" id="submit-review">Submit</div>
|
||||
<div class="button submit-review is-primary" data-course="{{ course.name | urlencode}}" id="submit-review">Submit</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user