{% load comments_tags %}

{% if form %}
	<div id="comment-input-div">
		<form method="POST" action="{% url "comment-create" %}" class="add-comment-form">
			{% csrf_token %}
			{{ form.errors }}
			{{ form.comment.label }}
			<br>
			{{ form.comment }}
			{% if target %}	
				<input name="model" value="{% get_model_name target %}" hidden>
				<input name="model_id" value="{{ target.id }}" hidden>
				<input name="app_name" value="{% get_app_name target %}" hidden>
			{% endif %}
			<input id="id_user" name="user" value="{% if user.is_authenticated %}{{ user.id }}{% endif %}" hidden>
			<input type="submit" value="Submit" id="add-comment" />
		</form>
	</div>
{% endif %}

