feat: discussions redesign
This commit is contained in:
@@ -99,7 +99,7 @@ class MacroInlineProcessor(InlineProcessor):
|
|||||||
return e, m.start(0), m.end(0)
|
return e, m.start(0), m.end(0)
|
||||||
|
|
||||||
def sanitize_html(html, macro):
|
def sanitize_html(html, macro):
|
||||||
"""Sanotize the html using BeautifulSoup.
|
"""Sanitize the html using BeautifulSoup.
|
||||||
|
|
||||||
The markdown processor request the correct markup and crashes on
|
The markdown processor request the correct markup and crashes on
|
||||||
any broken tags. This makes sures that all those things are fixed
|
any broken tags. This makes sures that all those things are fixed
|
||||||
|
|||||||
@@ -25,11 +25,11 @@
|
|||||||
{% if membership %}
|
{% if membership %}
|
||||||
{{ pagination(prev_url, next_url) }}
|
{{ pagination(prev_url, next_url) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{ Discussions() }}
|
{{ Discussions() }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% macro LessonContent(lesson) %}
|
{% macro LessonContent(lesson) %}
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
{% if membership %} is-member {% endif %}
|
{% if membership %} is-member {% endif %}
|
||||||
{% if membership or is_instructor %} eligible-for-submission {% endif %}" data-lesson="{{ lesson.name }}"
|
{% if membership or is_instructor %} eligible-for-submission {% endif %}" data-lesson="{{ lesson.name }}"
|
||||||
data-course="{{ course.name }}">{{ lesson.title }}</div>
|
data-course="{{ course.name }}">{{ lesson.title }}</div>
|
||||||
<span class="lesson-progress {{hide if get_progress(course.name, lesson.name) != 'Complete' else ''}}">COMPLETED</span>
|
<span class="lesson-progress {{hide if get_progress(course.name, lesson.name) != 'Complete' else ''}}">{{ _("COMPLETED") }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
{% if ins_len == 1 %}
|
{% if ins_len == 1 %}
|
||||||
{{ instructors[0].full_name }}
|
{{ instructors[0].full_name }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set suffix = "other" if ins_len - 1 == 1 else "others" %}
|
{% set suffix = _("other") if ins_len - 1 == 1 else _("others") %}
|
||||||
{{ instructors[0].full_name.split(" ")[0] }} and {{ ins_len - 1 }} {{ suffix }}
|
{{ instructors[0].full_name.split(" ")[0] }} and {{ ins_len - 1 }} {{ suffix }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
@@ -70,20 +70,19 @@
|
|||||||
<div class="ml-3 course-meta"> {{ frappe.utils.format_date(lesson.creation, "medium") }} </div>
|
<div class="ml-3 course-meta"> {{ frappe.utils.format_date(lesson.creation, "medium") }} </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="markdown-source lesson-content-card">
|
<div class="markdown-source lesson-content-card">
|
||||||
{% if membership or lesson.include_in_preview or is_instructor %}
|
{% if membership or lesson.include_in_preview or is_instructor %}
|
||||||
{% if is_instructor and not lesson.include_in_preview %}
|
{% if is_instructor and not lesson.include_in_preview %}
|
||||||
<div class="small alert alert-secondary alert-dismissible mt-4 mb-4">
|
<div class="small alert alert-secondary alert-dismissible mt-4 mb-4">
|
||||||
This lesson is not available for preview. As you are the Instructor of the course only you can see it.
|
{{ _("This lesson is not available for preview. As you are the Instructor of the course only you can see it.") }}
|
||||||
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
|
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ render_html(lesson.body) }}
|
{{ render_html(lesson.body) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="">
|
<div class="">
|
||||||
<a class="button is-primary pull-right" href="/courses/{{ course.name }}"> Start Learning </a>
|
<a class="button is-primary pull-right" href="/courses/{{ course.name }}"> {{ _("Start Learning") }} </a>
|
||||||
<div class="">This lesson is not available for preview. Please join the course to access it.</div>
|
<div class=""> {{ _("This lesson is not available for preview. Please join the course to access it.") }} </div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
@@ -98,7 +97,7 @@
|
|||||||
{% if prev_url %}
|
{% if prev_url %}
|
||||||
<a class="button is-secondary dark-links prev" href="{{ prev_url }}">
|
<a class="button is-secondary dark-links prev" href="{{ prev_url }}">
|
||||||
<img class="mr-2" src="/assets/school/icons/left-arrow.svg">
|
<img class="mr-2" src="/assets/school/icons/left-arrow.svg">
|
||||||
Prev
|
{{ _("Prev") }}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
@@ -116,7 +115,7 @@
|
|||||||
|
|
||||||
<div class="button is-secondary mark-progress {{ progress }} {% if progress == 'Incomplete' or progress == None %} hide {% endif %}"
|
<div class="button is-secondary mark-progress {{ progress }} {% if progress == 'Incomplete' or progress == None %} hide {% endif %}"
|
||||||
data-progress="Incomplete">
|
data-progress="Incomplete">
|
||||||
Mark as Incomplete
|
{{ _("Mark as Incomplete") }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -124,12 +123,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<a class="button is-primary next {% if membership.progress|int == 100 and not next_url %} hide {% endif %}"
|
<a class="button is-primary next {% if membership.progress|int == 100 and not next_url %} hide {% endif %}"
|
||||||
{% if next_url %} data-href="{{ next_url }}" {% endif %} href="">
|
{% if next_url %} data-href="{{ next_url }}" {% endif %} href="">
|
||||||
{% if next_url %} Next {% else %} Mark as Complete {% endif %}
|
{% if next_url %} {{ _("Next") }} {% else %} {{ _("Mark as Complete") }} {% endif %}
|
||||||
<img class="ml-2" src="/assets/school/icons/side-arrow-white.svg">
|
<img class="ml-2" src="/assets/school/icons/side-arrow-white.svg">
|
||||||
</a>
|
</a>
|
||||||
{% if course.enable_certification %}
|
{% if course.enable_certification %}
|
||||||
<div class="button is-primary {% if membership.progress|int != 100 or next_url %} hide {% endif %}" id="certification">
|
<div class="button is-primary {% if membership.progress|int != 100 or next_url %} hide {% endif %}" id="certification">
|
||||||
Get Certificate
|
{{ _("Get Certificate") }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user