{% load i18n %}

<table class="table">
<thead>
<tr><th>{% trans "Component" %}</th><th>{% trans "Matched files" %}</th></tr>
</thead>
<tbody>
{% if matches_deleted %}
<tr><th colspan="3" class="danger">{% trans "The following components would be deleted" %}</th></tr>
{% for match in matches_deleted %}
<tr><th><a href="{{ match.1.get_absolute_url }}">{{ match.1 }}</a></th><td></td></tr>
{% endfor %}
{% endif %}
{% if matches_created %}
<tr><th colspan="3" class="info">{% trans "The following components would be created" %}</th></tr>
{% for match in matches_created %}
<tr>
<th>{{ match.0.name }}</th>
<td>
{% for file, lang in match.0.files_langs %}
<code>{{ file }}</code> ({{ lang }})<br/>
{% endfor %}
</td>
</tr>
{% endfor %}
{% endif %}
{% if matches_matched %}
<tr><th colspan="3" class="info">{% trans "The following components matched existing ones" %}</th></tr>
{% for match in matches_matched %}
<tr>
<th><a href="{{ match.1.get_absolute_url }}">{{ match.1 }}</a></th>
<td>
{% for file, lang in match.0.files_langs %}
<code>{{ file }}</code> ({{ lang }})<br/>
{% endfor %}
</td>
</tr>
{% endfor %}
{% endif %}
{% if not matches_deleted and not matches_created and not matches_matched %}
<tr><th colspan="3" class="danger">{% trans "No matching components were found!" %}</th></tr>
{% endif %}
</tbody>
</table>


{% for match in matches %}
{{ match }}
{% endfor %}
