{% 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" %}
{{ _("Login") }}
{% elif condition is defined and not condition %}
{{ button_name }}
{% else %}
{% include "frappe/templates/discussions/button.html" %}
{% endif %}