85 lines
3.7 KiB
Twig
85 lines
3.7 KiB
Twig
{% extends 'base.html.twig' %}
|
|
|
|
{% block css %}
|
|
{{ parent() }}
|
|
|
|
<link rel="stylesheet" href="{{ web_path }}app/css/prism.css">
|
|
|
|
{% if theme_settings.name == 'dark' %}
|
|
<link rel="stylesheet" href="{{ web_path }}app/css/prism-okaidia.css">
|
|
{% else %}
|
|
<link rel="stylesheet" href="{{ web_path }}app/css/prism-solarizedlight.css">
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block title %}{{ gist.title ? gist.title : 'gist.untitled'|trans }} - {{ commit|slice(0, 10) }}{% endblock %}
|
|
|
|
{% block body %}
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<ul class="nav nav-tabs">
|
|
<li class="active">
|
|
<a href="{{ path('view', {gist: gist.file}) }}" class="cipher-link">
|
|
{{ 'gist.action.view'|trans }}
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a href="{{ path('revisions', {gist: gist.file}) }}" class="cipher-link">
|
|
{{ 'gist.action.history'|trans }}
|
|
<span class="badge">{{ history|length }}</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<div class="pull-right actions">
|
|
<span class="btn btn-warning btn-xs">
|
|
{{ commit|slice(0, 10) }}
|
|
</span>
|
|
|
|
{% if not gist.cipher %}
|
|
<a href="{{ path('raw', app.request.attributes.get('_route_params')) }}" class="btn btn-default btn-sm">
|
|
<span class="glyphicon glyphicon-eye-open"></span>
|
|
{{ 'gist.action.raw'|trans }}
|
|
</a>
|
|
<a href="{{ path('download', app.request.attributes.get('_route_params')) }}" class="btn btn-default btn-sm">
|
|
<span class="glyphicon glyphicon-save-file"></span>
|
|
{{ 'gist.action.download'|trans }}
|
|
</a>
|
|
{% endif %}
|
|
|
|
<a href="{{ path('clone', app.request.attributes.get('_route_params')) }}" class="btn btn-success btn-sm cipher-link">
|
|
<span class="glyphicon glyphicon-copy"></span>
|
|
{{ 'gist.action.clone'|trans }}
|
|
</a>
|
|
</div>
|
|
|
|
{{ gist.title ? gist.title : 'gist.untitled'|trans }}
|
|
|
|
</div>
|
|
<div class="panel-body">
|
|
<div class="tab-content">
|
|
<div id="view" class="tab-pane active in">
|
|
<div id="viewer">
|
|
<pre><code {% if gist.cipher %}data-cipher{% endif %} class="language-{{ gist.type }}" data-dependencies="{{ gist.type }}">{{ raw_content }}</code></pre>
|
|
</div>
|
|
|
|
<p id="embed" class="pull-right">
|
|
{{ 'gist.action.embed'|trans }}
|
|
<input type="text" class="form-control" id="embed-input" value="{{ '<div%key%id="gist-' ~ gist.file ~ '-' ~ commit ~ '" class="gist-container"></div><script src="' ~ app.request.getSchemeAndHttpHost() ~ path('embedjs', app.request.attributes.get('_route_params')) ~ '" async></script>' }}" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block js %}
|
|
{{ parent() }}
|
|
|
|
<script src="{{ web_path }}app/js/prism.js" {% if gist.cipher %}data-manual{% endif %}></script>
|
|
{% endblock %}
|