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

{% perm 'screenshot.edit' object.component as user_can_change_screenshot %}

{% for unit in sources %}
{% if unit %}
<tr>
<td class="translatetext">{% format_translation unit.source unit.translation.component.project.source_language %}</td>
<td>{{ unit.context }}</td>
<td>{{ unit.location }}</td>
<td>
<a href="{{ unit.get_absolute_url }}" class="btn btn-primary">{% trans "View" %}</a>
</td>
{% if user_can_change_screenshot %}
<td>
<form action="{% url 'screenshot-remove-source' pk=object.pk %}" method="POST">
{% csrf_token %}
<input type="hidden" name="source" value="{{ unit.pk }}" />
<button type="submit" class="btn btn-danger">{% trans "Remove" %}</button>
</form>
{% endif %}
</td>
</tr>
{% endif %}
{% empty %}
<tr class="warning">
<td colspan="5">{% trans "No source strings are currently assigned!" %}</td>
</tr>
{% endfor %}
