gist/src/Gist/Resources/views/View/revisions.html.twig

82 lines
3.5 KiB
Twig

{% extends 'base.html.twig' %}
{% block css %}
<link rel="stylesheet" href="{{ web_path }}app/css/geshi/vibrant-ink.css" />
{{ parent() }}
{% endblock %}
{% block title %}{{ gist.title ? gist.title : 'gist.untitled'|trans }} - {{ 'gist.action.history'|trans }}{% endblock %}
{% block body %}
<div class="row">
<div class="col-md-12">
{% if not gist.cipher %}
<ul class="nav nav-tabs">
<li>
<a href="{{ path('view', {gist: gist.file}) }}">
{{ 'gist.action.view'|trans }}
</a>
</li>
<li class="active">
<a href="{{ path('revisions', {gist: gist.file}) }}">
{{ 'gist.action.history'|trans }}
<span class="badge">{{ history|length }}</span>
</a>
</li>
</ul>
{% endif %}
<div class="panel panel-default">
<div class="panel-heading">
{{ gist.title ? gist.title : 'gist.untitled'|trans }}
</div>
<div class="panel-body">
<div class="tab-content">
{% if not gist.cipher %}
<div id="revisions" class="tab-pane in active">
{% for commit in history %}
<div class="commit">
<p>
<a href="{{ path('view', {gist: gist.file, commit: commit.commit}) }}" class="btn btn-warning btn-sm">
{{ commit.commit|slice(0, 10) }}
</a>
{% if loop.first %}<span class="btn btn-info btn-sm">init</span>{% endif %}
{% if not loop.first %}
<a href="#diff-{{ loop.index }}" data-target="#diff-{{ loop.index }}" class="btn btn-default btn-sm show-diff">
diff
</a>
{% endif %}
</p>
<p>
{{ commit.date|date('date.format'|trans) }}
</p>
<div>
{% if not loop.first %}
<div class="diff" id="diff-{{ loop.index }}">
{{ commit.diff|raw }}
</div>
{% endif %}
</div>
</div>
{% if not loop.last %}
<hr />
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block js %}
{{ parent() }}
{% endblock %}