{% set topics = frappe.get_all("Discussion Topic", {"reference_doctype": doctype, "reference_docname": docname}, ["name", "title", "owner", "creation"]) %}
{% include "frappe/templates/discussions/topic_modal.html" %}
{{ _(title) }} {% if topics | length and not single_thread %} {% include "frappe/templates/discussions/search.html" %} {% endif %} {% if topics and not single_thread %} {% include "frappe/templates/discussions/button.html" %} {% endif %}
{% if topics and not single_thread %}
{% for topic in topics %} {% set replies = frappe.get_all("Discussion Reply", {"topic": topic.name})%} {% include "frappe/templates/discussions/sidebar.html" %} {% if loop.index != topics | length %}
{% endif %} {% endfor %}
{% for topic in topics %} {% include "frappe/templates/discussions/reply_section.html" %} {% endfor %}
{% elif single_thread %} {% set topic = topics[0] if topics | length else None %} {% include "frappe/templates/discussions/reply_section.html" %} {% else %}
{{ empty_state_title }}
{{ empty_state_subtitle }}
{% if frappe.session.user == "Guest" %} {% elif condition is defined and not condition %} {% else %} {% include "frappe/templates/discussions/button.html" %} {% endif %}
{% endif %}
{% block script %} {% endblock %} {% block style %} {% endblock %}