2015-05-06 20:35:30 +02:00
{% extends 'base.html.twig' %}
2015-05-06 22:24:42 +02:00
{% block css %}
2015-05-07 00:35:31 +02:00
<link rel="stylesheet" href=" {{ web_path }} app/css/geshi/vibrant-ink.css" />
2015-05-06 22:24:42 +02:00
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" />
{% 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 , 1 0 ) }} {% 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">
{% if not gist .cipher %}
<ul class="nav nav-tabs">
<li class="active">
2015-05-07 13:38:24 +02:00
<a href=" {{ path ( 'view' , { gist : gist .file } ) }} ">
{{ 'gist.action.view' | trans }}
</a>
2015-05-06 20:39:51 +02:00
</li>
<li>
2015-05-07 00:51:52 +02:00
<a href=" {{ path ( 'revisions' , { gist : gist .file } ) }} ">
2015-05-07 13:38:24 +02:00
{{ 'gist.action.history' | trans }}
2015-05-06 22:24:42 +02:00
<span class="badge"> {{ history | length }} </span>
2015-05-06 20:39:51 +02:00
</a>
</li>
</ul>
{% endif %}
<div class="panel panel-default">
<div class="panel-heading">
{% if not gist .cipher %}
<div class="pull-right actions">
2015-05-09 01:03:51 +02:00
<span class="btn btn-warning btn-xs">
{{ commit | slice ( 0 , 1 0 ) }}
</span>
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>
2015-05-07 14:10:23 +02:00
<a href=" {{ path ( 'clone' , app .request .attributes .get ( '_route_params' ) ) }} " class="btn btn-success btn-sm">
2015-05-06 20:39:51 +02:00
<span class="glyphicon glyphicon-copy"></span>
2015-05-07 14:10:23 +02:00
{{ 'gist.action.clone' | trans }}
2015-05-06 20:39:51 +02:00
</a>
</div>
{% endif %}
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
<p id="embed" class="pull-right">
{{ 'gist.action.embed' | trans }}
<input type="text" class="form-control" value=" {{ '<div id="gist-' ~ gist .file ~ '-' ~ commit ~ '" class="gist-container"></div><script src="' ~ app .request .getSchemeAndHttpHost ( ) ~ path ( 'embedjs' , app .request .attributes .get ( '_route_params' ) ) ~ '"></script>' }} " />
</p>
2015-05-06 20:39:51 +02:00
</div>
{% if not gist .cipher %}
<div id="revisions" class="tab-pane out">
2015-05-06 22:24:42 +02:00
{% for commit in history %}
<div class="commit">
<p>
2015-05-07 00:35:31 +02:00
<a href=" {{ path ( 'view' , { gist : gist .file , commit : commit .commit } ) }} " class="btn btn-warning btn-sm">
{{ commit .commit | slice ( 0 , 1 0 ) }}
</a>
2015-05-06 22:46:29 +02:00
2015-05-07 00:35:31 +02:00
{% 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 ) }}
2015-05-06 22:24:42 +02:00
</p>
2015-05-06 22:46:29 +02:00
<div>
{% if not loop .first %}
2015-05-07 00:35:31 +02:00
<div class="diff" id="diff- {{ loop .index }} ">
{{ commit .diff | raw }}
2015-05-06 22:46:29 +02:00
</div>
{% endif %}
</div>
2015-05-06 22:24:42 +02:00
</div>
2015-05-06 20:35:30 +02:00
2015-05-06 22:24:42 +02:00
{% if not loop .last %}
<hr />
{% endif %}
{% endfor %}
2015-05-06 20:39:51 +02:00
</div>
{% endif %}
</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 %}
<script type="text/javascript" src=" {{ web_path }} components/SyntaxHighlighter/scripts/XRegExp.js"></script> <!-- XRegExp is bundled with the final shCore.js during build -->
<script type="text/javascript" src=" {{ web_path }} components/SyntaxHighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src=" {{ web_path }} components/SyntaxHighlighter/scripts/shAutoloader.js"></script>
<script type="text/javascript">
SyntaxHighlighter.autoloader(
['applescript', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushAppleScript.js' ],
['actionscript3', 'as3', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushAS3.js' ],
['bash', 'shell', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushBash.js' ],
['coldfusion', 'cf', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushColdFusion.js' ],
['cpp', 'c', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushCpp.js' ],
['c#', 'c-sharp', 'csharp', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushCSharp.js' ],
['css', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushCss.js' ],
['delphi', 'pascal', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushDelphi.js' ],
['diff', 'patch', 'pas', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushDiff.js' ],
['erl', 'erlang', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushErlang.js' ],
['groovy', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushGroovy.js' ],
['java', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushJava.js' ],
['jfx', 'javafx', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushJavaFX.js' ],
['js', 'jscript', 'javascript', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushJScript.js' ],
['perl', 'pl', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushPerl.js' ],
['php', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushPhp.js' ],
['text', 'plain', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushPlain.js' ],
['py', 'python', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushPython.js' ],
['ruby', 'rails', 'ror', 'rb', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushRuby.js' ],
['scala', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushScala.js' ],
['sql', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushSql.js' ],
['vb', 'vbnet', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushVb.js' ],
['xml', 'xhtml', 'xslt', 'html', ' {{ web_path }} components/SyntaxHighlighter/scripts/shBrushXml.js' ]
);
</script>
{% endif %}
2015-05-06 20:35:30 +02:00
{% endblock %}