diff --git a/community/community/widgets/DiscussionMessage.html b/community/community/widgets/DiscussionMessage.html index dfd2acf3..b1b89ca2 100644 --- a/community/community/widgets/DiscussionMessage.html +++ b/community/community/widgets/DiscussionMessage.html @@ -1,33 +1,65 @@ {% set topics = frappe.get_all("Discussion Topic", -{"reference_doctype": doctype, "reference_docname": docname}, ["name", "title"]) %} +{"reference_doctype": doctype, "reference_docname": docname}, ["name", "title", "owner", "creation"]) %} -
- {{_('Discussions')}} -
- - Start a Discussion +
+
+ {{_('Discussions')}} + + New Topic + +
-
+ {{ widgets.DiscussionComment(doctype=doctype, docname=docname) }} -{{ widgets.DiscussionComment(doctype=doctype, docname=docname) }} +
+ +
+ {% for topic in topics %} + {% set replies = frappe.get_all("Discussion Reply", {"topic": topic.name})%} + + {% if loop.index != topics | length %} +
+ {% endif %} + {% endfor %} + +
+ +
+ {% for topic in topics %} + {% set replies = frappe.get_all("Discussion Reply", {"topic": topic.name}, + ["reply", "owner", "creation"], order_by="creation")%} +
+
{{ topic.title }}
+ {% for reply in replies %} + {% include "community/templates/reply_card.html" %} + {% endfor %} +
+ {% endfor %} +
+ + {% if not topics %} + + No discussions yet. + + {% endif %} -
- {% for topic in topics %} -
-
{{ topic.title }}
- {% set replies = frappe.get_all("Discussion Reply", {"topic": topic.name}, - ["reply", "owner", "creation"], order_by="creation")%} - {% for reply in replies %} - {% include "community/templates/reply_card.html" %} - {% endfor %}
- {% endfor %} - {% if not topics %} - - No discussions yet. - - {% endif %}
diff --git a/community/lms/widgets/ChapterTeaser.html b/community/lms/widgets/ChapterTeaser.html index 81fd0e6d..8edfa580 100644 --- a/community/lms/widgets/ChapterTeaser.html +++ b/community/lms/widgets/ChapterTeaser.html @@ -64,10 +64,11 @@ }) var expand_the_first_chapter = () => { - var elements = $(".collapse"); + var elements = $(".course-outline .collapse"); elements.each((i, element) => { - if (i <= 1) { + if (i < 1) { show_section(element); + return false; } }); } diff --git a/community/public/css/style.css b/community/public/css/style.css index 5a60312b..36649075 100644 --- a/community/public/css/style.css +++ b/community/public/css/style.css @@ -438,7 +438,7 @@ input[type=checkbox] { .button { box-shadow: var(--btn-shadow); - border-radius: 8px; + border-radius: 4px; cursor: pointer; display: flex; align-items: center; @@ -1281,7 +1281,7 @@ pre { .thread-card { flex-direction: column; - padding: 1.5rem; + padding: 1rem; } textarea.form-control { @@ -1307,6 +1307,14 @@ textarea.form-control { margin-bottom: 40px; } +.discussions-parent .collapsing { + transition: height 0s; +} + +.discussion-topic-title { + color: var(--text-color); +} + .certificate-page .common-card-style { color: black; font-size: 1.25rem; diff --git a/community/public/icons/message.svg b/community/public/icons/message.svg index 09bab74d..241069d5 100644 --- a/community/public/icons/message.svg +++ b/community/public/icons/message.svg @@ -1,5 +1,3 @@ - - - - + + diff --git a/community/public/icons/small-add-black.svg b/community/public/icons/small-add-black.svg new file mode 100644 index 00000000..26801342 --- /dev/null +++ b/community/public/icons/small-add-black.svg @@ -0,0 +1,3 @@ + + + diff --git a/community/www/batch/learn.html b/community/www/batch/learn.html index 365e8bfe..49016c64 100644 --- a/community/www/batch/learn.html +++ b/community/www/batch/learn.html @@ -27,14 +27,9 @@ {% if membership %} {{ pagination(prev_url, next_url) }} {% endif %} - - {% set title = lesson.title + " - " + course.title %} - {% set condition = membership or is_instructor %} - {{ widgets.DiscussionMessage(doctype="Lesson", docname=lesson.name, - condition=condition, button_name="Start Learning", - redirect_to="/courses/" + course.name) }}
+ {{ Discussions() }}
{% endblock %} @@ -96,7 +91,7 @@ Next - {% elif course.enable_certification %} + {% elif course.enable_certification %}
Get Certificate
@@ -106,6 +101,14 @@ {% endmacro %} +{% macro Discussions() %} +{% set title = lesson.title + " - " + course.title %} +{% set condition = membership or is_instructor %} +{{ widgets.DiscussionMessage(doctype="Lesson", docname=lesson.name, + condition=condition, button_name="Start Learning", + redirect_to="/courses/" + course.name) }} +{% endmacro %} + {%- block script %} {{ super() }}