1
0
Fork 0
forked from deblan/gist
gist/src/Gist/Resources/views/View/view.html.twig

90 lines
3.9 KiB
Twig
Raw Normal View History

2015-05-06 20:35:30 +02:00
{% extends 'base.html.twig' %}
2015-05-06 22:24:42 +02:00
{% block css %}
2015-05-08 16:44:59 +02:00
{% if gist.cipher %}
<link type="text/css" rel="Stylesheet" href="{{ web_path }}components/SyntaxHighlighter/styles/shCoreRDark.css" />
<link type="text/css" rel="Stylesheet" href="{{ web_path }}components/SyntaxHighlighter/styles/shThemeRDark.css" />
2015-05-11 21:06:41 +02:00
{% else %}
<link rel="stylesheet" href="{{ web_path }}app/css/geshi/vibrant-ink.css" />
2015-05-08 16:44:59 +02:00
{% endif %}
2015-05-07 00:35:31 +02:00
{{ parent() }}
2015-05-06 22:24:42 +02:00
{% endblock %}
2015-05-08 16:44:59 +02:00
{% block title %}{{ gist.title ? gist.title : 'gist.untitled'|trans }} - {{ commit|slice(0, 10) }}{% endblock %}
2015-05-06 20:35:30 +02:00
{% block body %}
2015-05-06 20:39:51 +02:00
<div class="row">
<div class="col-md-12">
2016-09-24 14:43:15 +02:00
<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>
2015-05-06 20:39:51 +02:00
<div class="panel panel-default">
<div class="panel-heading">
2016-09-24 14:43:15 +02:00
<div class="pull-right actions">
<span class="btn btn-warning btn-xs">
{{ commit|slice(0, 10) }}
</span>
2015-05-09 01:03:51 +02:00
2016-09-24 14:43:15 +02:00
{% if not gist.cipher %}
2015-05-07 13:38:24 +02:00
<a href="{{ path('raw', app.request.attributes.get('_route_params')) }}" class="btn btn-default btn-sm">
2015-05-06 20:39:51 +02:00
<span class="glyphicon glyphicon-eye-open"></span>
2015-05-07 13:38:24 +02:00
{{ 'gist.action.raw'|trans }}
2015-05-06 20:39:51 +02:00
</a>
2015-05-07 13:38:24 +02:00
<a href="{{ path('download', app.request.attributes.get('_route_params')) }}" class="btn btn-default btn-sm">
2015-05-06 20:39:51 +02:00
<span class="glyphicon glyphicon-save-file"></span>
2015-05-07 13:38:24 +02:00
{{ 'gist.action.download'|trans }}
2015-05-06 20:39:51 +02:00
</a>
2016-09-24 14:43:15 +02:00
{% 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>
2015-05-06 20:35:30 +02:00
2015-05-06 20:39:51 +02:00
{{ gist.title ? gist.title : 'gist.untitled'|trans }}
2015-05-09 01:03:51 +02:00
2015-05-06 20:39:51 +02:00
</div>
<div class="panel-body">
<div class="tab-content">
<div id="view" class="tab-pane active in">
<div id="viewer">
{% if gist.cipher %}
2015-05-09 01:03:51 +02:00
<pre class="brush: {{ gist.type }}; syntaxhighlighter">{{ raw_content|raw }}</pre>
2015-05-06 22:24:42 +02:00
{% else %}
{{ content|raw }}
2015-05-06 20:39:51 +02:00
{% endif %}
</div>
2015-05-09 17:42:33 +02:00
2015-05-11 21:06:41 +02:00
<p id="embed" class="pull-right">
{{ 'gist.action.embed'|trans }}
2015-05-25 02:38:51 +02:00
<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>' }}" />
2015-05-11 21:06:41 +02:00
</p>
2015-05-06 20:39:51 +02:00
</div>
</div>
</div>
</div>
</div>
</div>
2015-05-06 20:35:30 +02:00
{% endblock %}
{% block js %}
2015-05-06 20:39:51 +02:00
{{ parent() }}
2015-05-08 16:44:59 +02:00
{% if gist.cipher %}
2016-09-24 16:07:35 +02:00
{{ include('View/cipherJs.html.twig') }}
2015-05-08 16:44:59 +02:00
{% endif %}
2015-05-06 20:35:30 +02:00
{% endblock %}