Add compare function between snipsContents
This commit is contained in:
38
templates/content/compare.html.twig
Normal file
38
templates/content/compare.html.twig
Normal file
@ -0,0 +1,38 @@
|
||||
{% 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 %}
|
@ -26,6 +26,9 @@
|
||||
<a href="{{ path('snip_raw', {snip: snip.id}) }}" class="btn btn-danger">
|
||||
<i class="fa fa-eye"></i> Raw
|
||||
</a>
|
||||
<a href="{{ path('content_compare', {to: snip.activeVersion.id}) }}" class="btn btn-warning">
|
||||
<i class="fa fa-eye"></i> Compare
|
||||
</a>
|
||||
<br><br>
|
||||
<div class="card" style="width: 100%;">
|
||||
<h4 class="card-header">
|
||||
|
Reference in New Issue
Block a user