diff --git a/community/community/doctype/discussion_topic/discussion_topic.py b/community/community/doctype/discussion_topic/discussion_topic.py index a340f837..4ab8558f 100644 --- a/community/community/doctype/discussion_topic/discussion_topic.py +++ b/community/community/doctype/discussion_topic/discussion_topic.py @@ -29,3 +29,7 @@ def save_message(reply, topic): "reply": reply, "topic": topic }).save(ignore_permissions=True) + +@frappe.whitelist() +def get_docname(route): + return frappe.db.get_value("Web Page", {"route": route}, ["name"]) diff --git a/community/community/web_template/discussions/discussions.html b/community/community/web_template/discussions/discussions.html index c738992d..4e4fd0bc 100644 --- a/community/community/web_template/discussions/discussions.html +++ b/community/community/web_template/discussions/discussions.html @@ -1 +1,2 @@ -{{ widgets.DiscussionMessage }} +{% set docname = frappe.db.get_value("Web Page", {"route": ""}, ["name"])%} +{{ widgets.DiscussionMessage(doctype="Web Page", docname=docname) }} diff --git a/community/community/widgets/DiscussionMessage.html b/community/community/widgets/DiscussionMessage.html index d2cc0f85..f36936c0 100644 --- a/community/community/widgets/DiscussionMessage.html +++ b/community/community/widgets/DiscussionMessage.html @@ -23,12 +23,16 @@ {% endfor %} {% endfor %} + {% if not topics %} +
No discussions yet.
+ {% endif %} -