diff --git a/community/community/doctype/community_course_member/community_course_member.json b/community/community/doctype/community_course_member/community_course_member.json index 9a48dab9..f6853b54 100644 --- a/community/community/doctype/community_course_member/community_course_member.json +++ b/community/community/doctype/community_course_member/community_course_member.json @@ -69,7 +69,7 @@ "index_web_pages_for_search": 1, "is_published_field": "enabled", "links": [], - "modified": "2021-03-09 11:17:40.842666", + "modified": "2021-04-06 11:50:41.551665", "modified_by": "Administrator", "module": "Community", "name": "Community Course Member", @@ -89,6 +89,7 @@ } ], "quick_entry": 1, + "route": "community-course-member", "sort_field": "modified", "sort_order": "DESC", "track_changes": 1 diff --git a/community/conference/doctype/community_conference/community_conference.json b/community/conference/doctype/community_conference/community_conference.json index cc505477..a52bfacf 100644 --- a/community/conference/doctype/community_conference/community_conference.json +++ b/community/conference/doctype/community_conference/community_conference.json @@ -1,28 +1,36 @@ { "actions": [], + "autoname": "field:conference_name", "creation": "2021-02-25 17:12:51.981534", "doctype": "DocType", "editable_grid": 1, "engine": "InnoDB", "field_order": [ "conference_name", - "live_stream_url" + "live_stream_url", + "conference_details" ], "fields": [ { "fieldname": "conference_name", "fieldtype": "Data", - "label": "Conference Name" + "label": "Conference Name", + "unique": 1 }, { "fieldname": "live_stream_url", "fieldtype": "Data", "label": "Live Stream URL" + }, + { + "fieldname": "conference_details", + "fieldtype": "Markdown Editor", + "label": "Conference Details" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2021-03-04 20:13:09.893749", + "modified": "2021-04-06 18:30:18.228083", "modified_by": "Administrator", "module": "Conference", "name": "Community Conference", diff --git a/community/patches/set_email_preferences.py b/community/patches/set_email_preferences.py index ac7d3acd..e1bf8dde 100644 --- a/community/patches/set_email_preferences.py +++ b/community/patches/set_email_preferences.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals import frappe def execute(): + frappe.reload_doc("community", "doctype", "community_member") members = frappe.get_all("Community Member", ["name", "email_preference"]) for member in members: if not member.email_preference: diff --git a/community/www/conferences/index.html b/community/www/conferences/index.html new file mode 100644 index 00000000..d30d4018 --- /dev/null +++ b/community/www/conferences/index.html @@ -0,0 +1,41 @@ +{% extends "templates/base.html" %} +{% block title %}{{ 'Hackathons' }}{% endblock %} +{% from "www/hackathons/macros/card.html" import hackathon_card %} +{% from "www/hackathons/macros/card.html" import null_card %} +{% block head_include %} + + + +{% endblock %} + +{% block content %} +
+
+

{{ 'Conferences' }}

+
+
+
+ {% for conference in conferences %} + + {% endfor %} + {% if conferences %} + {% for n in range( (3 - (conferences|length)) %3) %} + {{ null_card() }} + {% endfor %} + {% endif %} +
+
+
+{% endblock %} \ No newline at end of file diff --git a/community/www/conferences/index.py b/community/www/conferences/index.py new file mode 100644 index 00000000..dde65467 --- /dev/null +++ b/community/www/conferences/index.py @@ -0,0 +1,8 @@ +import frappe + +def get_context(context): + context.no_cache = 1 + context.conferences = get_conferences() + +def get_conferences(): + return frappe.get_all("Community Conference", fields=["name", "live_stream_url"]) \ No newline at end of file diff --git a/community/www/courses/course.html b/community/www/courses/course.html index e4190705..ca3864bd 100644 --- a/community/www/courses/course.html +++ b/community/www/courses/course.html @@ -30,11 +30,11 @@ {% if discussions %} {% endif %} - +
@@ -43,7 +43,8 @@
{% for topic in course.topics %}
-
{{topic.title}}
+
{{topic.title}} +
{{topic.preview | markdown }}
{% endfor %} @@ -53,18 +54,28 @@
{% if batches %} -
- + {% endif %}
- - + +
{% if discussions %} @@ -75,11 +86,11 @@ {{ message.message }}
{{ message.creation }}
- {% endfor %} + {% endfor %}
{% endif %}
-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/community/www/courses/course.js b/community/www/courses/course.js index 667016f6..58177576 100644 --- a/community/www/courses/course.js +++ b/community/www/courses/course.js @@ -1,19 +1,18 @@ frappe.ready(() => { - var dropdown = document.getElementById("batches-dropdown"); - if (dropdown) { - dropdown.onchange = () => { - $(".send-message").attr("data-batch", dropdown.value) - frappe.call("community.www.courses.course.get_messages", { batch: dropdown.value }, (data) => { - if (data.message) { - $(".discussions").children().remove(); - for (var i = 0; i < data.message.length; i++) { - var element = add_message(data.message[i]) - $(".discussions").append(element); - } + $(".list-batch").click((e) => { + var batch = decodeURIComponent($(e.currentTarget).attr("data-label")) + $(".current-batch").text(batch) + $(".send-message").attr("data-batch", batch) + frappe.call("community.www.courses.course.get_messages", { batch: batch }, (data) => { + if (data.message) { + $(".discussions").children().remove(); + for (var i = 0; i < data.message.length; i++) { + var element = add_message(data.message[i]) + $(".discussions").append(element); } - }) - } - } + } + }) + }) $(".send-message").click((e) => { var message = $(".message-text").val().trim(); if (message) { @@ -35,7 +34,7 @@ frappe.ready(() => { $(".message-text").val(""); } }) - var add_message = (message, session_user=false) => { + var add_message = (message, session_user = false) => { var author = session_user ? "You" : message.author return `
${author}
diff --git a/community/www/courses/index.html b/community/www/courses/index.html index 052c5921..8521497d 100644 --- a/community/www/courses/index.html +++ b/community/www/courses/index.html @@ -2,10 +2,10 @@ {% block title %}{{ 'Courses' }}{% endblock %} {% from "www/courses/macros/card.html" import course_card %} {% block head_include %} - - - + + + {% endblock %} {% block content %} @@ -16,8 +16,8 @@
{% for course in courses %} - {{ course_card(course) }} - {% endfor %} + {{ course_card(course) }} + {% endfor %}
diff --git a/community/www/hackathons/index.html b/community/www/hackathons/index.html index d434d8b3..245ab5a2 100644 --- a/community/www/hackathons/index.html +++ b/community/www/hackathons/index.html @@ -3,38 +3,38 @@ {% from "www/hackathons/macros/card.html" import hackathon_card %} {% from "www/hackathons/macros/card.html" import null_card %} {% block head_include %} - - - + section { + padding: 5rem 0 5rem 0; + } + {% endblock %} {% block content %} @@ -50,12 +50,12 @@
{% for hackathon in hackathons %} - {{ hackathon_card(hackathon) }} - {% endfor %} + {{ hackathon_card(hackathon) }} + {% endfor %} {% if hackathons %} - {% for n in range( (3 - (hackathons|length)) %3) %} - {{ null_card() }} - {% endfor %} + {% for n in range( (3 - (hackathons|length)) %3) %} + {{ null_card() }} + {% endfor %} {% endif %}