git.fiddlerwoaroof.com
twig/file.twig
ffc9d555
 {% extends 'layout_page.twig' %}
 
 {% set page = 'files' %}
 
6933b58c
 {% block title %}
   GitList
 {% endblock %}
ffc9d555
 
 {% block content %}
6933b58c
   {% include 'breadcrumb.twig' with {breadcrumbs: breadcrumbs} %}
 
   <div class="source-view">
     <div class="source-header">
       <div class="meta"></div>
 
       <script src="https://code.jquery.com/jquery-2.2.3.js"></script>
       <div class="btn-group pull-right">
         <button type="button" id="colorswitch" class="btn btn-small">Light/Dark</button>
         <a href="{{ path('blob_raw', {repo: repo, commitishPath: branch ~ '/' ~ file}) }}" class="btn btn-small"><i class="icon-file"></i> Raw</a>
         <a href="{{ path('blame', {repo: repo, commitishPath: branch ~ '/' ~ file}) }}" class="btn btn-small"><i class="icon-bullhorn"></i> Blame</a>
         <a href="{{ path('commits', {repo: repo, commitishPath: branch ~ '/' ~ file}) }}" class="btn btn-small"><i class="icon-list-alt"></i> History</a>
       </div>
ffc9d555
     </div>
6933b58c
     {% if fileType == 'image' %}
       <center><img src="{{ path('blob_raw', {repo: repo, commitishPath: branch ~ '/' ~ file}) }}" alt="{{ file }}" class="image-blob" /></center>
 
     {% elseif fileType == 'markdown' %}
       <div class="md-view"><div id="md-content">{{ blob }}</div></div>
 
     {% else %}
       <pre id="sourcecode" language="{{ fileType }}">{{ blob|htmlentities|raw }}</pre>
     {% endif %}
   </div>
 
   <script type="text/javascript">
 function flip () {
   var oldClass = 'cm-s-dark', newClass = 'cm-s-light';
   var $target = $('.CodeMirror-scroll');
   if ($target.hasClass('cm-s-light')) {
   oldClass = newClass;
   newClass = 'cm-s-dark';
 }
 
   $target.removeClass(oldClass).addClass(newClass);
 }
 
   jQuery('#colorswitch').click(flip);
   </script>
ffc9d555
 {% endblock %}