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


{% 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>
{% perm 'comment.delete' comment object as user_can_delete_comment %}
{% if user_can_delete_comment %}
<form method="POST" action="{% url 'delete-comment' pk=comment.pk %}" class="auto-save-translation">
{% 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{% if not comment.language %} list-group-item-warning{% endif %}" dir="auto">{{ comment.comment|urlize|linebreaks }}</div>
</div>
{% endfor %}
