Snips/templates/content/compare.html.twig

38 lines
1.1 KiB
Twig

{% extends 'base/single.column.html.twig' %}
{% set title = 'Snip compare ' ~ snip %}
{% block body %}
<a href="{{ path('snip_single', {snip: snip.id}) }}" class="btn btn-primary">
<i class="fa fa-arrow-left"></i> Back
</a>
<br><br>
<table class="table table-condensed table-hover">
<thead>
<tr>
<th>Line</th>
<th>Old</th>
<th>New</th>
</tr>
</thead>
<tbody>
{% for line in diff %}
<tr>
<td class="table-{{ line.type == 'insert' ? 'success' : (line.type == 'delete' ? 'danger' : 'info') }}">
{{ line.type }}
</td>
<td>
{% if line.from %}
{{ line.from }}
{% endif %}
</td>
<td>
{% if line.to %}
{{ line.to }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}