{% if topic %}

{% set replies = influxframework.get_all("Discussion Reply", {"topic": topic.name},
["reply", "owner", "creation", "name"], order_by="creation")%}

{% endif %}

<div class=" {% if not single_thread %} collapse {% endif %} discussion-on-page card-style" data-parent="#discussion-group"
	{% if topic %} id="t{{ topic.name }}" data-topic="{{ topic.name }}" {% endif %}>

	<div class="reply-section-header">
		{% if not single_thread %}
		<div class="back-button">
			<svg class="icon icon-md mr-0">
				<use class="" href="#icon-left"></use>
			</svg>
		</div>
		{% endif %}

		{% if topic and topic.title %}
		<div class="discussion-heading p-0">{{ topic.title }}</div>
		{% endif %}
	</div>

	{% for reply in replies %}
	{% set index = loop.index %}
	{% include "influxframework/templates/discussions/reply_card.html" %}
	{% endfor %}

	{% if influxframework.session.user == "Guest" or (condition is defined and not condition) %}
	<div class="empty-state">
		<div>
		  <img class="icon icon-xl" src="/assets/influxframework/icons/timeless/message.svg">
		</div>
		<div class="empty-state-text">
		  <div class="empty-state-heading">{{ _("Want to discuss?") }}</div>
		  <div class="course-meta">{{ _("Post it here, our mentors will help you out.") }}</div>
		</div>
		<div>
			{% if influxframework.session.user == "Guest" %}
			<div class="btn btn-default btn-md login-from-discussion"> {{ _("Login") }} </div>
			{% elif condition is defined and not condition %}
			<div class="btn btn-default btn-md login-from-discussion" data-redirect="{{ redirect_to }}">
				{{ button_name }}
			</div>
			{% endif %}
		</div>
	</div>
	{% else %}
	{% include "influxframework/templates/discussions/comment_box.html" %}
	{% endif %}
</div>
