Allow going back to a previous commit
This commit is contained in:
19
templates/history/index.html.twig
Normal file
19
templates/history/index.html.twig
Normal file
@ -0,0 +1,19 @@
|
||||
{% extends 'base/base.html.twig' %}
|
||||
|
||||
{% block title %}Snip {{ snip }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<a href="{{ path('snip_single', {snip: snip.id}) }}" class="btn btn-primary">
|
||||
<i class="fa fa-arrow-left"></i> Back
|
||||
</a>
|
||||
<a href="{{ path('history_set', {commit: 'master', snip: snip.id}) }}" class="btn btn-primary">
|
||||
<i class="fa fa-reset"></i> Reset to latest
|
||||
</a>
|
||||
<div class="list-group">
|
||||
{% for commit in commits %}
|
||||
<a class="list-group-item" href="{{ path('history_set', {commit: commit.hash, snip: snip.id}) }}">
|
||||
{{ commit.date|date }} - {{ commit.hash }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
@ -10,6 +10,9 @@
|
||||
<a class="btn btn-warning" href="{{ path('snip_edit', {snip: snip.id}) }}">
|
||||
<i class="fa fa-pencil" aria-hidden="true"></i> Edit
|
||||
</a>
|
||||
<a class="btn btn-info" href="{{ path('history_index', {snip: snip.id}) }}">
|
||||
<i class="fa fa-history" aria-hidden="true"></i> History
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href="{{ path('snip_raw', {snip: snip.id}) }}" class="btn btn-danger">
|
||||
<i class="fa fa-eye"></i> Raw
|
||||
|
Reference in New Issue
Block a user