{% load translations %}
{% load i18n %}
{% load permissions %}

{% can_delete_comment user unit.translation.subproject.project as user_can_delete_comment %}

{% for comment in comments %}
<div>
<strong>{{ comment.get_user_display }}</strong>
{{ comment.timestamp|naturaltime }}
<span class="pull-right flip badge">
{% if comment.language %}
{% trans "Translation comment" %}
{% else %}
{% trans "Source string comment" %}
{% endif %}
</span>
</div>
{% if user_can_delete_comment %}
<form method="POST" action="{% url 'delete-comment' pk=comment.pk %}">
{% csrf_token %}
<input type="hidden" name="next" value="{{ next_url }}" />
<button class="btn btn-danger btn-xs pull-right flip"><i class="fa fa-trash"></i> {% trans "Delete" %}</button>
</form>
<div class="clearfix"></div>
{% endif %}
<div class="list-group">
<div class="list-group-item" dir="auto">{{ comment.comment }}</div>
</div>
{% endfor %}
